fix(task): bump usage for completions#10181
Conversation
📝 WalkthroughWalkthroughThis PR updates zsh completion to emit display/insert pairs and updates end-to-end tests to expect tab-separated duplicated completion lines for task/profile and usage outputs. ChangesCompletion behavior and test updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR bumps
Confidence Score: 5/5Safe to merge — all changes are confined to a dependency version bump, its lock files, a generated spec file, and the e2e assertions that validate the new output format. The only logic change is in the zsh completion function, which correctly adapts to the new tab-separated output contract. Lock files pin the CLI version deterministically, and e2e tests are updated to match. No application logic, config parsing, or security-sensitive paths are touched. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fix(task): update generated usage comple..." | Re-trigger Greptile |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 x -- echo |
24.0 ± 0.7 | 22.4 | 27.2 | 1.00 |
mise x -- echo |
24.3 ± 0.8 | 22.3 | 27.2 | 1.01 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 env |
23.3 ± 1.5 | 21.7 | 40.8 | 1.00 |
mise env |
23.8 ± 0.7 | 22.1 | 28.8 | 1.02 ± 0.07 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 hook-env |
25.4 ± 0.6 | 24.0 | 31.7 | 1.01 ± 0.03 |
mise hook-env |
25.1 ± 0.6 | 23.6 | 29.9 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.16 ls |
21.9 ± 0.5 | 20.7 | 23.7 | 1.01 ± 0.03 |
mise ls |
21.7 ± 0.5 | 20.3 | 26.5 | 1.00 |
xtasks/test/perf
| Command | mise-2026.5.16 | mise | Variance |
|---|---|---|---|
| install (cached) | 172ms | 168ms | +2% |
| ls (cached) | 84ms | 82ms | +2% |
| bin-paths (cached) | 88ms | 86ms | +2% |
| task-ls (cached) | 159ms | 156ms | +1% |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@completions/_mise`:
- Line 38: The call to _describe 'completions' completions inserts -U -Q -S ''
is invalid because _describe expects a single array of match:description entries
rather than parallel display vs insert arrays; fix by merging the two arrays
into one match:description array (e.g., build a combined array where each
element is "$insert:$display" and pass that to _describe 'completions' combined
-U -Q -S ''), or alternatively replace the _describe call with compadd -d
"$completions" -- "$inserts" and apply the -U/-Q/-S options to compadd instead;
update the code that references the completions/display/inserts arrays
accordingly (symbols to locate: _describe, compadd, completions, inserts,
display).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8204b90d-93a6-4dde-a420-479f2787ca2e
📒 Files selected for processing (3)
completions/_misee2e/tasks/test_task_completion_global_cdmise.usage.kdl
| [[ "$insert" == "'"* ]] && needs_menu=1 | ||
| done < <(command usage complete-word --shell zsh -f "$spec_file" -- "${(Q)words[@]}") | ||
| (( needs_menu )) && compstate[insert]=menu | ||
| _describe 'completions' completions inserts -U -Q -S '' |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Zsh _describe function syntax with two arrays for display and matches
💡 Result:
The _describe function in Zsh is primarily designed to handle arrays where each element is a string formatted as 'match:description' [1][2][3]. It does not natively accept two separate arrays to map display values to completion matches in a single call [1][3]. To achieve the behavior of displaying a "nice" label (A) while inserting a different "actual" value (B), you should use the compadd built-in function instead of _describe, as _describe is specifically optimized for simple, single-string entries [1][3]. With compadd, you can use the -d flag to specify an array of display strings, while the positional arguments provide the actual values to be inserted: compadd -d display_array -- actual_values_array Example implementation: local -a actuals=('UUID1' 'UUID2') local -a displays=('Device One' 'Device Two') # The -- is used to separate options from the list of matches compadd -d displays -- "${actuals[@]}" If you must use _describe, you would need to pre-process your data into a single array where each element matches the 'value:description' format [1][3]. For example: local -a combined combined=('UUID1:Device One' 'UUID2:Device Two') _describe 'devices' combined Note that _describe is a utility function built on top of lower-level completion commands like compadd, meant for scenarios where simple word-description pairs are sufficient [1][4][3]. For more complex logic involving separated display and completion values, direct use of compadd is the standard, authoritative approach in the Zsh completion system [5].
Citations:
- 1: https://github.com/zsh-users/zsh-completions/blob/9dfd5c667072a9aef13a237fe3c3cc857ca9917f/zsh-completions-howto.org
- 2: https://stackoverflow.com/questions/17318913/make-zsh-complete-arguments-from-a-file
- 3: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
- 4: https://zsh.sourceforge.io/Doc/Release/Completion-System.html
- 5: https://stackoverflow.com/questions/61469785/zsh-autocompletion-display-value-a-use-value-b
Fix _describe usage: it can’t wire separate display vs insertion arrays as written.
completions/_mise (line 38) calls _describe 'completions' completions inserts -U -Q -S '', but _describe is meant for a single array of match:description entries (not parallel “display” and “insert” arrays). Build a combined match:description array (e.g., "$insert:$display") or switch to compadd -d "$completions" -- "$inserts" and apply the -U/-Q/-S options to compadd instead.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@completions/_mise` at line 38, The call to _describe 'completions'
completions inserts -U -Q -S '' is invalid because _describe expects a single
array of match:description entries rather than parallel display vs insert
arrays; fix by merging the two arrays into one match:description array (e.g.,
build a combined array where each element is "$insert:$display" and pass that to
_describe 'completions' combined -U -Q -S ''), or alternatively replace the
_describe call with compadd -d "$completions" -- "$inserts" and apply the
-U/-Q/-S options to compadd instead; update the code that references the
completions/display/inserts arrays accordingly (symbols to locate: _describe,
compadd, completions, inserts, display).
Summary
usage-libfrom 3.3.0 to 3.4.0usageCLI tool to 3.4.0 for release/e2e platformsusage-cli3.4.0'scandidate<TAB>descriptionoutputWhy
The release workflow was failing in the Linux e2e completion shards after
usage-clichanged completion output behavior. Keeping the generated spec library and CLI lock in sync makes the task completion path deterministic again.Validation
mise run test:e2e e2e/tasks/test_task_completiongit diff --checkNote
Low Risk
Dependency pin and shell/e2e alignment for completion output only; no auth, data, or core runtime logic changes.
Overview
Aligns usage 3.4.0 across the Rust dependency (
usage-libinCargo.lock), the lockedusageCLI inmise.lock, and shell integration so task/completion behavior matches the new CLI output.completions/_misenow readsusage complete-wordlines as display and insert pairs (tab-separated), passes quote-stripped words via${(Q)words[@]}, and enables menu completion when inserts are quoted—so zsh completion stays correct with the new format.E2E tests in
e2e/tasks/test_task_completionandtest_task_completion_global_cdexpect each candidate aslabel<TAB>valueinstead of one value per line, fixing release CI failures on Linux completion shards.Reviewed by Cursor Bugbot for commit a6b8dba. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit