Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(task): bump usage for completions#10181

Merged
jdx merged 3 commits into
mainfrom
codex/fix-task-completion-usage
May 31, 2026
Merged

fix(task): bump usage for completions#10181
jdx merged 3 commits into
mainfrom
codex/fix-task-completion-usage

Conversation

@jdx

@jdx jdx commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • bump usage-lib from 3.3.0 to 3.4.0
  • lock the usage CLI tool to 3.4.0 for release/e2e platforms
  • update the task completion e2e expectation for usage-cli 3.4.0's candidate<TAB>description output

Why

The release workflow was failing in the Linux e2e completion shards after usage-cli changed 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_completion
  • git diff --check

Note

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-lib in Cargo.lock), the locked usage CLI in mise.lock, and shell integration so task/completion behavior matches the new CLI output.

completions/_mise now reads usage complete-word lines 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_completion and test_task_completion_global_cd expect each candidate as label<TAB>value instead 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

  • Tests
    • Updated end-to-end test expectations for completion output to a tab-separated duplicated format for filenames and task choices, including regression coverage for global directory flags.
  • New Features
    • Improved shell completions: completions now supply distinct display and insertion values and enable menu-style insertion when appropriate for quoted items.

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

Completion behavior and test updates

Layer / File(s) Summary
zsh completion: parse display/insert and enable insert menu
completions/_mise
Parse tab-separated display<TAB>insert pairs into completions and inserts arrays, set compstate[insert]=menu when inserts begin with a single quote, and call _describe with both arrays using -U -Q.
e2e tests: expect tab-separated duplicated completions
e2e/tasks/test_task_completion, e2e/tasks/test_task_completion_global_cd
Update assertions to expect tab-separated duplicated completion lines (e.g., mise.toml\tmise.toml, and alpha\talpha, beta\tbeta, gamma\tgamma) for mise usage and task/profile completion cases including -C . variants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibble on tabs and split the line,
Display and insert, two columns align.
Tests hop along — now they all agree,
Filenames doubled, neat as can be. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: bumping the usage library to fix task completion. It accurately reflects the PR's primary objective of updating dependencies and test expectations to match the new usage library behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-task-completion-usage

Comment @coderabbitai help to get the list of available commands and usage tips.

@jdx jdx marked this pull request as ready for review May 31, 2026 18:04
@jdx jdx changed the base branch from release to main May 31, 2026 18:05
@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR bumps usage-lib (the Rust library) and the usage CLI tool from 3.3.0 to 3.4.0, and updates all dependent artifacts to match the new tab-separated display<TAB>insert completion output format introduced in 3.4.0.

  • completions/_mise: Rewrites the zsh completion loop to parse tab-separated display/insert pairs, adds a needs_menu heuristic for quoted inserts, and switches to ${(Q)words[@]} when invoking usage complete-word.
  • e2e/tasks/test_task_completion & test_task_completion_global_cd: Updates all assert expectations from bare newline-separated candidates to candidate\tcandidate tab-separated form.
  • mise.usage.kdl: Regenerated — long_help strings reformatted from \n-escaped inline strings to KDL raw multiline blocks, reflecting usage-lib 3.4.0's spec serialization style.

Confidence Score: 5/5

Safe 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

Filename Overview
completions/_mise Rewrites zsh completion loop to consume tab-separated display/insert pairs from usage-cli 3.4.0; adds menu-mode insertion for quoted completions.
e2e/tasks/test_task_completion Updates assert expectations from newline-only candidates to tab-separated candidate/insert pairs matching usage-cli 3.4.0 output.
e2e/tasks/test_task_completion_global_cd Same e2e format update as test_task_completion; all three assert blocks updated to tab-separated format.
mise.lock Pins usage CLI to 3.4.0 across all platforms with updated URLs and checksums; consistent with library bump.
Cargo.lock Bumps usage-lib from 3.3.0 to 3.4.0 with updated checksum; mechanical lock update.
mise.usage.kdl Reformats long_help strings from escaped-newline style to KDL raw-string blocks; purely cosmetic, reflects usage-lib 3.4.0 spec generation output.

Reviews (3): Last reviewed commit: "fix(task): update generated usage comple..." | Re-trigger Greptile

@github-actions

github-actions Bot commented May 31, 2026

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

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%

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a8493a8 and a6b8dba.

📒 Files selected for processing (3)
  • completions/_mise
  • e2e/tasks/test_task_completion_global_cd
  • mise.usage.kdl

Comment thread completions/_mise
[[ "$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 ''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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:


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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant