vercel/ai · error · InvalidArgumentError
Invalid argument for parameter requests: request IDs must be
Error message
Invalid argument for parameter requests: request IDs must be unique; duplicate ID "${request.id}" What it means
The lifecycle state stores a digest of the authentication profile in effect when it was created. validateACPLifecycleCompatibility recomputes/compares it with the currently configured authenticationProfile and throws when the digests differ, because resuming a session under different credentials could act as a different principal.
Source
Thrown at packages/ai/src/batch/batch.ts:265
parameter: 'requests',
value: requests,
message: 'requests must not be empty',
});
}
const ids = new Set<string>();
for (const request of requests) {
if (request.id.trim().length === 0) {
throw new InvalidArgumentError({
parameter: 'requests',
value: requests,
message: 'request IDs must not be empty',
});
}
if (ids.has(request.id)) {
throw new InvalidArgumentError({
parameter: 'requests',
value: requests,
message: `request IDs must be unique; duplicate ID "${request.id}"`,
});
}
ids.add(request.id);
}
}
function validateBatchReference({
model,
batch,
}: {
model: BatchLanguageModelV4;
batch: BatchReference;
}) {
if (batch.version !== 1 || batch.type !== 'text') {View on GitHub (pinned to 69428b1f8b)
Solutions
- Configure the same authentication profile (same credentials) that was used when the lifecycle state was captured.
- Restore the original credentials (e.g. check out the same env/API key) and retry.
- If credentials must change, start a new session rather than resuming the old lifecycle state.
Example fix
// before
createACPV1({ authenticationProfile: profileFor(process.env.NEW_API_KEY), lifecycle: state })
// after
createACPV1({ authenticationProfile: originalProfileUsedFor(state), lifecycle: state }) Defensive patterns
Strategy: validation
Validate before calling
if (lifecycleData.authenticationProfile?.digest !== authenticationProfile.digest) {
throw new Error('Credentials changed; cannot resume lifecycle state');
} Try / catch
try {
harness = createACPV1({ authenticationProfile, lifecycle: state });
} catch (error) {
if (error instanceof Error && error.message.includes('authentication profile')) {
// credential mismatch: restore original credentials or start fresh
harness = createACPV1({ lifecycle: undefined });
} else {
throw error;
}
} Prevention
- Rotate credentials only between sessions, never mid-session.
- Persist sessions keyed by auth-profile digest so only matching credentials can resume them.
- Use stable service accounts (not personal keys) for CI and long-lived sessions.
When it happens
Trigger: Resuming ACP lifecycle state after the API key, auth token, or authentication profile configuration changed; rotating credentials between the original turn and the rerun; using a different account's credentials for the same session.
Common situations: Credential rotation policies that change keys mid-session; switching from a personal to a service-account key; CI running with a different secret than a developer's original session.
Related errors
- Invalid argument for parameter requests: requests must not b
- Invalid argument for parameter requests: request IDs must no
- Invalid argument for parameter batch: batch must be a suppor
- AWS credential provider failed: ${errorMessage}. Please ensu
- AWS SigV4 authentication requires AWS credentials. Please pr
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/788ab5300a92d4ce.
Report an issue: GitHub.