Repository navigation
fix: avoid shortening home path substrings - #96398
lin-hongkuan wants to merge 2 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 8:41 AM ET / 12:41 UTC. Summary PR surface: Source +41, Tests +30. Total +71 across 2 files. Reproducibility: yes. at source level: current main and v2026.6.10 use unbounded home-token replacement, and renderTable applies that helper to table values. I did not run a local runtime repro because this review was read-only. 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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this focused terminal-core fix if maintainers accept the narrow scope, and keep the broader core helper repair tracked through #88449 or a refreshed replacement. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main and v2026.6.10 use unbounded home-token replacement, and renderTable applies that helper to table values. I did not run a local runtime repro because this review was read-only. Is this the best way to solve the issue? Yes for the PR's narrow terminal-core table/status surface: requiring a separator or end after the home token fixes the reported sibling-path rewrite while preserving diagnostic text such as path=\project. It is not a complete repository-wide cleanup because the core helper remains a separate overlapping repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae9474b5fdc0. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +41, Tests +30. Total +71 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
|
|
Closing this older non-issue-linked PR to keep the author open-PR count at the project-safe limit while replacing it with an issue-linked fix. The branch is left intact. |
What Problem This Solves
Fixes an issue where terminal table and status output could shorten paths that merely shared the same leading characters as the effective home directory. For example, when the effective home ended in
al, a sibling path ending inalicecould be displayed with the home marker even though it was outside the configured home.AI-assisted: yes. I reviewed the touched code and ran the focused validation below.
Why This Change Was Made
Home path display replacement now checks path-token boundaries before replacing the effective home with
~or$OPENCLAW_HOME. This keeps the existing shortening behavior for real home-contained paths while leaving sibling path names intact.User Impact
Users and operators get copyable terminal output that no longer rewrites unrelated sibling paths into misleading home-relative paths.
Evidence
node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts packages/terminal-core/src/display-string.test.ts packages/terminal-core/src/table.test.tsnode_modules\.bin\oxfmt.cmd --check packages/terminal-core/src/display-string.ts packages/terminal-core/src/display-string.test.tsgit diff --checkFollow-up Evidence After Review
The review correctly asked for concrete terminal behavior proof and tighter sibling-path coverage. I updated the after-boundary check so a home match is shortened only when it is followed by a path separator or the end of the string. This preserves embedded output such as
path=<home>\projectwhile leaving sibling names like<home>+logs,<home>@logs, and<home>:logsuntouched.Live proof from this branch:
Focused validation after the follow-up patch:
git diff --checkproduced no output.