Skip to content

[Bug]: memsearch-summarize sub-session compaction fails with "No API provider registered for api: ollama" on 2026.7.1, while main-session compaction with the same provider succeeds #107281

Closed

Description

@hypothesis-next

[Bug]: memsearch-summarize sub-session compaction fails with "No API provider registered for api: ollama" on 2026.7.1, while main-session compaction with the same provider succeeds

Environment

  • OpenClaw: 2026.7.1 (2d2ddc4), npm global install
  • Node: v24.18.0
  • OS: macOS 26.5.2, arm64 (Apple Silicon)
  • Provider: native Ollama, local, running qwen3.6

Summary

On 2026.7.1, a natively-configured Ollama provider (api: "ollama") works for normal generation and for the main agent session's auto-compaction, but the memsearch-summarize sub-session's auto-compaction consistently fails with:

auto-compaction failed for ollama/qwen3.6: No API provider registered for api: ollama

This is the same error family as the (closed) #57099 / #25669, but it is not fully fixed: the main compaction path was repaired, while the summarize sub-session path still hits the unregistered-provider error. This looks related to #66620 (compaction-summary path degrading to truncation) but manifests as the hard "No API provider registered" throw rather than empty output.

Provider config (openclaw.json)

{
  "api": "ollama",
  "baseUrl": "http://localhost:11434",
  "models": [
    {
      "api": "ollama",
      "contextWindow": 20480,
      "id": "qwen3.6",
      "name": "qwen3.6",
      "params": { "num_ctx": 20480 }
    }
  ]
}

agents.defaults.compaction: { reserveTokens: 3000, reserveTokensFloor: 3000, keepRecentTokens: 4000 }

The key diagnostic (same provider, same route, different outcome)

Two sessions overflow within the same minute, both provider=ollama/qwen3.6, both route=compact_only:

  • Main user session — compaction succeeds:
    sessionKey=agent:main:openresponses-user:<user>  provider=ollama/qwen3.6  route=compact_only
    auto-compaction succeeded for ollama/qwen3.6; retrying prompt
    
  • memsearch-summarize sub-session — compaction fails:
    sessionKey=agent:main:explicit:memsearch-summarize  provider=ollama/qwen3.6  route=compact_only
    [context-overflow-precheck] estimatedPromptTokens=19256 promptBudgetBeforeReserve=17480 overflowTokens=1776 route=compact_only
    context overflow detected (attempt 1/3); attempting auto-compaction for ollama/qwen3.6
    auto-compaction failed for ollama/qwen3.6: No API provider registered for api: ollama
    Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model.
    [compaction-diag] ... trigger=overflow attempt=1 maxAttempts=3 outcome=failed reason=unknown detail=No_API_provider_registered_for_api:_ollama
    

So the provider registry is populated for the main agent's compaction context but the explicit:memsearch-summarize session's compaction resolves against a context where api: "ollama" is not registered.

Impact

  • Bounded and non-fatal: single attempt, no retry loop; falls back to truncation; the user-facing turn still completes (the "try /reset" line is emitted inside the background summarize session and is not delivered to the channel).
  • But memory summaries are truncated rather than compacted on every overflowing summarize turn (~2×/turn here), degrading the quality of captured memory over time.

Repro

  1. Configure a native local Ollama provider (api: "ollama") as above; enable the memsearch plugin with autoCapture: true.
  2. Hold a conversation long enough that the per-turn memsearch-summarize session exceeds its token budget (~19k vs a ~17.5k budget here).
  3. Observe the summarize session's auto-compaction throw "No API provider registered for api: ollama" while the main session's compaction (when it overflows) succeeds.

Expected

The explicit:memsearch-summarize (and other internal/sub-agent) compaction paths should resolve the same provider registry as the main agent path, so a natively-configured Ollama provider can compact summarize sessions instead of falling back to truncation.

Related

#57099, #25669 (closed — main//compact path, older versions), #66620 (compaction-summary path, Ollama cloud, empty output), #69683 (pi-ai builtin registry lacks ollama).

