Repository navigation
fix: surface hidden-pane steer failures and demote per-turn gateway log noise - #124560
Conversation
Three terminal branches in steer-lifecycle.ts (transport null result, failed queue-row restore, failed queue-row removal) still gated their error on itemStillVisible, so a steer that failed after the operator navigated away parked the error on the queue row with no visible outcome — the exact invariant #124473 introduced surfaceChatDeliveryFailure() to protect. Route all three through the canonical helper and delete the divergent visibility-only branches. Regression test fails pre-fix (stash-verified): steer transport failure with the pane hidden now surfaces the session-named global toast.
Live campaign evidence showed three lines dominating operator logs at info level with no per-turn diagnostic value: - 'tool policy removed N tool(s)': the policy pipeline runs on every turn, so this repeated 42x in one session. Demote to debug and delete the now-dead toolPolicyAuditLogLevel/auditLogLevel plumbing that only existed to lower diagnostic probes to the level that is now the default (net -13 production LOC). - 'codex app-server one-shot cleanup checked shared client retirement': routine per-attempt teardown detail; demote to debug. - 'codex trajectory capture requires the SQLite host recorder': static config condition warned per attempt; warn once per process. Skipped: the [model-fetch] info carve-out in model-transport-debug.ts is a named contract (docs/logging.md, #89648) — always-info by design.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 9:21 AM ET / 13:21 UTC. ClawSweeper reviewWhat this changesRoutes three hidden-pane queued-steer terminal failures through the shared failure surface and moves repeated tool-policy and Codex cleanup diagnostics below normal log verbosity. Merge readinessKeep this PR open: the code follows the canonical visible-failure path and has no source-level blocking finding, but the required live Control UI proof for a queued-steer failure after navigation is absent. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI queues a steer, sends it through the Gateway, and must visibly report the terminal outcome even if the operator changed sessions. Agent and Codex runtime paths also emit diagnostics that flow into Gateway logs. flowchart LR
Operator[Operator steers a queued message] --> Queue[Chat queue]
Queue --> Gateway[Gateway send]
Gateway --> Outcome[Terminal outcome]
Outcome --> FailureSurface[Shared failure surface]
FailureSurface --> OperatorView[Inline error or global toast]
AgentTools[Agent and Codex runtime] --> PolicyLog[Policy and cleanup diagnostics]
PolicyLog --> DebugLogs[Debug log output]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -8, Tests +16. Total +8 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the canonical helper-based repair, then attach a sanitized recording from an isolated live Gateway showing a queued steer, session switch, transport failure, and session-named global toast before merge. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main gates three queued-steer terminal outcomes on pane visibility, and the PR’s focused harness drives a route switch before a transport failure. I did not execute the reproduction in this read-only review. Is this the best way to solve the issue? Yes for the implementation: routing all three branches through the existing shared failure helper is the narrowest owner-boundary repair; live UI evidence is still required before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 243f51d314d1. 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)
|
Knip's production unused-export gate rejects resetCodexTrajectoryRecorderWarningForTest — it was a test-only seam in production code. Reset the process-wide warn-once flag via vi.resetModules() + fresh dynamic import in the test instead.
The 0ms retry timer arms only after async watcher-state persistence, so 'await delay(5)' races it on loaded CI workers (flaked on checks-node-compact-large-2: spawn called 1 time, expected 2). Replace both fixed-sleep re-arm waits with vi.waitFor on the spawn count. The remaining delay(5) guards a negative no-further-spawn assertion after cancel, where a bounded sleep is the correct shape.
ClawSweeper P2: the host recorder factory returns null for per-session target-mapping conflicts, not only static config, so a process-wide warn-once flag silenced a later distinct session's recorder loss. Warn once per session (bounded set, cleared past 64 entries) so retries stay quiet but each newly affected session records its loss. Regression covers a later distinct session still warning.
|
Merged via squash.
|
…og noise (openclaw#124560) * fix(ui): surface hidden-pane steer terminal failures globally Three terminal branches in steer-lifecycle.ts (transport null result, failed queue-row restore, failed queue-row removal) still gated their error on itemStillVisible, so a steer that failed after the operator navigated away parked the error on the queue row with no visible outcome — the exact invariant openclaw#124473 introduced surfaceChatDeliveryFailure() to protect. Route all three through the canonical helper and delete the divergent visibility-only branches. Regression test fails pre-fix (stash-verified): steer transport failure with the pane hidden now surfaces the session-named global toast. * fix(logging): demote per-turn gateway log noise to debug Live campaign evidence showed three lines dominating operator logs at info level with no per-turn diagnostic value: - 'tool policy removed N tool(s)': the policy pipeline runs on every turn, so this repeated 42x in one session. Demote to debug and delete the now-dead toolPolicyAuditLogLevel/auditLogLevel plumbing that only existed to lower diagnostic probes to the level that is now the default (net -13 production LOC). - 'codex app-server one-shot cleanup checked shared client retirement': routine per-attempt teardown detail; demote to debug. - 'codex trajectory capture requires the SQLite host recorder': static config condition warned per attempt; warn once per process. Skipped: the [model-fetch] info carve-out in model-transport-debug.ts is a named contract (docs/logging.md, openclaw#89648) — always-info by design. * fix(codex): drop test-only trajectory warn-once reset export Knip's production unused-export gate rejects resetCodexTrajectoryRecorderWarningForTest — it was a test-only seam in production code. Reset the process-wide warn-once flag via vi.resetModules() + fresh dynamic import in the test instead. * test(cron): wait for backoff re-arm instead of fixed sleep The 0ms retry timer arms only after async watcher-state persistence, so 'await delay(5)' races it on loaded CI workers (flaked on checks-node-compact-large-2: spawn called 1 time, expected 2). Replace both fixed-sleep re-arm waits with vi.waitFor on the spawn count. The remaining delay(5) guards a negative no-further-spawn assertion after cancel, where a bounded sleep is the correct shape. * fix(codex): scope trajectory recorder warn dedupe to session ClawSweeper P2: the host recorder factory returns null for per-session target-mapping conflicts, not only static config, so a process-wide warn-once flag silenced a later distinct session's recorder loss. Warn once per session (bounded set, cleared past 64 entries) so retries stay quiet but each newly affected session records its loss. Regression covers a later distinct session still warning.
Related: #124473
What Problem This Solves
Fixes an issue where operators who steered a queued chat message and then navigated to another session would see no outcome at all when the steer failed: three terminal failure branches in the chat steer lifecycle (null transport result, failed queue-row restore, failed queue-row removal) still gated their error surfacing on the pane being visible, parking the error on a queue row nobody was looking at. This is the exact silent-failure invariant #124473 introduced
surfaceChatDeliveryFailure()to protect — these three pre-existing branches never got routed through it.Separately, resolves a problem where three per-turn gateway log lines dominated operator logs at info/warn level with no per-turn diagnostic value (one repeated 42x in a single observed session).
Why This Change Was Made
The steer fix routes all three terminal branches through the canonical
surfaceChatDeliveryFailure()helper and deletes the divergent visibility-only branches, so every steer failure ends in a visible outcome (inline when the pane is visible, session-named global toast when not). The logging change demotes the per-turntool policy removed N tool(s)audit line to debug and deletes the now-deadtoolPolicyAuditLogLevel/auditLogLevelplumbing end-to-end (it only existed to lower diagnostic probes to what is now the default), demotes the codex one-shot cleanup teardown line to debug, and makes the static codex trajectory recorder warning fire once per process instead of per attempt. The[model-fetch]info carve-out is intentionally kept — it is a named always-info contract (docs/logging.md, #89648).User Impact
Operators always get a visible outcome for a failed steer, even after switching sessions — no more silently swallowed terminal failures. Gateway logs at default level lose three lines of per-turn noise while keeping every signal available at debug.
Evidence
ui/src/pages/chat/chat-send.test.ts— "surfaces an unconfirmed steer failure globally when the pane is no longer visible". Stash-verified failing pre-fix for the intended reason (visibility gate swallowed the terminal outcome); passes post-fix.node scripts/run-vitest.mjs ui/src/pages/chat/chat-send.test.ts extensions/codex/src/app-server/trajectory.test.ts— 297 + 6 tests, all green.extensions/codex/src/app-server/trajectory.test.ts; tool-policy plumbing deletion covered by the updatedsrc/agents/tool-policy-pipeline.test.ts.dev:ui:mockscenario simulates a steer transport failure combined with pane navigation, and repo policy accepts the mock-gateway regression test as real-behavior proof for this channel-visible path.Opportunistic fixes (called out per Pathfinder rule)
check-dependenciesflagged the warn-once reset (resetCodexTrajectoryRecorderWarningForTest) as a production unused export — it was a test-only seam. Removed it; the test now gets clean module state viavi.resetModules()+ fresh dynamic import.checks-node-compact-large-2flaked onsrc/gateway/cron-exit-watchers.test.ts(unrelated to this diff): the 0ms retry timer arms only after async watcher-state persistence, soawait delay(5)races it on loaded CI workers. Replaced both fixed-sleep re-arm waits withvi.waitForon the spawn count; the remainingdelay(5)guards a negative assertion where a bounded sleep is the correct shape.ClawSweeper rank-up moves
surfaceChatDeliveryFailure, fix(ui): chat send failures were invisible when the session pane was hidden #124473) is already live-proven, so residual risk is limited to wiring, which the regression test covers.dev:ui:mockscenario simulates steer transport failure plus pane navigation; building one is named follow-up work, not a blocker.