{"record":{"id":"788ab5300a92d4ce","repo":"vercel/ai","slug":"invalid-argument-for-parameter-requests-request-i-788ab5","errorCode":null,"errorMessage":"Invalid argument for parameter requests: request IDs must be unique; duplicate ID \"${request.id}\"","messagePattern":"Invalid argument for parameter requests: request IDs must be unique; duplicate ID \"(.+?)\"","errorType":"validation","errorClass":"InvalidArgumentError","httpStatus":null,"severity":"error","filePath":"packages/ai/src/batch/batch.ts","lineNumber":265,"sourceCode":"      parameter: 'requests',\n      value: requests,\n      message: 'requests must not be empty',\n    });\n  }\n\n  const ids = new Set<string>();\n\n  for (const request of requests) {\n    if (request.id.trim().length === 0) {\n      throw new InvalidArgumentError({\n        parameter: 'requests',\n        value: requests,\n        message: 'request IDs must not be empty',\n      });\n    }\n\n    if (ids.has(request.id)) {\n      throw new InvalidArgumentError({\n        parameter: 'requests',\n        value: requests,\n        message: `request IDs must be unique; duplicate ID \"${request.id}\"`,\n      });\n    }\n\n    ids.add(request.id);\n  }\n}\n\nfunction validateBatchReference({\n  model,\n  batch,\n}: {\n  model: BatchLanguageModelV4;\n  batch: BatchReference;\n}) {\n  if (batch.version !== 1 || batch.type !== 'text') {","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/ai/src/batch/batch.ts#L247-L283","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ncreateACPV1({ authenticationProfile: profileFor(process.env.NEW_API_KEY), lifecycle: state })\n\n// after\ncreateACPV1({ authenticationProfile: originalProfileUsedFor(state), lifecycle: state })","handlingStrategy":"validation","validationCode":"if (lifecycleData.authenticationProfile?.digest !== authenticationProfile.digest) {\n  throw new Error('Credentials changed; cannot resume lifecycle state');\n}","typeGuard":null,"tryCatchPattern":"try {\n  harness = createACPV1({ authenticationProfile, lifecycle: state });\n} catch (error) {\n  if (error instanceof Error && error.message.includes('authentication profile')) {\n    // credential mismatch: restore original credentials or start fresh\n    harness = createACPV1({ lifecycle: undefined });\n  } else {\n    throw error;\n  }\n}","preventionTips":["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."],"tags":["acp","lifecycle","authentication","credentials"],"backgroundTag":"auth-profile-mismatch","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}