Repository navigation
Description
[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
- Configure a native local Ollama provider (
api: "ollama") as above; enable the memsearch plugin withautoCapture: true. - Hold a conversation long enough that the per-turn memsearch-summarize session exceeds its token budget (~19k vs a ~17.5k budget here).
- 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).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 14, 2026
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
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
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:
Codex review notes: model internal, reasoning high; reviewed against f20324cd3ed5.
Label changes
Label changes:
clawsweeper:needs-product-decision: Current issue advisory state no longer selects this label.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:
ollamawas unregistered. (2d2ddc43d0dc)src/agents/embedded-agent-runner/compact.ts:1483, c13aa612eba5)src/agents/provider-stream.ts:34, c13aa612eba5)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:
src/agents/embedded-agent-runner/compact.ts,src/agents/provider-stream.ts)src/agents/embedded-agent-runner/compact.ts,src/agents/provider-stream.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.3 remaining items
ZengWen-DT commentedon Jul 14, 2026
Verified this against current
mainatc13aa612eba5; 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):
agent:main:explicit:memsearch-summarize, with observed prompt sizes of 6,989, 10,000, and 13,010 tokens.openclaw agent --localchild-process boundary.compact_only.auto-compaction succeeded for ollama/repro-model; retrying prompt, and the retry completed withoutNo 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 concretemodel.apiimplementation (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 thecontext-overflow-precheckandauto-compaction failedlines for the explicit session.hypothesis-next commentedon Jul 14, 2026
Thanks for tracking this down and confirming the mechanism — much appreciated.
One clarification on scope: this was reported against the released
2026.7.1, notmain. Thev2026.7.1tag points at2d2ddc4, andgit compare v2026.7.1...c13aa612eba5reportsstatus: 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.1is 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:I'm not asking to reopen — the fix on
mainsounds right and I can't hand you amainrepro (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 offmain, or is a2026.7.xbackport planned? Thanks again.steipete commentedon Jul 27, 2026
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-summarizesession, observed the native Ollama compaction request, and recordedauto-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.