{"record":{"id":"b313bd87f1719940","repo":"paperclipai/paperclip","slug":"unsupported-request-schema","errorCode":null,"errorMessage":"unsupported request schema","messagePattern":"unsupported request schema","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/cli/eval-session-contract.ts","lineNumber":217,"sourceCode":"      profile.maxIterations,\n      \"request.agentCoreProfile.maxIterations\",\n    ),\n    maxOutputTokens: positiveInteger(\n      profile.maxOutputTokens,\n      \"request.agentCoreProfile.maxOutputTokens\",\n    ),\n    timeoutSeconds: positiveInteger(\n      profile.timeoutSeconds,\n      \"request.agentCoreProfile.timeoutSeconds\",\n    ),\n  };\n}\n\n/** Fail-closed validation for the executable boundary. */\nexport function parseEvalSessionRequest(value: unknown): EvalSessionRequest {\n  const input = object(value, \"request\");\n  if (input.schema !== EVAL_SESSION_REQUEST_SCHEMA) {\n    throw new Error(\"unsupported request schema\");\n  }\n  const providerValue = input.provider ?? \"codex\";\n  if (\n    providerValue !== \"codex\" &&\n    providerValue !== \"opencode\" &&\n    providerValue !== \"claude_managed\" &&\n    providerValue !== \"aws_agentcore\" &&\n    providerValue !== \"acpx\"\n  ) {\n    throw new Error(\n      \"eval-session provider is unsupported by CapabilityLiveSessionService\",\n    );\n  }\n  const provider = providerValue;\n  const driver = expectedEvalSessionDriver(provider);\n  if (input.driver !== undefined && input.driver !== driver) {\n    throw new Error(\"eval-session provider/driver mismatch\");\n  }","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/cli/eval-session-contract.ts#L199-L235","documentation":"parseEvalSessionRequest is the fail-closed gate at the executable boundary of the eval-session CLI. The request must carry input.schema equal to the expected EVAL_SESSION_REQUEST_SCHEMA constant; anything else (missing field, stale schema id, wrong value) throws 'unsupported request schema' before any other validation runs.","triggerScenarios":"Calling parseEvalSessionRequest with a request object whose schema field is absent, or set to a different/older schema identifier than the EVAL_SESSION_REQUEST_SCHEMA constant this build expects.","commonSituations":"Caller and runner were built from different commits so schema constants diverged; an older eval-session client was not upgraded after a contract bump; the schema field was renamed or dropped in a hand-written payload; a cached/stale request blob is replayed after upgrade.","solutions":["Set request.schema to the EVAL_SESSION_REQUEST_SCHEMA value exported by this version of eval-session-contract.ts","Upgrade the calling client so it matches the runner's schema constant","Regenerate/rebuild stale request payloads produced before the schema bump","If schema drift is intentional, deploy both sides in lockstep rather than hand-editing the field"],"exampleFix":"// before\nconst req = { provider: 'codex', driver: 'codex_app_server' };\n// after\nimport { EVAL_SESSION_REQUEST_SCHEMA } from './eval-session-contract';\nconst req = { schema: EVAL_SESSION_REQUEST_SCHEMA, provider: 'codex', driver: 'codex_app_server' };","handlingStrategy":"validation","validationCode":"import { EVAL_SESSION_REQUEST_SCHEMA } from './eval-session-contract';\nif (payload.schema !== EVAL_SESSION_REQUEST_SCHEMA) {\n  throw new Error(`request schema ${payload.schema} unsupported; expected ${EVAL_SESSION_REQUEST_SCHEMA}`);\n}","typeGuard":"function hasSupportedSchema(v) {\n  return typeof v?.schema === 'string' && v.schema === EVAL_SESSION_REQUEST_SCHEMA;\n}","tryCatchPattern":"try {\n  const request = parseEvalSessionRequest(raw);\n} catch (err) {\n  if (err.message === 'unsupported request schema') {\n    throw new VersionMismatchError('Caller and runner eval-session schemas differ — rebuild/upgrade both sides', { cause: err });\n  }\n  throw err;\n}","preventionTips":["Always construct requests via a shared factory that sets schema from the exported constant","Upgrade callers and runners together when the schema constant changes","Include the expected schema id in error surfaced to users for faster triage","Reject stale cached request blobs after upgrades instead of replaying them"],"tags":["validation","schema","versioning","contract"],"backgroundTag":"schema-version-mismatch","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-02T18:44:00.616Z","contentChangedAt":"2026-09-02T18:44:00.616Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}