Repository navigation
fix(tui): accept valid terminal capability output in test gates - #158748
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 26, 2026, 4:25 AM ET / 08:25 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch updates TUI component and PTY test support to accept valid terminal capability output while checking visible hyperlinks and their destinations. Merge readiness✅ Ready for maintainer review Current main and the latest release still contain the capability-sensitive test gates. Neither related PR owns this correction, and the reviewed patch has no identified blocking defect. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's terminal UI renders components into terminal escape sequences. A PTY test harness captures that output, reconstructs the visible screen, and uses it to decide whether rendering and sanitization checks pass. flowchart LR
A[Terminal capabilities] --> B[TUI renderer]
B --> C[PTY output]
C --> D[Evidence parser]
D --> E{Valid screen and links?}
E --> F[Test gate result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +127. Total +127 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the test gate anchored to visible linked cells and the exact image-capability query while preserving rejection of other terminal controls. Do we have a high-confidence way to reproduce the issue? Yes. The PR gives exact capability settings and failing baseline output, and the pinned dependency source explains both sequences; this read-only review did not execute the tests. Is this the best way to solve the issue? Yes. The patch corrects the test evidence boundary and checks rendered link destinations without changing the production renderer or broadly accepting terminal controls. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6c7544adc982. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…claw#158748) * fix(tui): validate capability-dependent terminal evidence * test(tui): remove unused replay helper re-export
What Problem This Solves
Fixes TUI test gates failing when the host terminal enables native hyperlinks and image capability probing.
Related: #158673. These gate failures are separate from the original Odin Mac lockup.
User Impact
No user-visible rendering change. TUI gates validate the same link and sanitization behavior across supported terminal capabilities.
Why This Change Was Made
Pinned pi-tui emits ST-terminated OSC8 links and queries cell pixels with
ESC[16tbefore rendering on image-capable terminals. The BTW and narrow PTY tests assumed BEL; the PTY evidence parser rejected that exact startup query.BTW assertions now use the existing column-level OSC8 decoder in both capability modes. PTY assertions authenticate linked glyphs and exact destinations on the current screen, including wrapped URLs. The replay owner accepts only the exact cell-size query outside synchronized frames. Other window operations, response sequences, embedded controls, C1 forms and in-frame queries remain rejected. The parser moved to a focused test-support module to respect the existing file-size limit.
Parallel safety exercises now settle all sibling cleanup before returning. Historical-frame checks run after input completes, avoiding dangling assertion promises on input failure.
Evidence
Fresh canonical reproduction base:
67adcce7e3043601354eacea4444d3361ee729c4. Candidate:79948808ff651a9b973581a1b8684636a3b698e9, preserving published89a9c4b68afaca1cb0e4e79eb426f58f735f92bcancestry. The original branch started on freshly fetchedefef0989b7f9682c010a6d36cd390f9cda79f75c. Fresh main before this correction was2d5c68187a38db0c3bbe4cc18be77c12b0f54727; the intervening package cleanup and plugin-reload changes leave this contract unchanged. Intervening changes leave the rendering/PTY contract unchanged; the TUI CLI hunk only consolidates help formatting.PI_HYPERLINKS=1, the original BTW assertion failed while preserving the exact URL/text in a complete ST link: 1 failed, 5 passed.PI_IMAGE_PROTOCOL=kitty PI_HYPERLINKS=1, the original startup/narrow PTY cases both failed. Withnone/0, those same cases passed. This isolates capability selection from rendering corruption.openclaw/ci-gatepassed on79948808ff651a9b973581a1b8684636a3b698e9, including dependency checks. No duplicate local graph was allocated.Reproduction and test audit
Escaped raw link evidence from the original failure:
Audited every case, assertion, helper, fixture, import, setup/teardown and skip in
btw-inline-message.test.ts,tui-pty-harness-assertion-test-support.test.ts,tui-pty-harness-assertion-test-support.ts,tui-pty-test-support.ts, andtui-pty-terminal-evidence-test-support.ts. Existing layout, initial/update/error, RTL, empty/control-only fallback, malformed-control, stale/erased/unfinished-frame and process-disposal coverage remains. Added link metadata is cleared by overwrite/erase and follows scrolling. Capability state is restored infinally. No cases were deleted, no retries/timeouts/skips changed, and no dependency or production-renderer changes were made. The replaced raw-byte assertions now prove complete visible links instead of one terminator spelling or aggregate redraw counts.The overlapping #158714 BTW edit only simplifies an empty-error fixture; it does not repair these assertions.