Skip to content

fix(agents): preserve per-turn settings and diagnostics - #138695

Merged
steipete merged 3 commits into
mainfrom
codex/release-2026-9-2-inline-directives
Sep 5, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/release-2026-9-2-inline-directives

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

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 /exec validation 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 full delivers 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, tree 61104744d9c44b607a2887b196e73d4dbd14f19c.

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.

Saved verbosity Inline choice Summary delivered Raw output delivered Saved value afterward
off full yes yes off
full off no no full
full on yes no full
{"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 Exec summaries; full verbosity canonically renders show <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 repository node scripts/run-vitest.mjs runner for the named owner suites, and the canonical E2E build prerequisite followed by test/e2e/qa-lab/runtime/gateway-rpc-chat.e2e.test.ts and test/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.

@clawsweeper

clawsweeper Bot commented Sep 4, 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 size: XL maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 11:45 PM ET / September 5, 2026, 03:45 UTC.

ClawSweeper review

What this changes

Preserves 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
Reviewed head: 0ad1d7cae6b933093816bf18cfdeddf3adbb6535

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sound owner-boundary repair with strong scoped behavior evidence and the prior blocker resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The captured exact-source Gateway/QA-channel proof exercises tool production through acknowledged channel dispatch for full/off/on, preserves saved preferences, and delivers final answers; it satisfies the repository’s authorized harness standard. Authenticated Telegram and a new queued bubble matrix are explicitly outside the claimed coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured exact-source Gateway/QA-channel proof exercises tool production through acknowledged channel dispatch for full/off/on, preserves saved preferences, and delivers final answers; it satisfies the repository’s authorized harness standard. Authenticated Telegram and a new queued bubble matrix are explicitly outside the claimed coverage.
Evidence reviewed 11 items Reviewed introduction boundary: Reviewed the pinned merge-base-to-head changes. The checkout matches the original PR head; the supplied stale test merge was not used to infer removal of current-main behavior.
Current-main necessity: Current main still clears non-model inline hints in mixed messages. The related merged parser repair preserves task text but does not replace this turn-settings repair.
Established preference contract: The latest release documents inline thinking and verbosity as message-local, with standalone directives setting session defaults. The branch restores this existing contract without adding configuration or a storage format.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Source +123, Tests +1094, Other -1. Total +1216 across 46 files.

View PR surface stats
Area Files Added Removed Net
Source 28 466 343 +123
Tests 17 1335 241 +1094
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 46 1801 585 +1216

Review metrics

Metric Value Why it matters
Production versus test growth Production net +123; tests/support net +1094; baseline −1 Growth carries original-request and generation facts across existing owners while shared rendering removes duplicated completion logic.
Public configuration and storage surfaces 0 new config options; 0 schema or protocol changes The repair changes preference propagation without introducing an upgrade format or operator migration.

Technical review

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-source Gateway/QA-channel proof exercises tool production through acknowledged channel dispatch for full/off/on, preserves saved preferences, and delivers final answers; it satisfies the repository’s authorized harness standard. Authenticated Telegram and a new queued bubble matrix are explicitly outside the claimed coverage.

Label justifications:

  • P2: Repairs established per-turn settings and diagnostic delivery with a bounded effect on chat execution.
  • 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 (linked_artifact): The captured exact-source Gateway/QA-channel proof exercises tool production through acknowledged channel dispatch for full/off/on, preserves saved preferences, and delivers final answers; it satisfies the repository’s authorized harness standard. Authenticated Telegram and a new queued bubble matrix are explicitly outside the claimed coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-source Gateway/QA-channel proof exercises tool production through acknowledged channel dispatch for full/off/on, preserves saved preferences, and delivers final answers; it satisfies the repository’s authorized harness standard. Authenticated Telegram and a new queued bubble matrix are explicitly outside the claimed coverage.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Inline verbosity and diagnostic supplements affect visible Telegram messages, so Telegram Test Server classification remains applicable despite sufficient alternative Gateway proof.

Evidence

What I checked:

  • Reviewed introduction boundary: Reviewed the pinned merge-base-to-head changes. The checkout matches the original PR head; the supplied stale test merge was not used to infer removal of current-main behavior. (0ad1d7cae6b9)
  • Current-main necessity: Current main still clears non-model inline hints in mixed messages. The related merged parser repair preserves task text but does not replace this turn-settings repair. (src/auto-reply/reply/get-reply-directives-routing.ts:115, cf127a39cb97)
  • Established preference contract: The latest release documents inline thinking and verbosity as message-local, with standalone directives setting session defaults. The branch restores this existing contract without adding configuration or a storage format. Public docs: docs/tools/thinking.md. (docs/tools/thinking.md:43, ad6fe23aecb9)
  • Admission and persistence ownership: Mixed-message hints remain on the admitted turn; the existing directive transaction persists standalone settings and the documented model-selection exception. Parser and mixed-directive regressions check unchanged stored values, malformed exec arguments, and model-switch behavior. (src/auto-reply/reply/directive-handling.impl.ts:445, 0ad1d7cae6b9)
  • Fallback siblings and dependency signal: Main execution and memory flushing use the same original-request resolver. Queue tests explicitly exercise Codex runtime retargeting; the Codex adapter consumes the resulting thinking level when constructing turn effort, establishing the dependency-contract signal. (src/auto-reply/reply/agent-runner-utils.ts:206, 0ad1d7cae6b9)
  • Direct Codex contract inspection: Verified the dependency checkout through its cache repository's openai/codex origin. Directly inspected effort serialization, collaboration-setting updates, model retargeting, and Ultra-to-request-effort mapping; the harness owns the final inference effort. (codex-rs/core/src/client.rs:186, 41e22fee981a)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • iamvaleriofantozzi: 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 (4 earlier review cycles)
  • reviewed 2026-09-05T01:01:31.039Z sha 6c1b1ce148e175b9dcbeddeac8d6c24934d7cfa5 :: needs changes before merge. :: [P2] Honor inline verbosity in immediate tool-progress gates
  • reviewed 2026-09-05T01:21:00.403Z sha 577018c :: needs changes before merge. :: [P2] Honor inline verbosity in immediate tool-progress gates
  • reviewed 2026-09-05T01:55:14.337Z sha 2843b14 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T03:07:45.617Z sha 0ad1d7c :: needs maintainer review before merge. :: none

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.
@steipete
steipete force-pushed the codex/release-2026-9-2-inline-directives branch from 6c1b1ce to 577018c Compare September 5, 2026 01:06
@steipete steipete changed the title fix(agents): preserve inline tasks and turn settings fix(agents): preserve per-turn settings and diagnostics Sep 5, 2026
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.
@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 5, 2026
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.
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 5, 2026
@steipete
steipete merged commit 56da574 into main Sep 5, 2026
181 of 182 checks passed
@steipete
steipete deleted the codex/release-2026-9-2-inline-directives branch September 5, 2026 03:51
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
)

* 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.
vincentkoc added a commit to LiuwqGit/openclaw that referenced this pull request Sep 5, 2026
* 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)
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 3, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

1 participant