paperclipai/paperclip · error · Error

unsupported request schema

Error message

unsupported request schema

What it means

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.

Source

Thrown at packages/paperclip-runner/src/cli/eval-session-contract.ts:217

      profile.maxIterations,
      "request.agentCoreProfile.maxIterations",
    ),
    maxOutputTokens: positiveInteger(
      profile.maxOutputTokens,
      "request.agentCoreProfile.maxOutputTokens",
    ),
    timeoutSeconds: positiveInteger(
      profile.timeoutSeconds,
      "request.agentCoreProfile.timeoutSeconds",
    ),
  };
}

/** Fail-closed validation for the executable boundary. */
export function parseEvalSessionRequest(value: unknown): EvalSessionRequest {
  const input = object(value, "request");
  if (input.schema !== EVAL_SESSION_REQUEST_SCHEMA) {
    throw new Error("unsupported request schema");
  }
  const providerValue = input.provider ?? "codex";
  if (
    providerValue !== "codex" &&
    providerValue !== "opencode" &&
    providerValue !== "claude_managed" &&
    providerValue !== "aws_agentcore" &&
    providerValue !== "acpx"
  ) {
    throw new Error(
      "eval-session provider is unsupported by CapabilityLiveSessionService",
    );
  }
  const provider = providerValue;
  const driver = expectedEvalSessionDriver(provider);
  if (input.driver !== undefined && input.driver !== driver) {
    throw new Error("eval-session provider/driver mismatch");
  }

View on GitHub (pinned to 01ad858492)

Solutions

  1. Set request.schema to the EVAL_SESSION_REQUEST_SCHEMA value exported by this version of eval-session-contract.ts
  2. Upgrade the calling client so it matches the runner's schema constant
  3. Regenerate/rebuild stale request payloads produced before the schema bump
  4. If schema drift is intentional, deploy both sides in lockstep rather than hand-editing the field

Example fix

// before
const req = { provider: 'codex', driver: 'codex_app_server' };
// after
import { EVAL_SESSION_REQUEST_SCHEMA } from './eval-session-contract';
const req = { schema: EVAL_SESSION_REQUEST_SCHEMA, provider: 'codex', driver: 'codex_app_server' };
Defensive patterns

Strategy: validation

Validate before calling

import { EVAL_SESSION_REQUEST_SCHEMA } from './eval-session-contract';
if (payload.schema !== EVAL_SESSION_REQUEST_SCHEMA) {
  throw new Error(`request schema ${payload.schema} unsupported; expected ${EVAL_SESSION_REQUEST_SCHEMA}`);
}

Type guard

function hasSupportedSchema(v) {
  return typeof v?.schema === 'string' && v.schema === EVAL_SESSION_REQUEST_SCHEMA;
}

Try / catch

try {
  const request = parseEvalSessionRequest(raw);
} catch (err) {
  if (err.message === 'unsupported request schema') {
    throw new VersionMismatchError('Caller and runner eval-session schemas differ — rebuild/upgrade both sides', { cause: err });
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-02). Data as JSON: /api/errors/b313bd87f1719940. Report an issue: GitHub.