Repository navigation
fix(live-proof): preserve successful terminal verification - #1232
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 4:45 AM ET / 08:45 UTC. ClawSweeper reviewWhat this changesThe PR changes terminal live-proof execution so tmux process completion, rather than captured output visibility alone, determines whether a command passed. Regression provenancePossible regression — probable (reproduction; failure trace; reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open for normal merge review: current main still relies on pane output visibility, while this branch makes tmux completion status authoritative and preserves successful commands with an explicitly non-observed marker. The focused failure-path coverage and current-head tmux proof support the approach; no blocking patch defect was found. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTerminal live proof runs a planned command in tmux, captures bounded terminal output, and publishes a verification result into the review workflow. This change separates command completion from display-marker capture before the result can be used for proof or recording eligibility. flowchart LR
A[Live proof plan] --> B[Terminal command runner]
B --> C[tmux supervised process]
C --> D[Exit or signal status]
C --> E[Captured pane output]
D --> F[Verification decision]
E --> F
F --> G[Review comment and recording eligibility]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain process completion as the passing authority, keep absent output markers visibly non-observed and recording-ineligible, and confirm the supported hosted tmux path before landing. Do we have a high-confidence way to reproduce the issue? Yes. The PR body records the prior successful command and missing-marker failure, then supplies current-head real-tmux after-fix scenarios for success, timeout, signal, and sequential-command behavior. Is this the best way to solve the issue? Yes. Making process completion authoritative while preserving an absent marker as a visible, non-recordable observation is narrower and safer than treating pane visibility as command success. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ce250708c1ea. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Summary
Fix terminal live verification so a successful command is not reclassified as failed only because a requested marker was not visible in the captured pane.
runaction as a tmux-supervised Bash process from an exact private command file.pane_dead_statusandpane_dead_signalas the command completion authority, including transient status publication and fail-closed probe errors.NOT OBSERVEDand excluding it from recorded-proof eligibility.Root cause
The 30-second
expect_outputloop owned only tmux pane visibility. It had no authoritative relationship to the command's completion status, so its timeout could override a command that had already completed successfully.That happened in ClawSweeper run 32405834950:
node scripts/run-vitest.mjs src/agents/code-mode.mcp.test.tscompleted with 1 file and 10/10 tests passing, and the wrapper reported success after 28.37 seconds. The durable review comment nevertheless recorded a partial failure becauseCode Mode MCP namespacewas not visible before the display wait expired: openclaw/openclaw#126262 review.The fix moves completion ownership outside the measured shell. tmux now supervises the exact command process and reports its exit or signal independently of what appeared in the pane.
Behavior proof
Claim: A terminal command that exits 0 remains a passing verification when its requested marker was not captured, while genuine failures and timeouts still fail.
Exercised surface:
src/live-proof/drivers.tsthrough the real local tmux process boundary on current headcb2128f8a1764041f80424dca09ddfc942161699.Environment: macOS, Node v24.19.0, tmux 3.7c, recording disabled.
Scenarios and observable results:
Tests 10 passed (10)andwrapper passed after 28.37 seconds; absent marker producedcompletedwithcommand exited successfully; expected output was not observed in the captured pane.timeout 1s ...failed and was identified as exit status 124.kill -TERM $$failed and was identified as signal-derived exit status 143.runactions completed with clean aggregated outputfirst\nsecond.Trace: The current-head JSON trace was captured session-locally and its complete scenario results are summarized above.
Limits: Local macOS proof, recording disabled, and synthetic commands matching the observed timing/result shape rather than rerunning the OpenClaw repository test itself.
Validation
pnpm run check:staticpnpm run build:allpnpm run lintnode --test test/live-proof.test.ts— 73 passednode --test test/live-proof-review-environment.test.ts— passed five consecutive reruns after the CI timing fixorigin/main— no accepted/actionable findingsA full
pnpm run checkwas also attempted. Static checks, all builds, lint, the changed coverage gate, and 3,668 tests passed before 48 unrelated repair-fixture failures. Those fixtures construct temporary repositories where validation now reportsfatal: Not a valid object name origin/main; 9 tests were skipped. The failures are outside the live-proof files changed here.Bay impact
OpenClaw Bay is unaffected. The durable live-verification schema remains version 1, and Bay remains an observer-only consumer.