Repository navigation
fix(completion): escape terminal controls in installation messages - #184120
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. What this changesThis PR sanitizes profile paths in installation messages and replaces control-containing reload hints with a shell-restart instruction. Example: Install Zsh completion with ZDOTDIR containing the literal characters /tmp/profiles followed by a newline and operator-forged.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current completion-output defect with a focused change; no actionable introduced bugs were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe completion installer resolves shell profiles, installs a cached-script hook through the atomic file publisher, and emits installation guidance. flowchart LR
A[Completion CLI] --> B[Completion installer]
C[Shell environment] --> B
B --> D[Atomic profile publisher]
B --> E[Terminal text policy]
E --> F[Installation messages]
Technical reviewBest possible solution: Merge the focused display-boundary repair while preserving literal paths, shell quoting, and atomic profile writes. Do we have a high-confidence way to reproduce the issue? Current-main source directly exposes control-containing profile paths to the terminal, and the recorded baseline regression fails at the unsafe reload message; no target code was run during this read-only review. Is this the best way to solve the issue? This is the smallest complete repair for the stated installation-message defect: reuse the established terminal policy at the output owner and avoid printing an altered, unusable reload command. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 927d0ebb1de9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +9, Tests +34, Docs +2. Total +45 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 26, 2026, 3:09 AM ET / 07:09 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…penclaw#184120) Sanitize completion installation status paths and suppress unsafe shell reload hints while preserving literal profile writes and ordinary shell commands. Validation: the regression fails on base and all 30 runtime tests plus 13 CLI consumer tests pass on the reviewed head. Targeted lint/format and exact-head CI pass. Co-authored-by: Alix-007 <[email protected]>
|
Thanks @steipete for merging this! Appreciate your time. |
…184120) Sanitize completion installation status paths and suppress unsafe shell reload hints while preserving literal profile writes and ordinary shell commands. Validation: the regression fails on base and all 30 runtime tests plus 13 CLI consumer tests pass on the reviewed head. Targeted lint/format and exact-head CI pass. Co-authored-by: Alix-007 <[email protected]> (cherry picked from commit c27715f) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit cc54b653a67c76c9c2c9c487cfcb881fc66a01e6)
What Problem This Solves
Fixes terminal actions and forged status lines when completion installation displays a profile path containing control characters.
User Impact
Install and reinstall messages display safe paths. If a reload hint contains terminal controls, the installer asks the user to restart the shell. Ordinary reload commands and literal profile/cache paths remain intact.
Why This Change Was Made
Use the existing terminal display policy at the installation-message owner, without changing path resolution, shell quoting, or atomic profile publication. Thanks to @Alix-007 for the fix and regression coverage.
Evidence
node scripts/run-vitest.mjs src/cli/completion-runtime.test.ts --maxWorkers=1: on unchanged main, the new regression fails at the unsafe reload-message assertion and the other 29 tests pass (6.62s wrapper wall time). With the patch, all 30 tests pass (7.52s).git diff --checkpass. The completion CLI consumer suite also passes all 13 tests (17.24s wrapper wall time).2eafd302cf4c026c6c43df957da197b26c2d39f3covers Bash/Zsh install/reinstall, safe output, literal profile writes and successful Bash completion registration.pnpm openclawruntime-publication guard could not verify an offline Gateway. No running Gateway or operator state changed.