vercel/ai · error · InvalidArgumentError

Invalid argument for parameter requests: request IDs must no

Error message

Invalid argument for parameter requests: request IDs must not be empty

What it means

As part of validateACPLifecycleCompatibility, the persisted lifecycleData.implementationIdentity is compared with the identity of the implementation (e.g. the agent binary/version) configured in the current harness. If they differ, the lifecycle state was created by a different implementation and cannot be safely resumed.

Source

Thrown at packages/ai/src/batch/batch.ts:257

    typeof candidate.experimental_doGetBatchStatus === 'function' &&
    typeof candidate.experimental_doGetBatchResults === 'function'
  );
}

function validateRequests(requests: ReadonlyArray<TextBatchRequest>) {
  if (requests.length === 0) {
    throw new InvalidArgumentError({
      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);
  }
}

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Resume the lifecycle state with the same implementation identity (same agent binary/version) that produced it.
  2. Reinstall or pin the agent binary to the version recorded in lifecycleData.implementationIdentity.
  3. Start a fresh session if you intend to use the new implementation version.

Example fix

// before
// lifecycle captured with claude-code 1.2.0, binary now upgraded to 1.3.0
createACPV1({ implementation: claudeCode130, lifecycle: state })

// after
createACPV1({ implementation: claudeCode120, lifecycle: state })
Defensive patterns

Strategy: validation

Validate before calling

if (lifecycleData.implementationIdentity !== configuredImplementation.identity) {
  throw new Error('Implementation changed; cannot resume lifecycle state');
}

Try / catch

try {
  harness = createACPV1({ implementation, lifecycle: state });
} catch (error) {
  if (error instanceof Error && error.message.includes('incompatible with the configured implementation')) {
    // agent version drifted: either pin the old binary or start a new session
    harness = createACPV1({ implementation, lifecycle: undefined });
  } else {
    throw error;
  }
}

Prevention

When it happens

Trigger: Resuming ACP lifecycle state after the underlying agent implementation (binary, version, identity string) changed; passing state captured with one agent version into a harness configured with another; upgrading the agent CLI between turns.

Common situations: The agent binary was auto-upgraded between the original turn and the resume; switching between agent distributions (stable vs canary) for the same session; pointing the harness at a different executable path.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/b52d8fd52bc9b0a2. Report an issue: GitHub.