Repository navigation
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: blocked before merge. Reviewed September 7, 2026, 3:11 PM ET / 19:11 UTC. ClawSweeper reviewWhat this changesThe Control UI gives standalone HTTP(S) URLs written in backticks the existing link presentation, with matching styles, documentation, and regression coverage. Merge readiness⛔ Blocked before merge - 3 items remain The PR remains useful: current main still excludes standalone code spans from link classification. No actionable correctness defect was found, and the maintainer-authored work is protected from cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI turns chat Markdown into sanitized HTML. Its link classifier adds compact GitHub labels and favicon placeholders, while existing navigation and hover-card handlers consume the resulting anchors. flowchart LR
A[Chat Markdown] --> B[Markdown tokens]
B --> C{Standalone web URL in code?}
C -->|Yes| D[Existing link classification]
C -->|No| E[Preserve ordinary code and session handling]
D --> F[Sanitized HTML]
E --> F
F --> G[Styled links and hover cards]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +38, Tests +87, Docs 0. Total +125 across 5 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one link-classification flow for standalone URLs while preserving authored destinations, session navigation, and ordinary code content. Do we have a high-confidence way to reproduce the issue? Not applicable as a broken-contract bug: existing documentation explicitly excluded code spans; this PR extends their presentation. The old rendering path is clear from current-main source. Is this the best way to solve the issue? Yes. Reusing the classifier and retaining the session-link exception is a narrow approach that avoids a competing renderer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 749ea74bbbe6. 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
History |
Chat URLs written in backticks rendered as plain code spans because inline code never reached the web-link classifier. Route code spans containing one absolute HTTP(S) URL through the existing link presentation, preserving session-link ownership and ordinary code content. Match the surrounding chip typography and document the behavior with focused parser and browser coverage.
The inline URL chip change unnecessarily changed the ordinary-code selector, breaking the contrast check that reads its tokens. Keep that selector intact and let the more specific link rule remove the inner code box. Contrast and Chromium presentation tests verify both behaviors together.
07f99cf to
48089b9
Compare
|
Superseded by #141446, which landed the same backtick-URL promotion for The one behavior this branch had beyond #141446 was promoting non-GitHub backtick URLs to favicon links while deferring session URLs to the session-link rule. #141446 deliberately keeps non-GitHub code spans as code, so that stays a separate product decision. |
What Problem This Solves
Fixes an issue where a URL written in backticks in a chat message, such as
`https://github.com/openclaw/openclaw/pull/141131`, rendered as a plain monospace code span with the full URL. The same URL written bare shows the compact GitHub chip with an icon, a shortened label, and the hover card. Models frequently wrap URLs in backticks, so the chips were missing exactly where they were most useful.Why This Change Was Made
markdown-it never linkifies inside
code_inline, and the Control UI's link classifier only walkslink_opentokens, so a backtick-wrapped URL never reached the chip logic. A code span whose entire content is a single absolute HTTP(S) URL is now wrapped in a link inside that same classifier and revisited by it, so GitHub issue and pull-request links get the#numberchip and hover card, other GitHub links get the shortened label, and non-GitHub links get their favicon. Session URLs written in backticks are left for the session-link rule that already owns them, and fenced or indented code blocks are untouched. Classification wins over authoring syntax: the inner<code>drops its box and inherits the link typography so the result is indistinguishable from a bare URL.User Impact
Backtick-wrapped GitHub issue and PR URLs in chat now show the same compact chip, icon, tooltip, and hover card as bare URLs. Other backtick URLs become normal links with a favicon. Code spans containing anything besides a single URL, and all code blocks, render exactly as before.
Evidence
Before and after, light theme (synthetic fixtures):
node scripts/run-vitest.mjs ui/src/components/markdown-links.test.ts ui/src/components/markdown.test.ts ui/src/components/github-link-hovercard.test.ts: 3 files, 278 tests passed. The five new inline-code cases failed before the parser change (expected anchor absent) and pass after.ui/src/styles/chat-github-link-presentation.browser.test.ts(Chromium): 5 tests passed, including inherited typography, no inner code box, and identical geometry to the bare-URL chip in light and dark.pnpm check:changed: passed.Known Gaps
Hover-card fetches were verified against the rendered anchors, not a live Gateway round trip; the hover card keys on
href, which is unchanged in shape.