Skip to content

fix: apply configured payload parameters to utility completions - #153451

Merged
obviyus merged 28 commits into
openclaw:mainfrom
Alix-007:alix/fix-simple-completion-extra-params-153391-20260920
Sep 26, 2026
Merged

obviyus merged 28 commits into
openclaw:mainfrom
Alix-007:alix/fix-simple-completion-extra-params-153391-20260920

Conversation

@Alix-007

@Alix-007 Alix-007 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Reproduced against main c935d7184ea 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.

@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Sep 20, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 8:36 PM ET / September 26, 2026, 00:36 UTC (Revision 21).

ClawSweeper review

What this changes

The 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
Reviewed head: 6be815f2d92d5819e648abdc4d4ba5d7b01872f0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct transport proof and focused regressions support a coherent shared-policy repair; exact-head CI remains routine landing validation.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR records before-and-after requests from the Gateway title owner through the built-in OpenAI-compatible HTTP/SSE transport: configured fields appear on the wire after the fix, including distinct agent-specific values, and the title is returned. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR records before-and-after requests from the Gateway title owner through the built-in OpenAI-compatible HTTP/SSE transport: configured fields appear on the wire after the fix, including distinct agent-specific values, and the title is returned. No stored-data contract changes.
Evidence reviewed 8 items Current main lacks the repair: The current-main utility transport hook delegates to the provider wrapper without resolving configured payload parameters.
Latest release lacks the repair: The v2026.9.6 transport hook also lacks the configured payload policy; the branch's central change is neither released nor on current main.
Introduced payload policy: The pinned PR diff resolves global, shared-model, agent-model, and agent-wide records before wrapping an OpenAI-compatible utility stream.
Findings None None.
Security None None.

How this fits together

OpenClaw 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +50, Tests +132, Other 0. Total +182 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 8 229 179 +50
Tests 3 159 27 +132
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 12 389 207 +182

Review metrics

Metric Value Why it matters
Production and test lines production +229/−179; tests +159/−27 The production growth is partly offset by moving existing payload policy into one shared owner; the new tests exercise the transport boundary.
Provider hook context 1 optional field added The additive agent ID field carries configuration scope into utility transport preparation.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a limited but real utility-model configuration failure that can affect generated titles and summaries.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR records before-and-after requests from the Gateway title owner through the built-in OpenAI-compatible HTTP/SSE transport: configured fields appear on the wire after the fix, including distinct agent-specific values, and the title is returned. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR records before-and-after requests from the Gateway title owner through the built-in OpenAI-compatible HTTP/SSE transport: configured fields appear on the wire after the fix, including distinct agent-specific values, and the title is returned. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Nik: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • 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.

History

Review history (20 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-24T03:21:35.897Z sha cd59e91 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-24T03:43:23.178Z sha 0e3c968 :: needs changes before merge. :: [P3] Remove the test-only provider-wrapper bypass
  • reviewed 2026-09-24T08:24:54.178Z sha e268ac1 :: needs changes before merge. :: [P3] Remove the remaining agent-path utility test
  • reviewed 2026-09-24T09:29:47.507Z sha e40e165 :: needs changes before merge. :: [P3] Record the measured cost of the changed transport tests
  • reviewed 2026-09-24T09:50:35.254Z sha e40e165 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-25T23:02:09.145Z sha 349a3be :: needs maintainer review before merge. :: none
  • reviewed 2026-09-25T23:19:59.195Z sha 5eaaabc :: blocked before merge. :: none
  • reviewed 2026-09-26T00:12:59.563Z sha 5eaaabc :: needs changes before merge. :: [P2] Apply agent-scoped parameters to utility completions

@Alix-007 Alix-007 changed the title [Bug]: preserve model extra params for isolated completions fix(agents): preserve model extra params for isolated completions Sep 20, 2026
@obviyus obviyus self-assigned this Sep 20, 2026
@obviyus obviyus changed the title fix(agents): preserve model extra params for isolated completions fix: apply configured payload parameters to utility completions Sep 20, 2026
@obviyus

obviyus commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

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.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Sep 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M and removed size: S labels Sep 20, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 20, 2026
@obviyus

obviyus commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

The branch has moved again, most recently to 53ba4fafc563f72afabf795e02a595ba1dab9aa6. I am holding the maintainer preparation to avoid racing your source and description updates. Please reply when those inputs are stable so I can reconcile the final branch before another review.

The retained passing runtime proof and clean code-review report apply to the earlier combined head 9c68f542ebcd6d8aaa58c57b2d994365bafb77bf, including your wire-API correction. They do not establish correctness or passing tests for the newer heads. The maintainer replay passed 210 related tests and eight real Gateway/direct-HTTP/CONNECT-TLS scenarios; your checkout's defineCacheKeyGenerator collection failure is a separate observation, not a replacement for that evidence.

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 Related: #153391: the observer-budget and model-ID parts of that report were not independently resolved by this repair.

@obviyus

obviyus commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

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

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@obviyus

obviyus commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

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

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
@obviyus
obviyus merged commit 50324f6 into openclaw:main Sep 26, 2026
375 of 390 checks passed
@obviyus

obviyus commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…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]>
steipete added a commit that referenced this pull request Oct 11, 2026
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`.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
)

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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants