{"record":{"id":"e3fadab3135fcded","repo":"paperclipai/paperclip","slug":"acpx-model-must-not-be-empty","errorCode":null,"errorMessage":"ACPX model must not be empty","messagePattern":"ACPX model must not be empty","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/drivers/acpx/qualified-profiles.ts","lineNumber":89,"sourceCode":"    agentProfileVersion: 1,\n    agentServerPackage: \"@agentclientprotocol/codex-acp\",\n    agentServerVersion: \"1.6.2\",\n    agentRuntimePackage: \"@openai/codex\",\n    agentRuntimeVersion: \"0.153.4\",\n    commandDigest:\n      \"sha256:c4538599d1ab767db5dff50934f13bb5ba313a59d9c4a83e993fac4617ea63d3\",\n    qualificationModel: \"gpt-5.6-sol\",\n    reportedModelId: \"gpt-5.6-sol\",\n    permissionPolicy: \"interactive\",\n  },\n});\n\nexport function resolveQualifiedAcpxProfile(\n  agent: QualifiedAcpxAgent,\n  requestedModel: string,\n): QualifiedAcpxProfile {\n  const profile = QUALIFIED_ACPX_PROFILES[agent];\n  if (!requestedModel.trim()) throw new Error(\"ACPX model must not be empty\");\n  if (agent !== \"claude\" && requestedModel !== profile.qualificationModel) {\n    throw new Error(\n      `ACPX ${agent} profile requires exact model ${profile.qualificationModel}; received ${requestedModel}`,\n    );\n  }\n  return { ...structuredClone(profile), qualificationModel: requestedModel, reportedModelId: requestedModel };\n}\n\nfunction deepFreeze<T>(value: T): T {\n  if (typeof value !== \"object\" || value === null || Object.isFrozen(value))\n    return value;\n  Object.freeze(value);\n  for (const child of Object.values(value)) deepFreeze(child);\n  return value;\n}\n","sourceCodeStart":71,"sourceCodeEnd":105,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.ts#L71-L105","documentation":"resolveQualifiedAcpxProfile validates the requested model string for a qualified ACPX agent profile before resolving it. A model that is empty or whitespace-only cannot be matched against the profile's qualification model, so it throws immediately. This keeps unqualified/blank model IDs from reaching the ACPX runtime.","triggerScenarios":"Calling resolveQualifiedAcpxProfile(agent, model) — directly or via qualifiedProfile()/profile()/parseOpenParams()/evalSessionProviderVersion()/runEvalSessionCli()/validateAcpxDriverConfig() — with requestedModel = \"\", \" \", or a string of only whitespace.","commonSituations":"A driver config omits the model field; an env var like ACPX_MODEL is unset or set to empty string; UI/CLI passes through an untouched empty input; trimming logic upstream strips a placeholder value away entirely.","solutions":["Set a concrete model identifier in the driver/session configuration before opening the ACPX session.","For the 'claude' profile set any non-empty model; for other agents set exactly the profile's qualificationModel (see QUALIFIED_ACPX_PROFILES).","Validate/trim the model at your config boundary before calling any ACPX profile resolution API."],"exampleFix":"// before\nconst driver = createAcpxDriver({ model: process.env.ACPX_MODEL ?? \"\" });\n// after\nconst model = process.env.ACPX_MODEL;\nif (!model || !model.trim()) throw new Error(\"ACPX_MODEL must be set\");\nconst driver = createAcpxDriver({ model });","handlingStrategy":"validation","validationCode":"if (typeof model !== \"string\" || !model.trim()) {\n  throw new Error(\"ACPX model must be a non-empty string before opening a session\");\n}","typeGuard":"const hasModel = (v: unknown): v is string => typeof v === \"string\" && v.trim().length > 0;","tryCatchPattern":"try {\n  driver.open({ model });\n} catch (e) {\n  if (e.message === \"ACPX model must not be empty\") {\n    throw new ConfigError(\"Set ACPX model in driver config or ACPX_MODEL env var\");\n  }\n  throw e;\n}","preventionTips":["Always set the model explicitly in driver config; avoid empty-string defaults.","Trim and validate model ids at the config boundary.","Fail fast on unset env vars instead of passing \"\" through."],"tags":["validation","config","empty-string","acpx"],"backgroundTag":"empty-required-field","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}