Skip to content

pi-exe-dev: compaction fails with 404 — aliased "@llm" model IDs reach the gateway without rewriting #7

Description

@mydnicq

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

  1. The extension registers integration models under aliased IDs (@) and maps them back to native
    IDs in a before_provider_request hook.
  2. 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.
  3. 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);
    ...
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions