Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 8:36 PM ET / September 26, 2026, 00:36 UTC (Revision 21). ClawSweeper reviewWhat this changesThe branch makes short utility-model requests apply configured OpenAI-compatible payload fields, including agent-specific settings, and adds transport and generated-title tests. Merge readiness✅ Ready for maintainer review Current main still drops configured payload parameters from utility completions. This PR addresses that behavior, and the latest head appears to resolve the prior agent-scoping finding with direct transport coverage. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw uses utility completions for short tasks such as generated session titles. Agent and model configuration feeds transport preparation, which sends the request to the selected provider and returns text to the calling feature. flowchart LR
A[Agent and model settings] --> B[Utility completion preparation]
B --> C[Resolve payload parameters]
C --> D[Select provider transport]
D --> E[Provider request]
E --> F[Generated title or summary]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +50, Tests +132, Other 0. Total +182 across 12 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one shared OpenAI-compatible payload policy for agent turns and utility completions, with request-scoped agent selection preserved through dispatch. Do we have a high-confidence way to reproduce the issue? No current-main execution was performed in this read-only review. Current source still omits the parameter policy, and the PR records a before-and-after HTTP request through the title path. Is this the best way to solve the issue? Yes. The branch reuses the existing parameter resolver and moves payload behavior into a shared policy while keeping provider dispatch and agent scope explicit. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 31a5754546a0. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (20 earlier review cycles; latest 8 shown)
|
|
I am integrating your new wire-API correction and regression with the prepared payload-policy repair and end-to-end proof. The guarded push refused the moved head, so neither of your commits was overwritten. I will preserve both commits and publish the combined head after checking the added regression. |
|
The branch has moved again, most recently to The retained passing runtime proof and clean code-review report apply to the earlier combined head The CI-sizing prerequisite #153519 has now merged. That is not a claim that the current head's CI has passed, and no structural or CI waiver is being applied. Please keep this as |
…etion-extra-params-153391-20260920
…etion-extra-params-153391-20260920
|
Updated the body to Related: #153391 and explicitly kept the observer-budget question open. This PR only repairs configured utility payload parameters; code and head remain unchanged at 5eaaabc, with green CI. @clawsweeper re-review |
…etion-extra-params-153391-20260920
|
Addressed agent-specific payload precedence by carrying optional selected agent identity through transport preparation and including it in the dispatch key. Real HTTP alpha/beta/alpha coverage fails before the repair and passes after; shared-registry coverage retains distinct agent/auth policies and unchanged unscoped callers. @clawsweeper re-review |
|
Merged as 50324f6. Utility completions now retain configured payload parameters, including agent-specific precedence, through the shared policy while preserving provider dispatch. Before/after reasoning-model HTTP captures, main-agent/no-parameter controls, and two-agent isolation checks passed; exact-head ClawSweeper was ready and required CI passed after the authorized timing-sensitive rerun. Thank you @Alix-007 for the fix and @dwalthour for the detailed report. #153391 remains open for the broader observer-budget question. |
…claw#153451) Related: openclaw#153391. This PR fixes utility completions dropping configured payload parameters; openclaw#153391 stays open for the broader observer-budget question. ## What Problem This Solves Configured OpenAI-compatible payload parameters were dropped from utility completions, so reasoning models could ignore the requested thinking settings when generating session titles and summaries. ## User Impact Utility completions now send configured chat-template and extra-body fields using the same payload policy as normal agent turns. Existing caller token budgets, provider routing, and model selection remain unchanged; no new settings or migrations are introduced. This repairs parameter loss, not the separately reported observer-budget policy or unconfirmed model-ID substitution. ## Why This Change Was Made The simple-completion transport keeps the original wire API visible to payload policy while preserving the provider dispatch alias. Both paths share configuration alias resolution and the existing OpenAI-compatible payload policy, including extra-body precedence and non-native store cleanup. ## Evidence - Reproduced against main `b89182d41dd` through the real Gateway dashboard-title owner, isolated completion, and built-in transport to a loopback HTTP/SSE provider configured as a reasoning model. The recorded request lacked both configured fields. The same probe passes with this fix and returns the title. - Before request fields: `{"model":"title-model","stream":true,"max_completion_tokens":4096}`; neither `chat_template_kwargs` nor `min_p` was present. - After, the same request also carries exactly `"chat_template_kwargs":{"enable_thinking":false},"min_p":0.2`, configured through `chat_template_kwargs` and `extra_body` respectively. Message content and caller budget are unchanged. - A no-parameters title request is identical before/after. A real embedded agent turn retains both parameters before/after; its other request fields are unchanged apart from per-run workspace paths and time in the prompt. - 185 retained focused tests passed (transport, dashboard titles, extra-parameter resolution, agent payload behavior, and PDF model selection), plus the temporary reasoning-model HTTP probe. The 181-test group plus probe took 50.93 seconds across four shards; the four PDF tests took 22.85 seconds including cold worker compilation. No external model service or paid key was used. This exercises the Gateway title owner directly, not a browser or Gateway WebSocket client. - Assertion baseline is shrink-only (8 to 4). The shared alias resolver replaces the previous agent-local copy. - Agent-scoped regression: with the same model, three real HTTP title requests for alpha/beta/alpha previously all sent shared `min_p: 0.1`; they now send `0.3/0.7/0.3` and their own `enable_thinking: false/true/false`. Agent-wide parameters override agent-model parameters, which override shared-model parameters, through the existing resolver. The 20 transport tests and 9 HTTP title tests pass in 26.02 seconds; shared-registry coverage also checks separate agent/auth policies and unchanged unscoped callers. - API comparison (`016c666c`): the only semantic reachable declaration change is additive optional `agentId?: string` on `AiProviderStreamHookContext`; two other hunks only reorder optional-undefined union fields. No SDK entrypoints were added or removed. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #153391. Builds on #153451. ## What Problem This Solves Reasoning utility models can spend the observer's 300-token or activity recap's 240-token allowance entirely on reasoning, leaving no visible answer. ## User Impact Internal utility requests now reserve room for reasoning within the selected model's output limit. Non-reasoning models retain their smaller task budgets. Explicit plugin completion limits remain absolute. No configuration, public API, or migration changes are required. Existing task timeouts are unchanged. A slow thinking model can still exceed them: live Qwen3 4B observer requests received the repaired token allowance but timed out at the existing 30-second deadline. This fixes token starvation, not inference latency. ## Why This Change Was Made The isolated-completion owner translates a private answer budget using the same reasoning allowance as the exec reviewer. Titles, narration, observer digests, activity recaps, and transcript summaries use that owner; callers retain their sampling settings. V1, V2, and CLI routes preserve explicit limits and the resolved model's capacity. Configured payload parameters were already repaired by #153451 and native Ollama already carries model parameters to the wire. Thanks to @dwalthour for the report, and @Alix-007 and Ayaan Zaidi for the earlier parameter fix. Production diff: +34/-45 (net -11); tests: +120/-6; docs: +7/-0. Nearby cleanup removes an unreachable result guard and redundant caller constants. No prompt or tool text changed. ## Evidence - Reproduced on main `d789eb10a28293751d980bf23406d6597e42a236` with an isolated Gateway, native Ollama `qwen3:4b`, and captured `/api/chat` requests. The actual `sessions.create` → subscription/visibility → `chat.send` flow produced observer requests with `think: true`, `num_ctx: 8192`, `temperature: 0.2`, and `num_predict: 300`. Five responses exhausted the cap with 1,164–1,283 reasoning characters and zero visible answer; the Gateway disabled observation after repeated invalid JSON. Activity recap requests similarly exhausted 240 tokens. - Candidate Gateway requests preserve those parameters and send `num_predict: 8192`, the configured model maximum. Native `qwen3:8b` returned a valid observer digest in 6.08 seconds and the Gateway published a `session.observer` event (headline: “Nightly backup guide creation”). An activity recap completed in 384 tokens / 7.59 seconds with visible text; replaying that exact captured request directly against Ollama with the old 240-token cap returned reasoning only and `done_reason: length` (this control is provider-level, not another Gateway run). The real `sessions.title.prepare` RPC returned “Investigate Missing Invoice Table” in 13.61 seconds, with configured `temperature: 0.15`, `think: true`, and `num_ctx: 8192` on the wire. The 4B deadline limitation remains as stated above. - The existing observer/recap owner regressions fail on main for 300/240 instead of 8,492/8,432. The candidate passes 120 tests across eight focused files in 234.28 seconds wall time, then 57 isolated-owner tests after cleanup in 87.04 seconds. The new budget matrix executes in 1.263 seconds; title HTTP transport tests take 15.937 seconds, observer/recap composition 5.997 seconds, and transcript-summary tests 0.312 seconds. These reuse existing integration fixtures; import/worker compilation accounts for most wrapper time. - `pnpm build` passes. Ratchets pass for line counts, assertions, timer races, mocks, database access, config docs, and plugin inventory. Core and test typechecks, scoped lint, dead-export scans, and the remaining changed-file guards pass. The first lint invocation lacked the tracked Solid lint dependency after gateway-only setup; restoring that dependency and resuming lint/remaining guards cleared the environment failure. - Independent Codex autoreview is scoped-clean through P2 on this head. ClawSweeper reviewed this exact head with no findings and no before-merge items. Its test note reflects the stated 4B timeout limitation; successful 8B Gateway publication is documented above. [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/38171953530) passed in 588 seconds wall time with 45 successful jobs and no failures. The published `openclaw/ci-gate` status is also successful for `19c2a83e73def2454c1ea367af909dea9727e381`.
) Related: openclaw#153391. Builds on openclaw#153451. ## What Problem This Solves Reasoning utility models can spend the observer's 300-token or activity recap's 240-token allowance entirely on reasoning, leaving no visible answer. ## User Impact Internal utility requests now reserve room for reasoning within the selected model's output limit. Non-reasoning models retain their smaller task budgets. Explicit plugin completion limits remain absolute. No configuration, public API, or migration changes are required. Existing task timeouts are unchanged. A slow thinking model can still exceed them: live Qwen3 4B observer requests received the repaired token allowance but timed out at the existing 30-second deadline. This fixes token starvation, not inference latency. ## Why This Change Was Made The isolated-completion owner translates a private answer budget using the same reasoning allowance as the exec reviewer. Titles, narration, observer digests, activity recaps, and transcript summaries use that owner; callers retain their sampling settings. V1, V2, and CLI routes preserve explicit limits and the resolved model's capacity. Configured payload parameters were already repaired by openclaw#153451 and native Ollama already carries model parameters to the wire. Thanks to @dwalthour for the report, and @Alix-007 and Ayaan Zaidi for the earlier parameter fix. Production diff: +34/-45 (net -11); tests: +120/-6; docs: +7/-0. Nearby cleanup removes an unreachable result guard and redundant caller constants. No prompt or tool text changed. ## Evidence - Reproduced on main `5740bf11dd7afb3f686e2ec7067614dc694946aa` with an isolated Gateway, native Ollama `qwen3:4b`, and captured `/api/chat` requests. The actual `sessions.create` → subscription/visibility → `chat.send` flow produced observer requests with `think: true`, `num_ctx: 8192`, `temperature: 0.2`, and `num_predict: 300`. Five responses exhausted the cap with 1,164–1,283 reasoning characters and zero visible answer; the Gateway disabled observation after repeated invalid JSON. Activity recap requests similarly exhausted 240 tokens. - Candidate Gateway requests preserve those parameters and send `num_predict: 8192`, the configured model maximum. Native `qwen3:8b` returned a valid observer digest in 6.08 seconds and the Gateway published a `session.observer` event (headline: “Nightly backup guide creation”). An activity recap completed in 384 tokens / 7.59 seconds with visible text; replaying that exact captured request directly against Ollama with the old 240-token cap returned reasoning only and `done_reason: length` (this control is provider-level, not another Gateway run). The real `sessions.title.prepare` RPC returned “Investigate Missing Invoice Table” in 13.61 seconds, with configured `temperature: 0.15`, `think: true`, and `num_ctx: 8192` on the wire. The 4B deadline limitation remains as stated above. - The existing observer/recap owner regressions fail on main for 300/240 instead of 8,492/8,432. The candidate passes 120 tests across eight focused files in 234.28 seconds wall time, then 57 isolated-owner tests after cleanup in 87.04 seconds. The new budget matrix executes in 1.263 seconds; title HTTP transport tests take 15.937 seconds, observer/recap composition 5.997 seconds, and transcript-summary tests 0.312 seconds. These reuse existing integration fixtures; import/worker compilation accounts for most wrapper time. - `pnpm build` passes. Ratchets pass for line counts, assertions, timer races, mocks, database access, config docs, and plugin inventory. Core and test typechecks, scoped lint, dead-export scans, and the remaining changed-file guards pass. The first lint invocation lacked the tracked Solid lint dependency after gateway-only setup; restoring that dependency and resuming lint/remaining guards cleared the environment failure. - Independent Codex autoreview is scoped-clean through P2 on this head. ClawSweeper reviewed this exact head with no findings and no before-merge items. Its test note reflects the stated 4B timeout limitation; successful 8B Gateway publication is documented above. [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/38171953530) passed in 588 seconds wall time with 45 successful jobs and no failures. The published `openclaw/ci-gate` status is also successful for `19c2a83e73def2454c1ea367af909dea9727e381`.
Related: #153391.
This PR fixes utility completions dropping configured payload parameters; #153391 stays open for the broader observer-budget question.
What Problem This Solves
Configured OpenAI-compatible payload parameters were dropped from utility completions, so reasoning models could ignore the requested thinking settings when generating session titles and summaries.
User Impact
Utility completions now send configured chat-template and extra-body fields using the same payload policy as normal agent turns. Existing caller token budgets, provider routing, and model selection remain unchanged; no new settings or migrations are introduced. This repairs parameter loss, not the separately reported observer-budget policy or unconfirmed model-ID substitution.
Why This Change Was Made
The simple-completion transport keeps the original wire API visible to payload policy while preserving the provider dispatch alias. Both paths share configuration alias resolution and the existing OpenAI-compatible payload policy, including extra-body precedence and non-native store cleanup.
Evidence
c935d7184eathrough the real Gateway dashboard-title owner, isolated completion, and built-in transport to a loopback HTTP/SSE provider configured as a reasoning model. The recorded request lacked both configured fields. The same probe passes with this fix and returns the title.{"model":"title-model","stream":true,"max_completion_tokens":4096}; neitherchat_template_kwargsnormin_pwas present."chat_template_kwargs":{"enable_thinking":false},"min_p":0.2, configured throughchat_template_kwargsandextra_bodyrespectively. Message content and caller budget are unchanged.min_p: 0.1; they now send0.3/0.7/0.3and their ownenable_thinking: false/true/false. Agent-wide parameters override agent-model parameters, which override shared-model parameters, through the existing resolver. The 20 transport tests and 9 HTTP title tests pass in 26.02 seconds; shared-registry coverage also checks separate agent/auth policies and unchanged unscoped callers.016c666c): the only semantic reachable declaration change is additive optionalagentId?: stringonAiProviderStreamHookContext; two other hunks only reorder optional-undefined union fields. No SDK entrypoints were added or removed.