{"record":{"id":"d29bcf835a7f5161","repo":"deepseek-ai/deepseek-harness","slug":"llm-pi-ai-unusable-replay-state-on-assistant-hist","errorCode":null,"errorMessage":"llm-pi-ai: unusable replay state on assistant history for route \"${provider}/${model}\"; sending that message as provider-neutral content (${reason})","messagePattern":"llm-pi-ai: unusable replay state on assistant history for route \"(.+?)/(.+?)\"; sending that message as provider-neutral content \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/llm/llm-pi-ai/src/index.ts","lineNumber":201,"sourceCode":"    throw new LlmError(\n      `llm-pi-ai: no credential for provider route \"${provider}\"; its profile resolves ${ref}, which is not`\n      + ` set — store ${ref} through the credentials service (the web Models page writes it) or export it,`\n      + ' and remove apiKeyEnv only if this provider should authenticate from pi-ai\\'s own environment discovery',\n      'MISSING_CREDENTIAL',\n    )\n  }\n\n  // One store and one ambient context for the whole plugin instance: both read\n  // through `ctx` per call, so they stay correct across the collection rebuilds\n  // a configuration change causes, and a sign-in survives one.\n  const auth = { credentials: credentialStoreFrom(ctx), authContext: authContextFrom(ctx) }\n  const adapter = new PiAiAdapter({\n    profiles,\n    resolveApiKey,\n    auth,\n    resolveAttachments: () => ctx.get('attachments'),\n    onReplayDegrade: ({ provider, model, reason }) => {\n      ctx.logger.warn(\n        `llm-pi-ai: unusable replay state on assistant history for route \"${provider}/${model}\";`\n        + ` sending that message as provider-neutral content (${reason})`,\n      )\n    },\n  })\n  // Independent of the route set: signing in is what makes a route worth\n  // adding, so the flows are offered before any profile names their provider.\n  // Scoped to the authorization seam rather than injected outright, because a\n  // composition without it (headless, ACP) simply has no surface to sign in\n  // from, while everything else this plugin does still works.\n  ctx.inject(['authorization'], (authorized) => { registerPiAiFlows(authorized, auth) })\n  // The full installed catalog is configurable from the moment the plugin\n  // mounts — dormant or not — so configuration surfaces can offer every\n  // pi-ai provider before any route exists. Hand-declared routes join it as\n  // profiles appear, and leave with them.\n  let directory: DirectoryRegistrationHandle | undefined\n  let directoryFacts: unknown\n  const ensureDirectory = (): void => {","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/llm/llm-pi-ai/src/index.ts#L183-L219","documentation":"Error \"llm-pi-ai: unusable replay state on assistant history for route \"${provider}/${model}\"; sending that message as provider-neutral content (${reason})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/llm/llm-pi-ai/src/index.ts:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start a fresh session or clear history for the route; the message is sent as provider-neutral content."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}