Repository navigation
fix(ollama): support adaptive thinking level for Ollama models - #128757
MasterSwords1 wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 10:08 PM ET / August 29, 2026, 02:08 UTC. ClawSweeper reviewWhat this changesThe branch advertises an Ollama adaptive thinking choice, documents it as mapping to native high effort, and makes ACP session controls show the configured thinking default when no explicit session override exists. Merge readiness⛔ Blocked until stronger real behavior proof is added - 7 items remain Keep open: the ACP presentation fix matches Gateway’s stored-override-then-default semantics, but the new Ollama Priority: P2 Review scores
Verification
How this fits togetherOllama’s plugin publishes model-specific thinking choices that Gateway uses for flowchart LR
A[Ollama model capability] --> B[Ollama provider policy]
B --> C[Gateway thinking choices]
C --> D[Native Ollama request]
E[Gateway session metadata] --> F[ACP session translator]
F --> G[ACP client controls]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +15, Tests +135, Docs +2. Total +152 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the ACP default-presentation repair, but remove the Ollama adaptive profile/docs/live-test changes unless maintainers establish a distinct Ollama behavior that differs from Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the merge-base adapter already maps Is this the best way to solve the issue? No: exposing an alias that maps identically to the existing high control is not the best fix; the ACP override/default presentation change is independently sound and should remain. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4b8a2a7d932f. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (14 earlier review cycles; latest 8 shown)
|
209a536 to
45a09b3
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
steipete
left a comment
There was a problem hiding this comment.
This branch combines an Ollama thinking-capability expansion with ACP presentation and spawn changes. The submitted spawn flow is incomplete, and it does not repair the configured-binding path reported in #128145.
Production LOC: +48/-4 (net +44). Tests: +155/-3 (net +152). Docs: +3/-1 (net +2). Total: +198, not net-neutral.
-
[P1] Advertised spawn options are not parsed.
rawModelandrawThinkingare declared but never assigned. The parser rejects--modeland--thinkingas unknown options, and rejects the additional positional arguments covered by the new test. These commands cannot reach initialization successfully. See the declarations and parsing loop and rejection branches. -
[P1] The selected model is dropped at initialization. The new code resolves
modelandmodelExplicit, but the initialize call forwards onlythinking. Even after parsing is repaired, the advertised model override would not reach the runtime. Keep model/thinking resolution and forwarding together rather than introducing a partial copy of the existing spawn flow. -
The linked configured-default bug is not fixed by this branch. The configured-binding producer and lifecycle are unchanged: the producer resolves the model, while initialization forwards model-only runtime options. Open PR #128169 already owns that repair. Advertising
adaptiveas an alias for high effort is separate from honoring a configuredoffdefault, and a presentation correction alone does not establish that the runtime failure is repaired.
Please narrow this to one independently verified defect and remove the incomplete spawn additions and the unsupported Fixes #128145 claim. The bridge's dropped thinkingDefault is a plausible focused repair to investigate separately from expanding Ollama's advertised capabilities. Its owner has a redundant row-copy projection and duplicate label formatters that can be simplified; consolidate the repeated test fixtures while preserving coverage to meet the net-neutral size target.
Reviewed head: 8d8921d6827bde1f5947272699b38939f02c5980. This review is based on source, caller/sibling, dependency-contract, and history inspection. I did not execute fork tests or a live ACP/Ollama run, and am not treating the supplied direct-Ollama capture as proof of ACP initialization.
… thinkingDefault over ACP - Add the OpenClaw-only `adaptive` thinking tier to Ollama's reasoning profile (maps to native `think: "high"` via normalizeOllamaThinkValue). - ACP session presentation now falls back to the configured `thinkingDefault` when no explicit `thinkingLevel` is set, instead of forcing "adaptive". - Add ACP presentation tests (honors thinkingDefault; explicit level wins) and an Ollama Cloud live proof (gpt-oss:20b accepts think:"high"). Scope narrowed from the previous revision: the earlier /acp spawn additions were incomplete (did not compile) and overlap the already-merged bridge thinkingDefault handling in openclaw#128169, so they are dropped here.
b06ed82 to
f987551
Compare
What Problem This Solves
Ollama reasoning-capable models expose native effort tiers, but OpenClaw did not
advertise the
adaptivethinking tier for Ollama, and ACP session presentationforced the current thinking mode to
"adaptive"even when the operator hadconfigured a different
thinkingDefault. This PR adds theadaptivetier(mapped to Ollama's native
think: "high") and makes ACP honor the configuredthinkingDefaultwhen no explicitthinkingLevelis set.Why This Change Was Made
This revision replaces the earlier
/acp spawnchanges on this branch, whichdid not compile (referenced an undeclared loop variable in
shared.tsand anon-existent
AcpConfig.defaultModelfield inlifecycle.ts) and overlapped thealready-merged bridge
thinkingDefaulthandling in #128169. Per steipete'sCHANGES_REQUESTED and ClawSweeper
needs proof, the scope is narrowed to onecoherent defect:
adaptivethinking level in Ollama's reasoningprofile (maps to native
think: "high"vianormalizeOllamaThinkValue).thinkingDefaultwhenno explicit
thinkingLevelis present, instead of forcing"adaptive".Fixes #128145claim is dropped: fix(acp): preserve configured thinking across session reuse #128169 already fixed thebridge
thinkingDefaultwiring, so this PR no longer duplicates it.User Impact
/think adaptive(and the ACP thinking control) is now available for Ollamareasoning models; it forwards
think: "high"to Ollama.when a session has no explicit thinking level, rather than always
"adaptive".Evidence
Unit tests (P1) — green locally
extensions/ollama/index.test.ts: reasoning-capable Ollama profile exposesadaptivein its levels.extensions/ollama/provider-policy-api.test.ts: native effort tiers includeadaptive(duplicated fixture consolidated into one const).src/acp/translator.session-setup.test.ts(new): "honors configuredthinkingDefault when gateway session has no explicit thinkingLevel" and
"prefers explicit thinkingLevel over thinkingDefault" both pass.
prod
tsgopasses;oxlintclean on changed files.Live proof (P2) — green
resolveOllamaThinkParamValue({ think: "adaptive" }, true) === "high"(realextension function).
POST https://ollama.com/api/chatforgpt-oss:20bwith
think: "high"returned HTTP 200 and the model echoed the prompt.(Local
pnpm test:livecould not stage live auth profiles because theoperator agent DB is at a stale schema version 17 and migrating requires
stopping the gateway; the committed
extensions/ollama/stream-compat.live.test.tsruns this proof in CI where the DB is current.)
Verification
pnpm test extensions/ollama/provider-policy-api.test.ts extensions/ollama/index.test.ts src/acp/translator.session-setup.test.ts— all pass.extensions/ollama/stream-compat.live.test.ts— committed live proof (gated onOPENCLAW_LIVE_TEST), runs in CI.Related
thinkingDefaulthandling thisPR no longer duplicates.