Repository navigation
fix(agents): preserve per-turn settings and diagnostics - #138695
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 4, 2026, 11:45 PM ET / September 5, 2026, 03:45 UTC. ClawSweeper reviewWhat this changesPreserves one-turn thinking, verbosity, and trace choices through queued execution, model fallback, and diagnostic delivery without overwriting saved preferences. Merge readiness✅ Ready for maintainer review The repair remains necessary on current main. The previous verbosity blocker is resolved, the updated proof addresses the requested delivery replay, and no new blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe reply pipeline turns incoming chat directives and saved session preferences into agent execution settings. It carries those settings through queued work and model fallback, then sends answers, tool progress, and authorized diagnostics to the originating conversation. flowchart TD
A[Incoming chat and directives] --> C[Turn admission]
B[Saved session preferences] --> C
C --> D[Immediate or queued execution]
D --> E[Model fallback and memory work]
E --> F[Shared diagnostic rendering]
F --> G[Delivery and visibility gates]
G --> H[Conversation replies and tool progress]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +123, Tests +1094, Other -1. Total +1216 across 46 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain original turn choices at admission and share diagnostic rendering; the additional carrier and dispatch callback preserve information that cannot safely be reconstructed from saved preferences. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main clears authorized mixed-message verbosity and thinking hints before execution. Focused regressions and the supplied before/after delivery results cover that failure; this review did not execute runtime tests. Is this the best way to solve the issue? Yes. A parser-only repair would leave queue and fallback settings vulnerable, while temporarily persisting inline choices would leak them into later turns; this patch repairs the owning boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cf127a39cb97. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Keep inline hints on admitted work through queue retargeting, collect grouping, main and memory fallback, and completion. Share authorized diagnostic rendering for immediate and queued replies; refresh inherited preferences only within the captured session generation. Persist standalone settings at their existing owner. Retain canonical parser, memory E2E, and session-list notification repairs now on main. Preserve native argument validation and malformed text exec controls. Release-note context: one-turn settings survive queued execution and model changes, and Gateway clients receive authorized trace and verbose diagnostics.
6c1b1ce to
577018c
Compare
Pass the admitted turn override into both existing visibility gates. Explicit off/on/full takes precedence; inherited settings keep their live session refresh and channels retain their forced-progress contract. Regression cases exercise immediate delivery in both override directions and summary-only mode, while preserving stored preferences and the final reply.
Publish admitted verbosity at the common execution owner so immediate and queued reply dispatch use explicit per-turn settings before live session defaults. Reset inherited queued settings without persisting inline preferences. Release-note context: honor inline full/off/on through actual tool delivery.
|
Merged via squash.
|
) * fix(agents): preserve per-turn settings and diagnostics Keep inline hints on admitted work through queue retargeting, collect grouping, main and memory fallback, and completion. Share authorized diagnostic rendering for immediate and queued replies; refresh inherited preferences only within the captured session generation. Persist standalone settings at their existing owner. Retain canonical parser, memory E2E, and session-list notification repairs now on main. Preserve native argument validation and malformed text exec controls. Release-note context: one-turn settings survive queued execution and model changes, and Gateway clients receive authorized trace and verbose diagnostics. * fix(agents): honor inline verbosity in immediate tool progress Pass the admitted turn override into both existing visibility gates. Explicit off/on/full takes precedence; inherited settings keep their live session refresh and channels retain their forced-progress contract. Regression cases exercise immediate delivery in both override directions and summary-only mode, while preserving stored preferences and the final reply. * fix(agents): carry turn verbosity through reply delivery Publish admitted verbosity at the common execution owner so immediate and queued reply dispatch use explicit per-turn settings before live session defaults. Reset inherited queued settings without persisting inline preferences. Release-note context: honor inline full/off/on through actual tool delivery.
* refs/remotes/origin/main: fix(codex): reject stale control commands after session rollover (openclaw#138820) fix: normalize small Responses output budgets (openclaw#138828) test(voice-call): reuse presence guards in notify helpers (openclaw#138246) refactor(logbook): type reads and bound observation queries (openclaw#138816) fix(workboard): stop services before retiring SQLite stores (openclaw#138810) fix(ci): stabilize Control UI stream and recovery tests (openclaw#138776) fix(cli): share recorded gateway state path inspection (openclaw#138822) refactor(anthropic): replace Agent SDK with direct CLI transport (openclaw#138707) fix(agents): preserve per-turn settings and diagnostics (openclaw#138695)
Block: userText fallback chain in agent-runner-result-complete.ts (drift residue). Home: restored to upstream (drift residue). 2273ef6 widened buildReplyDiagnosticsPayload's userText to commandText || agentText || CommandBody || RawBody || BodyForAgent || Body. Upstream canonicalized inbound text once in 0dd9dcd (openclaw#113179), removing those raw-body fallbacks, and 56da574 (openclaw#138695) set this site to commandText || agentText. Restore upstream's expression; the surrounding continuation change (skip diagnostics for silent continuations) stays. Refs #1418 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Fixes an issue where inline settings disappeared after parsing, were replaced by saved defaults during queued model changes, or leaked into later turns. Trace choices could stop before completion, queued replies skipped diagnostic rendering, and Gateway delivery filtered diagnostic text. Saved verbosity also overrode an explicit one-turn choice at both tool production and dispatch.
Why This Change Was Made
Keep parsed hints on the admitted turn and persist standalone directives at the existing session transaction owner. Model selection retains its documented persistence exception. Preserve the original thinking request separately from the effective model level through queue retargeting and runtime/memory fallback, and keep incompatible collect groups separate.
Immediate and queued completion share one authorized diagnostic renderer. Existing status-notice classification delivers diagnostics without turning them into assistant answer content or TTS. Completion refresh validates the captured session generation. Both tool-production gates and the dispatch gate receive the executing turn's choice; each queued execution replaces that choice, so an inherited turn clears its predecessor's override. Inherited verbosity continues to read live session preferences. Forced progress, silent outcomes, suppressed delivery, and source authorization retain their existing contracts.
Main's canonical parser and raw malformed
/execvalidation from #138545, structured memory E2E from #138671, and committed-settings notifications from #118822 remain intact. No configuration, database schema, or protocol surface is added.User Impact
One-turn thinking, trace, and verbosity choices survive execution, queued model changes, fallback, and diagnostic delivery without overwriting saved preferences. Inline
/verbose fulldelivers summaries and raw tool output even when saved verbosity is off; inline off suppresses both, and inline on delivers summaries only. Existing slash-command, thinking, and queue documentation describes these restored contracts.Evidence
Final source:
0ad1d7cae6b933093816bf18cfdeddf3adbb6535, tree61104744d9c44b607a2887b196e73d4dbd14f19c.Exact-head CI passed 107 selected jobs, with 17 skips. Fresh isolated Gateway proof used an own frozen install and canonical cold build on clean signed source. All 11 Gateway/memory E2Es and all three actual QA-channel HTTP-bus tool-delivery cases passed. The synthetic provider consumed real exec file output; a unique raw marker was absent from the prompt and command. Every case reached acknowledged channel dispatch and delivered its final answer; forced tool progress was disabled.
{"source":"0ad1d7cae6b933093816bf18cfdeddf3adbb6535","environment":"ephemeral Gateway + QA channel HTTP bus + synthetic provider + real exec","canonicalBuildExit":0,"toolDelivery":{"passed":3,"failed":0,"forcedProgress":false,"allFinalAnswers":true,"allSavedPreferencesUnchanged":true},"gatewayAndMemoryE2E":{"passed":11,"failed":0},"receiptSha256":"c5353c248b5e344f5f8d3d03834365a666be589a1bd4c3548762d557a1a3a418"}The same capture classifier shows three failures before the producer repair, one remaining stored-off/inline-full failure after that repair, and all three passing with the final dispatch connection. An initial probe incorrectly recognized only
Execsummaries; full verbosity canonically rendersshow <file>. Correcting the classifier and rerunning the unchanged product confirmed the table above. It did not alter production or weaken the raw-output/persistence checks.Regression and owner proof includes 1,040 original owner/sibling tests; 437 parser/normalizer/native/full-reply integration tests; 237 final hint/persistence/model/session-list tests; 141 immediate/helper/queued tests; and 273 dispatcher/immediate/helper/queued tests. The final eight-file gate passed after correcting the existing mock's static type, and prior full changed-file and architecture gates passed. Independent Codex autoreview cleared the complete repair and subsequent integration/producer/dispatch deltas through P2; the final exact-source review has no accepted findings.
Commands used include
node scripts/check-changed.mjs -- <changed files>, the repositorynode scripts/run-vitest.mjsrunner for the named owner suites, and the canonical E2E build prerequisite followed bytest/e2e/qa-lab/runtime/gateway-rpc-chat.e2e.test.tsandtest/e2e/qa-lab/runtime/memory-dreaming-provenance.e2e.test.ts.Earlier Gateway proof retains its source scope: 11 E2Es plus four model-switch cases, followed by five changed-flow cases covering live inherited verbosity, explicit choices, and a queued reasoning → non-reasoning → reasoning round trip. The final table adds the requested immediate full/on/off delivery evidence. Queued evidence remains those existing owner tests and Gateway flows; no new live queued full/on/off bubble matrix is claimed. This explicitly scopes the optional ClawSweeper rank-up move.
The QA-bus proof exercises the real Gateway/channel flow with synthetic endpoints; it is not Telegram Test Server evidence. The previous release canary reached Telegram but failed with HTTP 400 write permission, so authenticated Telegram delivery remains unavailable.
Scope and Size
Production is +466/−343 lines, net +123; tests/support are +1335/−241, net +1094; the assertion baseline drops one obsolete row. Growth carries missing original-request and generation facts and connects existing execution/delivery owners. The final private callback accounts for net +23 production lines: dispatch otherwise cannot know the admitted turn choice without reparsing or persisting it. Shared rendering removes duplicate ownership; main's canonical parser and memory fixture replace overlapping work.
Provenance: #137562 introduced the text/native argument ownership regression. Its parser portion was independently repaired in #138545; this PR repairs the remaining turn-setting and completion boundaries.
Follow-up
Commentary/draft lane ownership is captured before admitted verbosity resolution. Both opposing-value probe cases produce the same six failures before and after this delta, with final answers still delivered; relocating that lane initialization is a separate named repair, not claimed here. Inherited full ↔ on changes can also leave separately captured shell-command metadata detail stale. Steering text into an already-admitted turn needs its own explicit per-message settings contract.
Release-note context: preserve one-turn settings through provider execution, queued model changes, fallback, tool delivery, and native Gateway diagnostics.