{"record":{"id":"874ac9ef2ed10fa0","repo":"paperclipai/paperclip","slug":"invalid-acpx-agent","errorCode":"invalid_acpx_agent","errorMessage":"ACPX agent must be claude or codex.","messagePattern":"ACPX agent must be claude or codex\\.","errorType":"http","errorClass":"RouteError","httpStatus":400,"severity":"error","filePath":"packages/paperclip-runner/scripts/capability-issue-thread-server.mjs","lineNumber":229,"sourceCode":"  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    }\n  }\n  const requestedManagedProfileId = source.managedProfileId === undefined || source.managedProfileId === null\n    ? \"default\"\n    : String(source.managedProfileId).trim();\n  const configuredManagedProfileId = process.env.PAPERCLIP_CLAUDE_MANAGED_PROFILE_ID?.trim();\n  const managedProfileId = provider === \"claude_managed\" && requestedManagedProfileId === \"default\" && configuredManagedProfileId\n    ? configuredManagedProfileId\n    : requestedManagedProfileId;\n  const maxSessionListCostUsd = source.maxSessionListCostUsd === undefined || source.maxSessionListCostUsd === null\n    ? 1\n    : Number(source.maxSessionListCostUsd);\n  if (provider === \"claude_managed\" && !managedProfileId) {\n    throw new RouteError(400, \"invalid_managed_profile\", \"Claude Managed requires a qualified profile ID.\");\n  }","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/packages/paperclip-runner/scripts/capability-issue-thread-server.mjs#L211-L247","documentation":"Guard in harnessConfiguration: for the 'acpx' provider, source.acpxAgent must be one of the qualified agents (claude or codex) whose keys exist in ACPX_QUALIFIED_MODELS; anything else throws RouteError(400,'invalid_acpx_agent'). It fires when the client names an unsupported ACPX agent (e.g. 'pi' or an unqualified/typo'd value).","triggerScenarios":"Thrown at packages/paperclip-runner/scripts/capability-issue-thread-server.mjs:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set acpxAgent to exactly 'claude' or 'codex'.","Remove the acpxAgent override so the default qualified agent is used.","Check ACPX_QUALIFIED_MODELS in the script for the currently supported agent set before sending a custom value."],"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-14T05:17:10.506Z"}