{"record":{"id":"803e6ed2cc2df3e1","repo":"deepseek-ai/deepseek-harness","slug":"the-current-model-route-could-not-be-verified","errorCode":null,"errorMessage":"the current model route could not be verified","messagePattern":"the current model route could not be verified","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mcp/mcp-client/src/tools.ts","lineNumber":413,"sourceCode":" * @param ctx - plugin context with optional services.\n * @param exec - exact tool execution whose agent supplies the latest route.\n * @returns the attachment store after exact positive image-capability proof.\n */\nasync function resolveImageAdmission(ctx: Context, exec: ToolExecution): Promise<AttachmentStore> {\n  const attachments = ctx.get('attachments')\n  if (attachments === undefined) throw new Error('no attachment store is mounted')\n  const routed = exec.agent?.session.requestHeader()?.config\n  const provider = routed?.provider ?? exec.agent?.options.provider\n  const model = routed?.model ?? exec.agent?.options.model\n  const llm = ctx.get('llm')\n  if (provider === undefined || model === undefined || llm === undefined) {\n    throw new Error('the current model route could not be resolved')\n  }\n  let info: Awaited<ReturnType<typeof llm.resolveModelInfo>>\n  try {\n    info = await llm.resolveModelInfo(provider, model, exec.signal)\n  } catch {\n    throw new Error('the current model route could not be verified')\n  }\n  if (info.inputModalities === undefined || !info.inputModalities.includes('image')) {\n    throw new Error(`model \"${model}\" does not declare image input`)\n  }\n  if (exec.signal.aborted) throw new Error('the tool call was canceled before image storage')\n  return attachments\n}\n\n/** Stable diagnostic text for an image block that was not admitted. */\nfunction imageDiagnostic(block: McpContentBlock, reason: string): string {\n  const mediaType = block.mimeType ?? 'unknown media type'\n  return `[image unavailable: ${mediaType}; ${reason}; raw image data remains available to programmatic callers]`\n}\n\n/**\n * Decode, preflight, and durably save one MCP result's ordered image batch.\n * Any refusal projects every image as text while retaining the canonical raw\n * value for programmatic callers.","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/mcp/mcp-client/src/tools.ts#L395-L431","documentation":"Image-admission failure: the model route (provider/model) for the current agent could not be resolved from the session request header or agent options, so image capability of the target model cannot be proven. The tool refuses rather than storing an attachment the model might not be able to read back.","triggerScenarios":"Thrown at packages/mcp/mcp-client/src/tools.ts:413 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the current model route (catalog reachable) and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}