fix(terminal-core): tighten docs link URL detection#96439
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 25, 2026, 5:18 PM ET / 21:18 UTC. Summary PR surface: Source +2, Tests +10. Total +12 across 2 files. Reproducibility: yes. Current Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the shared terminal-core helper fix after normal maintainer validation, keeping docs URL normalization centralized with its regression tests. Do we have a high-confidence way to reproduce the issue? Yes. Current Is this the best way to solve the issue? Yes. The shared terminal-core helper is the narrowest maintainable layer because SDK, CLI, and setup callers already route docs-link formatting through it, while caller-side fixes would duplicate URL policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 13ecca5408cb. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +10. Total +12 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
What Problem This Solves
formatDocsLink()usedtrimmed.startsWith("http")to decide whether a docs path was already an absolute URL. That creates two bad edge cases:http-statusare treated as complete URLs and are not rooted athttps://docs.openclaw.aiHTTPS://example.com/pageare treated as relative docs pathsWhy This Change Was Made
The helper now uses a case-insensitive
https?://check. That keeps actual HTTP(S) URLs untouched while routing merely http-prefixed relative docs paths through the docs root.The regression tests cover both affected directions.
User Impact
Terminal docs links generated from relative paths that start with
httppoint to the OpenClaw docs site correctly, and already-absolute HTTP(S) URLs remain stable regardless of scheme casing.Evidence
Direct behavior probe:
Targeted test:
Formatting:
Whitespace:
AI-assisted
Prepared with Codex. I reviewed the change, understand the touched code path, and kept the PR focused on the bug described above.