Repository navigation
fix(cli): honor shell-owned completion profile locations - #117002
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 6:37 PM ET / 22:37 UTC. ClawSweeper reviewWhat this changesThe PR centralizes shell-completion profile discovery and reload hints so installation, setup, and Doctor honor shell-owned Zsh, Fish, Bash, and PowerShell locations and quote reload commands safely. Merge readinessThe PR addresses a source-proven completion-profile mismatch and now includes credible exact-head terminal proof. Keep it open for the protected maintainer review and completed merge-result checks; this sandbox could not retrieve the complete PR objects for an independent full-diff pass because its promisor fetch could not resolve GitHub. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw writes generated completion scripts into each shell's startup profile, then its setup wizard and Doctor tell operators how to reload that profile. The resolver feeds installation and status checks, while the user-facing guidance follows afterward. flowchart LR
A[Shell environment] --> B[Profile resolver]
B --> C[Completion installer]
B --> D[Installed-state check]
C --> E[Setup wizard guidance]
D --> F[Doctor repair guidance]
E --> G[Operator reload command]
F --> G
Decision needed
Why: The protected Before merge
Agent review detailsSecurityNone. PR surfaceSource -3, Tests +362. Total +359 across 7 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use one canonical profile resolver and display hint, then merge only after exact-head review confirms default and shell-owned profile behavior remains compatible across Bash, Zsh, Fish, and PowerShell. Do we have a high-confidence way to reproduce the issue? Yes. Current source shows that the profile resolver omits Is this the best way to solve the issue? Yes, provisionally. Reusing one canonical resolver and display hint repairs the owner boundary instead of compensating in the wizard or Doctor, but the full branch still needs an exact merge-result review. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 61fb29e90a59. LabelsLabel changes:
Label 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 (3 earlier review cycles)
|
|
Merged via squash.
|
…7002) * fix(cli): honor shell-owned completion profile locations * test(cli): isolate completion profiles across platforms * fix(wizard): reuse canonical completion profile hints --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Two operator-visible root causes affected shell-completion installation and recovery:
$ZDOTDIR, Fish$XDG_CONFIG_HOME, Bash, or PowerShell. The wizard could install completion into the correct custom profile and immediately instruct the operator to reload a different file.Why This Change Was Made
$ZDOTDIR, shell-owned relative directories, and filesystem symlink-before-..traversal.$XDG_CONFIG_HOMEvalues verbatim, including meaningful whitespace; ignore invalid relative values as required by the XDG Base Directory Specification.~/expansion, existing localized onboarding text, Bash profile selection, and PowerShell dot sourcing.User Impact
Completion is written into the file the actual shell reads. Direct installation, onboarding, and Doctor all display an executable reload command for that same file. No CLI flags, configuration keys, migrations, storage, or security behavior are added.
Inspectable Real-Behavior Proof
Exact tested head:
0048d0527156fd4161028b91dde50910ab0b5437.The following is redacted output captured from the actual production onboarding function, production completion installer, production Doctor repair, and a real interactive
/bin/zshprocess. The run used temporaryHOME,USERPROFILE, state, and profile directories; all temporary state was removed. Completion caches were prewritten and verified instead of invoking the unrelated cache-generation subprocess.The Fish installer, startup-profile contents, onboarding output, and Doctor repair were exercised directly; a native Fish shell executable was not available, so native Fish execution is not claimed.
Focused Verification
ENOENT: the same 92 CLI tests passed; Bash execution remains mandatory.!...traversal for Zsh, Bash, Fish, and PowerShell; explicit empty$ZDOTDIR; valid whitespace-bearing XDG roots; rejected relative XDG roots; Windows drive and UNC paths; literal relative Zsh roots; and consistent direct-install reload output.--max-priority P3review: zero findings; patch correct; confidence 0.92; real TruffleHog clean.ClawSweeper Rank-Up Moves
Explicit Exclusions
No public CLI/setup flags, configuration or environment-variable surface, persisted state, SQLite/schema, authentication/security policy, plugin SDK, Gateway protocol, dependency, locale-catalog, or release-note changes.