Repository navigation
Conversation
Greptile SummaryThis PR fixes a missing positional argument completion in the generated zsh completion script. A new Confidence Score: 5/5Safe to merge; remaining findings are cosmetic P2 issues that don't affect correct completion behaviour for realistic descriptions. The bug fix logic is correct, tests cover the three main scenarios, and the change is well-scoped. Both open findings are P2: one is a single-quote escaping mismatch that only manifests when a CLI arg description literally contains a single quote (very rare), and the other is a trivial regex redundancy. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/cli/completion-cli.ts
Line: 224-229
Comment:
**Single-quote escaping wrong for double-quoted zsh context**
`escapeZshLabel` applies the `'\''` pattern (which is for exiting and re-entering single-quoted shell strings) but the output is always embedded inside a double-quoted zsh spec like `"1:label:action"`. Inside zsh `"..."`, a single quote is already a literal character — no escaping is needed. As a result, a description like `"don't use this"` would produce `"1:don'\''t use this:_files"`, and zsh would display the label as `don\''t use this` rather than `don't use this`.
The fix is to simply not escape single quotes here (they're harmless inside double-quoted strings):
```suggestion
function escapeZshLabel(value: string): string {
return value
.replace(/\\/g, "\\\\")
.replace(/"/g, '\\"')
.replace(/:/g, "\\:")
.replace(/\[/g, "\\[")
.replace(/\]/g, "\\]");
}
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/cli/completion-cli.ts
Line: 209
Comment:
**Redundant `files` in `FILE_ARG_HINT` alternation**
`file` followed by the `s?` quantifier already matches `files`, so listing `files` explicitly in the alternation is redundant. Consider removing it to keep the regex concise:
```suggestion
const FILE_ARG_HINT = /(^|[_-])(path|file|source|target|src|dest|destination)s?($|[_-])/i;
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "CLI: complete positional args in zsh com..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fede4549a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Thanks for the review — pushed
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a971ee3b3d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Related work from PRtags group Title: Open PR duplicate: [Bug]: zsh completion for openclaw wiki ingest does not complete file paths
|
a971ee3 to
65e847b
Compare
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #69305 |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open. Current main still omits zsh positional specs for leaf commands, and this PR remains the canonical fix path for the linked zsh completion bug, but the branch is not merge-ready because the new positional-label path still leaves shell substitution characters active, the branch is conflicting, it lacks real zsh proof, and it edits release-owned Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection rather than a live zsh run: current main's leaf zsh template only emits option specs, while Is this the best way to solve the issue? Mostly yes on owner boundary: the generic zsh completion generator is the right place, not a memory-wiki workaround. The current branch is not the best mergeable form until it hardens label escaping, drops the changelog edit, refreshes conflicts, and adds live zsh proof. Security review: Security review needs attention: The new positional zsh label path emits sourced shell-code strings without escaping shell substitution characters.
AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 9caf4e1ae9c4. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
Regression Test Plan (if applicable)
User-visible / Behavior Changes
`openclaw completion --shell zsh` now emits positional argument specs for every leaf command. After sourcing the generated script, `` on `openclaw wiki ingest`, `openclaw wiki doctor` (etc.) completes filesystem paths just like any other zsh file argument. No other shells are touched.
Diagram (if applicable)
```text
Before:
openclaw wiki ingest T -> terminal bell, no completion
After:
openclaw wiki ingest T -> Tone.md Topic.md ... (zsh _files)
```
Security Impact (required)
Repro + Verification
Environment
Steps
Expected
Actual (before this change)
Evidence
New unit tests (3 scenarios: file hint, dir hint, variadic) fail on `main`, pass on this branch. Local commands run:
```
pnpm test src/cli/completion-cli.test.ts
7 passed (4 pre-existing + 3 new)
pnpm lint src/cli/completion-cli.ts src/cli/completion-cli.test.ts
0 warnings, 0 errors
pnpm tsgo && pnpm tsgo:core:test
clean
```
Manual inspection of the generated script for a `wiki ingest` command produces exactly the shape the issue reporter asked for:
```
_openclaw_wiki_ingest() {
_arguments -C \
"--title[Title]" \
"--json[JSON]" \
"1:Local file path to ingest:_files"
}
```
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations
This PR is AI-assisted (Claude). Degree of testing: fully tested via new unit tests plus scoped `pnpm lint` / `pnpm tsgo` / `pnpm tsgo:core:test`. I read the generated output end-to-end and verified it matches the shape the issue reporter requested.