Environment
- pi 0.85.1, bundled pi-exe-dev extension, exe.dev VM
- Custom LLM integration: ollama-cloud models via the llm gateway (https://llm.int.exe.xyz, provider exe-dev-ollama-cloud,
e.g. glm-5.3-flash, deepseek-v4-flash:0731)
Summary
/compact (and auto-compaction / branch summaries) always fails with:
Error: Compaction failed: Turn prefix summarization failed: 404:
{"message":"model \"deepseek-v4-flash:0731@llm\" not found","type":"not_found_error",...}
Same failure for any model (e.g. glm-5.3-flash@llm), while normal agent turns work fine.
Root cause
- The extension registers integration models under aliased IDs (@) and maps them back to native
IDs in a before_provider_request hook.
- pi only dispatches before_provider_request for agent-loop requests. pi's compaction builds summarization request
options without onPayload (completeSummarization / createSummarizationOptions in core/compaction/), so the hook never
fires there.
- The aliased ID therefore reaches the gateway unrewritten → 404. Verified directly against the ollama-cloud route: POST
https://llm.int.exe.xyz/ollama-cloud/v1/chat/completions with model: "glm-5.3-flash" → 200; with model:
"glm-5.3-flash@llm" → 404 not_found_error.
Suggested fix (in the extension)
Register integration models under their native IDs and only alias when a native ID actually collides within a provider
(same model served by multiple integrations). No payload rewrite is then needed on any request path, and compaction works
unchanged for custom integrations like ollama-cloud, whose gateway only knows native IDs.
// providerInfosFromIntegrationCatalogs
const nativeIDCounts = new Map<string, number>();
for (const c of entry.candidates)
nativeIDCounts.set(c.nativeID, (nativeIDCounts.get(c.nativeID) ?? 0) + 1);
for (const candidate of entry.candidates) {
const alias = (nativeIDCounts.get(candidate.nativeID) ?? 0) > 1;
const modelConfig = integrationModelConfig(candidate, alias); // id = alias ? `${native}@${name}` : nativeID
models.push(modelConfig);
if (alias) modelAliases.set(modelConfig.id, candidate.nativeID);
...
}
Environment
e.g. glm-5.3-flash, deepseek-v4-flash:0731)
Summary
/compact (and auto-compaction / branch summaries) always fails with:
Same failure for any model (e.g. glm-5.3-flash@llm), while normal agent turns work fine.
Root cause
IDs in a before_provider_request hook.
options without onPayload (completeSummarization / createSummarizationOptions in core/compaction/), so the hook never
fires there.
https://llm.int.exe.xyz/ollama-cloud/v1/chat/completions with model: "glm-5.3-flash" → 200; with model:
"glm-5.3-flash@llm" → 404 not_found_error.
Suggested fix (in the extension)
Register integration models under their native IDs and only alias when a native ID actually collides within a provider
(same model served by multiple integrations). No payload rewrite is then needed on any request path, and compaction works
unchanged for custom integrations like ollama-cloud, whose gateway only knows native IDs.