Repository navigation
fix(tui): keep PTY progress and lifecycle truthful - #117402
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 9:05 AM ET / 13:05 UTC. ClawSweeper reviewWhat this changesThe branch makes the serial TUI PTY Vitest shard emit per-test progress, keeps local runs in “finishing context” until their final chat event, and makes the Merge readinessThis PR is still necessary: current Priority: P2 Review scores
Verification
How this fits togetherThe terminal UI projects agent lifecycle and chat events into a visible activity status while the embedded local backend runs an agent turn. The PTY test lane drives that real local TUI flow and its reporter output is the CI watchdog’s liveness signal. flowchart LR
A[Local TUI input] --> B[Embedded agent turn]
B --> C[Lifecycle events]
B --> D[Final chat event]
C --> E[Activity status projection]
D --> E
E --> F[TUI display and PTY exit]
G[Serial PTY tests] --> H[Verbose test reporter]
H --> I[CI watchdog progress]
Decision needed
Why: The patch has no supported mechanical blocker, but the repository’s protected Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +43. Total +42 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the focused repair against current main, retaining final chat as the sole local-run proof of post-turn completion and the serial PTY reporter as the watchdog-progress mechanism. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main renders lifecycle end as idle at Is this the best way to solve the issue? Yes. The patch repairs the projection at the event owner instead of extending shutdown timing or compensating in the consumer; final chat is already the lifecycle helper’s authoritative path for setting idle. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fb9c8e74e619. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* origin/main: docs: generate docs map at publish time (openclaw#117398) refactor(plugins): move plugin contributions into the registry bundle (openclaw#117372) fix(tui): keep PTY progress and lifecycle truthful (openclaw#117402) test(xai): type realtime sent item payloads fix(qa): preserve Slack fallback evidence (openclaw#117420) fix(qa): satisfy update lane execution contracts (openclaw#117388) fix(qa): Matrix replies disappear after final replacement (openclaw#117390) test(xai): prove rejected tool call continuation fix(xai): complete rejected realtime tool calls test(xai): add live tool argument probe test(xai): cover rejected realtime tool arguments fix(xai): validate realtime tool arguments before dispatch fix(xai): skip tool call when rawArgs JSON parse fails instead of silently falling back to empty args
* origin/main: docs: generate docs map at publish time (openclaw#117398) refactor(plugins): move plugin contributions into the registry bundle (openclaw#117372) fix(tui): keep PTY progress and lifecycle truthful (openclaw#117402) test(xai): type realtime sent item payloads fix(qa): preserve Slack fallback evidence (openclaw#117420) fix(qa): satisfy update lane execution contracts (openclaw#117388) fix(qa): Matrix replies disappear after final replacement (openclaw#117390) test(xai): prove rejected tool call continuation fix(xai): complete rejected realtime tool calls test(xai): add live tool argument probe test(xai): cover rejected realtime tool arguments fix(xai): validate realtime tool arguments before dispatch fix(xai): skip tool call when rawArgs JSON parse fails instead of silently falling back to empty args
What Problem This Solves
The dedicated TUI PTY shard can exceed the 300-second no-output watchdog even while its serial real-backend tests are completing normally. Vitest's default non-TTY reporter buffers successful test results until a file finishes, so CI sees no child output and kills/retries a healthy shard. This is visible in main job 91358851223, PR job 91359114476, and job 91361015856.
The verbose reporter exposed a second, independent bug in the real local PTY test and product state projection: local lifecycle
endwas rendered asidlebeforeagentCommandFromIngresshad completed post-turn maintenance./exitcould therefore begin while the embedded backend was intentionally still waiting for maintenance, hit the PTY's 4-second exit assertion, and then spend the 120-second shutdown grace in cleanup.Why This Change Was Made
verbosereporter for this intentionally serial shard so every completed test produces truthful watchdog progress. Vitest 4.1.10's default reporter disables its live summary in non-TTY CI, whileVerboseReporterlogs every finished test case.finishing contextacross lifecycleend; its authoritativechat.final, emitted after post-turn maintenance, now owns the transition toidle. Gateway, untracked, concurrent, and already-finalized runs retain their existing behavior./newPTY scenario wait for the second turn's own response and subsequent authoritative idle before/exit, excluding stale output from the first turn and session rollover.setActivityStatus("error")branch while touching the owner, leaving production code at net -1 LOC.The reporter override was already prototyped by Peter Steinberger in open PR #114388, commit
f4ed4554410bb4b9017461db69aa4d11196bca22; this standalone PR extracts it onto current main. The incomplete second-turn wait was introduced incd305b3b0cb9fcedaccfd5cec3b0ced1fde032ce(#100241).User Impact
Local TUI users no longer see a false
idlestatus while post-turn maintenance is still running. CI gets real per-test progress instead of false no-output watchdog terminations. No timeout, retry, worker-count, shutdown-grace, config, protocol, or public API changes are included.Evidence
/exitlifecycle race rather than a watchdog kill.OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1and the dedicated PTY config.No changelog entry: this repairs TUI status truthfulness and CI test observability without adding a user-facing feature.
Current-main integration and macOS disposition
75673e201195ea3ec8d462daf44fa79011621936has parent4e47c4cabf8f2901ec781b59d059999211398813; it predates the already-landed TUI shutdown work incd4bd7c6c0ca860babbcbf0b68a066f3627ad547./exittimeout after the second response and visible idle. This is recorded here for transparency, but it is not the composition GitHub will land.origin/mainb5a59e0a7d948a8b9021b97ab5c66248f12303d2plus the PR head merges cleanly.git merge-tree --write-tree origin/main 75673e201195ea3ec8d462daf44fa79011621936produced tree8cc5092c28a7b6447daa8bf1381111cb4a2d1e4c; the only same-path overlap since the PR base issrc/tui/tui-pty-local.e2e.test.ts.drives the real local backend with a mocked model endpointpassed 1/1 in 14.603 seconds, including first response,/new, second response, subsequent authoritative idle, and/exit.src/tui/tui-event-handlers.test.tspassed 162/162.checks-node-compact-small-2, and real-behavior proof successful; earlier cancelled duplicate workflow dispatches were superseded by successful runs.No rebase or branch push is needed: the current-main three-way composition is clean, the actual merged behavior is proven on macOS, and native SHA-pinned squash landing against a fresh base will retain both sides.
ClawSweeper rank-up moves