{"record":{"id":"1c7749859857be0d","repo":"paperclipai/paperclip","slug":"invalid-model","errorCode":"invalid_model","errorMessage":"Model is too long.","messagePattern":"Model is too long\\.","errorType":"http","errorClass":"RouteError","httpStatus":400,"severity":"error","filePath":"packages/paperclip-runner/scripts/capability-issue-thread-server.mjs","lineNumber":215,"sourceCode":"    ],\n  });\n}\n\nclass RouteError extends Error {\n  constructor(status, code, message) {\n    super(message);\n    this.status = status;\n    this.code = code;\n  }\n}\n\nfunction harnessConfiguration(source, fallbackModel) {\n  const provider = source.provider === undefined ? \"codex\" : String(source.provider).trim();\n  if (provider !== \"codex\" && provider !== \"opencode\" && provider !== \"claude_managed\" && provider !== \"aws_agentcore\" && provider !== \"acpx\") {\n    throw new RouteError(400, \"invalid_provider\", \"Provider must be codex, opencode, claude_managed, aws_agentcore, or acpx.\");\n  }\n  const rawModel = source.model === undefined ? fallbackModel : source.model;\n  const model = rawModel === undefined || rawModel === null ? \"\" : String(rawModel).trim();\n  if (model.length > 256) throw new RouteError(400, \"invalid_model\", \"Model is too long.\");\n  if (provider === \"opencode\" && (!model || !model.includes(\"/\"))) {\n    throw new RouteError(400, \"invalid_model\", \"OpenCode requires a provider/model value.\");\n  }\n  if (provider === \"claude_managed\" && model !== \"claude-sonnet-5\") {\n    throw new RouteError(400, \"invalid_model\", \"Claude Managed requires exact model claude-sonnet-5.\");\n  }\n  if (provider === \"aws_agentcore\" && model !== \"global.anthropic.claude-sonnet-4-6\") {\n    throw new RouteError(400, \"invalid_model\", \"AWS AgentCore requires exact model global.anthropic.claude-sonnet-4-6.\");\n  }\n  const acpxAgent = source.acpxAgent === undefined ? \"codex\" : String(source.acpxAgent).trim();\n  if (provider === \"acpx\") {\n    if (!(acpxAgent in ACPX_QUALIFIED_MODELS)) {\n      throw new RouteError(400, \"invalid_acpx_agent\", \"ACPX agent must be claude or codex.\");\n    }\n    if (model !== ACPX_QUALIFIED_MODELS[acpxAgent]) {\n      throw new RouteError(400, \"invalid_model\", `The qualified ACPX ${acpxAgent} profile requires exact model ${ACPX_QUALIFIED_MODELS[acpxAgent]}.`);\n    }","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/packages/paperclip-runner/scripts/capability-issue-thread-server.mjs#L197-L233","documentation":"Guard in harnessConfiguration of the capability issue-thread HTTP server: the requested runner model string exceeds the 256-character cap, so a RouteError(400,'invalid_model') is thrown before any harness is built. It fires when a client supplies an absurdly long model identifier in the harness configuration payload; the input at fault is source.model.","triggerScenarios":"Thrown at packages/paperclip-runner/scripts/capability-issue-thread-server.mjs:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the model identifier to 256 characters or fewer before sending the harness configuration request.","Verify the client is not concatenating or duplicating the model string; send only the model name the target provider expects.","Catch the 400 invalid_provider/invalid_model responses client-side and surface the length constraint to the user."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-09-02T18:44:00.616Z","contentChangedAt":"2026-09-02T18:44:00.616Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}