Activity

  1. added
    P2Normal backlog priority with limited blast radius.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    no-staleExclude from stale automation
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jul 14, 2026
  2. clawsweeper commented on Jul 14, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 14, 2026, 2:12 PM ET / 18:12 UTC.

    Summary
    Keep this issue open for release-inclusion tracking: the released v2026.7.1 failure is well documented and a focused post-release main check reports success, but the exact fixing commit and first shipping release remain unidentified, so an implemented-on-main close cannot yet meet the required provenance bar.

    Reproducibility: no. on current main: the supplied focused run at c13aa61 successfully compacted the fresh-process explicit session, while the reporter provides a strong reproduction only for released v2026.7.1. This review could not independently rerun or inspect the path because read-only command execution failed.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    Do not start another fix PR; a release owner should establish the exact fix SHA and choose normal release inclusion versus a validated v2026.7.x backport.

    Maintainer decision needed

    • Question: Should the current-main Ollama compaction repair wait for the next normal release, or be backported to a v2026.7.x patch release for affected stable users?
    • Rationale: The code path reportedly succeeds after v2026.7.1, but users on the latest release remain affected; choosing the release vehicle and accepting backport risk requires release-owner intent.
    • Likely owner: vincentkoc — The issue timeline routes the report to them and the remaining question is release inclusion rather than a new implementation.
    • Options:
      • Ship Next Release (recommended): Identify the fix SHA, confirm focused regression coverage, and include it in the next normal release while documenting that v2026.7.1 remains affected.
      • Backport to v2026.7.x: Cherry-pick the narrow fix into a patch release after validating both normal and explicit-session Ollama compaction on the release branch.
    Review details

    Best possible solution:

    Identify the exact commit that made compaction resolve and inject the provider-owned Ollama stream, add or retain regression coverage for a fresh-process explicit memsearch-summarize session, and ship that commit through either the next normal release or a validated v2026.7.x backport.

    Do we have a high-confidence way to reproduce the issue?

    No on current main: the supplied focused run at c13aa61 successfully compacted the fresh-process explicit session, while the reporter provides a strong reproduction only for released v2026.7.1. This review could not independently rerun or inspect the path because read-only command execution failed.

    Is this the best way to solve the issue?

    Yes in principle: resolving the provider-owned stream before constructing the compaction session is the narrow ownership-correct fix and avoids a second Ollama registration path. The exact implementing commit and regression coverage still need provenance before closure or release selection.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Users remaining on v2026.7.1 continue to receive truncated rather than compacted memsearch summaries when this internal session overflows.
    • Without the exact fix SHA, maintainers cannot reliably determine whether the behavior is included in a future release branch or select a narrow backport.
    • The successful current-main result is contributor-supplied evidence rather than an independently repeated review run because repository command execution was unavailable.

    Codex review notes: model internal, reasoning high; reviewed against f20324cd3ed5.

    Label changes

    Label changes:

    • remove clawsweeper:needs-product-decision: Current issue advisory state no longer selects this label.
    • remove clawsweeper:not-repro-on-main: Current issue advisory state no longer selects this label.

    Label justifications:

    • P2: The latest stable release repeatedly degrades background memory summarization, but the turn completes and the failure is bounded rather than availability-critical.
    • impact:session-state: Failed sub-session compaction falls back to truncation and can progressively reduce the quality of retained memory context.
    Evidence reviewed

    What I checked:

    • Released-version reproduction: The reporter reproduced the explicit memsearch-summarize failure repeatedly on v2026.7.1 at commit 2d2ddc4, with overflow selecting compact_only and then failing because api ollama was unregistered. (2d2ddc43d0dc)
    • Reported current-main behavior proof: A contributor exercised the production embedded runner across the fresh-process memsearch boundary at c13aa61; the fourth overflowing turn sent an Ollama compaction request, logged successful auto-compaction, and completed its retry. (src/agents/embedded-agent-runner/compact.ts:1483, c13aa612eba5)
    • Reported registration boundary: The current-main investigation identifies the shared provider-stream resolver as registering the concrete model API implementation before compaction creates its session. (src/agents/provider-stream.ts:34, c13aa612eba5)
    • Release gap: The supplied repository state names v2026.7.1 as the latest release and places the successful current-main check after that tag; no fixing SHA or containing release is identified in the discussion. (2d2ddc43d0dc)
    • Independent history inspection blocked: The read-only command sandbox failed before source, git history, maturity, or tag inspection with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; therefore the discussion's candidate implementation could not be tied to an exact fix commit independently.

    Likely related people:

    • ZengWen-DT: They supplied the focused fresh-process reproduction and traced the successful path through the compaction and provider-stream boundaries; repository commit ownership could not be independently established. (role: current-main behavior investigator; confidence: medium; files: src/agents/embedded-agent-runner/compact.ts, src/agents/provider-stream.ts)
    • vincentkoc: The issue timeline explicitly routes this report to them, and supplied related history shows prior Ollama-runtime cleanup work; direct file-history confirmation was blocked. (role: likely release follow-up owner; confidence: low; files: src/agents/embedded-agent-runner/compact.ts, src/agents/provider-stream.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  3. added
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    and removed
    no-staleExclude from stale automation
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    on Jul 14, 2026
  4. 3 remaining items

  5. added
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    and removed
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Jul 14, 2026
  6. ZengWen-DT commented on Jul 14, 2026

    @ZengWen-DT
    Contributor

    Verified this against current main at c13aa612eba5; the 2026.7.1 failure is no longer reproducible on the current session/runtime path.

    I exercised the production embedded runner and bundled Ollama plugin through a local Ollama-protocol HTTP endpoint (the provider registry itself was not mocked):

    • Wrote three turns to agent:main:explicit:memsearch-summarize, with observed prompt sizes of 6,989, 10,000, and 13,010 tokens.
    • Started a fresh Node process for the fourth turn, matching memsearch’s fresh openclaw agent --local child-process boundary.
    • The fourth process detected 19,373 estimated prompt tokens against a 17,480-token pre-reserve budget and selected compact_only.
    • The Ollama endpoint received the compaction request, OpenClaw logged auto-compaction succeeded for ollama/repro-model; retrying prompt, and the retry completed without No API provider registered for api: ollama.

    Current compaction resolves the provider-owned stream before creating the compaction session, then injects that stream into the session (src/agents/embedded-agent-runner/compact.ts:1483, src/agents/embedded-agent-runner/compact.ts:1514). The shared registration boundary resolves the plugin stream and registers the concrete model.api implementation (src/agents/provider-stream.ts:34, src/agents/provider-stream.ts:68). This covers the exact fresh-process/internal-session split reported here.

    This is ready for maintainer closure as resolved on current main. Please reopen with a current-main reproduction if the same registry error still occurs; useful new evidence would be the current SHA plus the context-overflow-precheck and auto-compaction failed lines for the explicit session.

  7. hypothesis-next commented on Jul 14, 2026

    @hypothesis-next
    Author

    Thanks for tracking this down and confirming the mechanism — much appreciated.

    One clarification on scope: this was reported against the released 2026.7.1, not main. The v2026.7.1 tag points at 2d2ddc4, and git compare v2026.7.1...c13aa612eba5 reports status: diverged, ahead_by: 3098 — so the compaction fix you verified is in that post-release lead and isn't in any published release yet (2026.7.1 is currently the newest release/tag). Users on the stable release are therefore still affected.

    Confirming it's still 100% reproducible on 2026.7.1 (2d2ddc4), 16 occurrences today alone (most recent hours ago), with exactly the lines you asked for on the explicit session:

    [context-overflow-precheck] sessionKey=agent:main:explicit:memsearch-summarize provider=ollama/qwen3.6 route=compact_only estimatedPromptTokens=19626 promptBudgetBeforeReserve=17480 overflowTokens=2146
    auto-compaction failed for ollama/qwen3.6: No API provider registered for api: ollama
    

    I'm not asking to reopen — the fix on main sounds right and I can't hand you a main repro (this is a production box on the release). Just one question so I know when to upgrade: which release will carry the fix — the next point release off main, or is a 2026.7.x backport planned? Thanks again.

  8. added
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:not-repro-on-mainClawSweeper found high-confidence evidence that this issue no longer reproduces on main.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    and removed
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jul 14, 2026
  9. steipete commented on Jul 27, 2026

    @steipete
    Contributor

    Thanks for the careful reproduction and the follow-up confirming the affected release.

    I have rechecked this against current main at e57549c. The exact native Ollama failure is fixed: the production compaction path resolves and registers the provider-owned stream with the compaction model's API registry before constructing the session, then injects that same stream into the session agent:

    The earlier fresh-process reproduction on c13aa61 also exercised the reported agent:main:explicit:memsearch-summarize session, observed the native Ollama compaction request, and recorded auto-compaction succeeded; I verified that commit is an ancestor of the main commit above.

    This closes the issue as fixed on main, not as a claim that v2026.7.1 already contains the fix. Availability in a future stable release or any 2026.7.x backport remains a release-maintainer decision. If this exact registry error still reproduces on current main or a release containing the fix, please reopen with the version/SHA and the redacted compaction diagnostic.

  10. locked as resolved and limited conversation to collaborators on Sep 27, 2026
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

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:not-repro-on-mainClawSweeper found high-confidence evidence that this issue no longer reproduces on main.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions