Repository navigation
fix(tui): preserve authored hyperlink destinations - #136469
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 3:51 PM ET / 19:51 UTC. ClawSweeper reviewWhat this changesThis PR preserves Markdown-authored terminal hyperlink destinations while continuing to add links to plain and wrapped URLs that the renderer did not link. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer merge handling. The exact head contains a focused repair at the post-render fallback owner; it is not eligible for automated cleanup because it is maintainer-associated and carries the protected Priority: P2 Review scores
Verification
How this fits togetherThe terminal UI renders Markdown through Pi TUI, then OpenClaw adds fallback OSC 8 links for visible URLs. The changed pass must preserve renderer-owned link spans while handling unlinked text. flowchart LR
A[Markdown response] --> B[Pi TUI renderer]
B --> C[Rendered terminal spans]
C --> D[OpenClaw fallback linker]
E[Unlinked visible URLs] --> D
D --> F[Terminal hyperlink output]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -18, Tests +143, Docs +1. Total +126 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the fallback logic at the post-render owner, preserve renderer-authored spans, and complete exact-head CI before landing. Do we have a high-confidence way to reproduce the issue? No direct current-main run was performed in this read-only review, but the pre-fix owner path and the native-PTY scenario are clear from source and the supplied evidence, so the bug is source-reproducible. Is this the best way to solve the issue? Yes for the OpenClaw owner boundary: preserving renderer-owned spans in the post-render fallback pass avoids changing Pi TUI while retaining the existing bare-URL behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 47def12ea292. 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 (4 earlier review cycles)
|
Reuse the reviewed Gateway process-fixture cleanup from 667ce2b (PR #136469) to remove repeated configuration setup without changing assertions, timeouts, child invocations, or values. Align the equivalent corner-shape normalization with 6c89a1a (PR #136286) so the shared CI repairs integrate without conflicting spellings. No production behavior changes.
Reuse the reviewed fixture deduplication from #136469 while preserving the Linux listener regression added on main.
Reuse the gateway CLI fixture cleanup from #136469 (667ce2b) and the landed startup-recovery queue assertions from #136473 (564e544). These address independent lint and shared-worker test failures while preserving all process, state, cancellation, and survivor assertions. Keep Vincent Koc's scanner implementation and original PR ancestry unchanged. The new commit also refreshes pull-request CI against main's authenticated checkout repair from #136178.
|
Merged via squash.
|
* fix(tui): preserve authored hyperlink destinations * test: align queue depth and TUI integration expectations * test(cli): share Gateway process configuration fixtures * test(gateway): adopt canonical recovery queue admission * test(cli): retain the canonical main process test split
Summary
Fixes #136468.
A Markdown link such as
[https://example.test/label](https://example.test/actual-destination)could open the label URL instead of its authored destination in hyperlink-capable terminals. Pi TUI had already emitted the correct native OSC8 span; OpenClaw's subsequent visible-URL pass overrode it.Keep the renderer's existing hyperlink authoritative and infer targets only for unlinked text. Reuse the canonical terminal ANSI parser and replace the per-character URL map with a range cursor. The shipped bare/wrapped URL fallback remains intact.
Production +35 / −53 = -18 LOC; tests/support +148 / −5 = +143; docs +1.
Actual terminal proof
The real
runTuiloop runs in a native PTY with a synthetic backend. Before: the URL-shaped label emits/labelas its target. After: it emits/actual-destination; the ordinary Documentation sibling remains correct. The 36-column case wraps across two rows and both retain the authored target. The unidentified-terminal path still prints and links the destination.These pictures render the recorded 100×30 PTY frames and show diagnostics extracted from the recorded OSC8 stream. They are explicitly labeled renderings, not graphical terminal screenshots.
The proof exercises actual terminal bytes with a fake backend. It does not claim a graphical VS Code launch, browser navigation, provider/Gateway transport or persistence. The separate picker cancellation defect is being repaired independently.
Dependency inspection and CI follow-up
The maintainer directly inspected the installed Pi TUI 0.84.2 renderer and ANSI output contract, the shared terminal parser and the complete caller/fallback owner. The raw native-PTY output and fully inspected synthetic renderings show the authored destination is retained; the reviewer’s missing dependency files/DNS access is an environment limitation, accepted with that direct inspection and recorded evidence.
The serial PTY inventory includes the new hyperlink integration test; all four inventory checks pass. Canonical startup-recovery coverage and its real-Gateway proof are described below. These CI corrections add no counted product issue.
CI follow-up and review disposition
The temporary Gateway CLI fixture cleanup has been removed because main already owns the canonical test split. The cumulative PR no longer changes that file. The exact three-way file merge matches main byte for byte, retaining the health/transport cases, Linux socat case and cleanup hooks; typed lint and an independent Codex P2 review pass. No product issue or production deletion is credited to this reconciliation.
Shared CI fixture follow-up
Startup-recovery coverage now uses the canonical fixture already landed in #136473: await both exact queued message identities, assert one pending item alongside the active source, then retain cancellation, survivor and cleanup checks. This replaces the earlier pending-only assertion where present. The exact real-Gateway scenario passes after adoption; no production recovery behavior changes.
Fresh scoped typed lint/format checks and independent Codex P2 review pass. Shared review reuse is limited to identical before/after files and owner context. These CI repairs add no counted product issue.
Maintainer landing disposition
The latest review’s required-check rank-up move is complete: exact-head CI passed. Root directly inspected installed Pi TUI0.84.2 components/markdown.js:529, terminal-image.js and utils.js:397/610 for authored href emission, capability routing and OSC8 close/reopen behavior. The previously recorded native-PTY proof and dependency inspection address the reviewer’s missing-source/DNS limitation. Production owners remain unchanged on main a0af72e, and its three-way merge is clean.