Skip to content

fix(completions): require usage 3.5#10313

Merged
jdx merged 1 commit into
mainfrom
codex/bump-usage-3.5
Jun 11, 2026
Merged

fix(completions): require usage 3.5#10313
jdx merged 1 commit into
mainfrom
codex/bump-usage-3.5

Conversation

@jdx

@jdx jdx commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • bump the locked usage CLI tool from 3.4.0 to 3.5.0
  • update the generated mise usage spec minimum to require usage 3.5
  • bump usage-lib in Cargo.lock to 3.5.0

This picks up the zsh colon completion fixes from jdx/usage#666 and jdx/usage#670.

Tests

  • cargo metadata --format-version=1 --locked --no-deps
  • cargo run --locked -- usage >/tmp/mise.usage.generated && diff -u mise.usage.kdl /tmp/mise.usage.generated
  • cargo fmt --all --check
  • cargo check --locked -p mise --bin mise
  • ./target/debug/mise usage >/tmp/mise-usage-check.kdl && diff -u mise.usage.kdl /tmp/mise-usage-check.kdl
  • mise exec -- usage --version

Note

Low Risk
Dependency and completion-script updates only; no runtime behavior changes beyond shell tab completion and dev-tool pinning.

Overview
Bumps the usage toolchain to 3.5.0 (usage-lib in Cargo.lock, locked usage in mise.lock) and raises min_usage_version in the generated usage spec from 3.4 to 3.5 so older CLIs cannot silently hit broken zsh colon completion (jdx/usage#666, #670).

The generated zsh completion script completions/_mise now consumes three tab-separated fields from usage complete-word (value, description, insert), shows padded labels with -- descriptions, and uses compadd instead of _describe—aligned with usage 3.5’s completion output.

Reviewed by Cursor Bugbot for commit c96601b. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

Chores

  • Updated the minimum required version of the usage CLI tool to 3.5 to ensure full compatibility with current infrastructure requirements and latest improvements.
  • Improved zsh shell completion script with enhanced parsing of completion suggestion data, better formatting of display options, and more reliable presentation of available choices for zsh users.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Minimum usage CLI version requirement is bumped from 3.4 to 3.5 across configuration and Rust source, with zsh completion parsing refactored to extract and display tab-separated completion descriptions with improved alignment, replacing the prior _describe-based formatting.

Changes

Usage 3.5 update and zsh completion

Layer / File(s) Summary
Min usage version update to 3.5
mise.usage.kdl, src/cli/usage.rs
min_usage_version constant bumped from "3.4" to "3.5" in both the KDL spec and generated Rust source, with clarified comments referencing upstream zsh colon completion bug fixes from usage project.
Zsh completion parsing and description alignment
completions/_mise
Completion data now split into three parallel arrays (values, descs, inserts) with computed max-width padding for aligned description display, replacing the previous _describe-based two-column parse and feeding formatted strings with corresponding inserts directly to compadd.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • jdx/mise#10181: Adjusts zsh completions/_mise completion handling and aligns e2e test expectations to tab-separated completion output format.
  • jdx/mise#10176: Version bump to enforce usage 3.5 that enables completion workarounds depending on the same upstream usage fix.

Poem

A fluffy fox with shell in paw,
Refines completions without flaw,
Three columns dance, aligned just right,
Version bumped to version's height,
Zsh tab-completion shines so bright! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—requiring usage 3.5 for completions to work correctly with zsh colon completion fixes.
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.


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

@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR bumps the usage dependency floor from 3.4 to 3.5, picking up zsh colon completion fixes (jdx/usage#666 and #670). All version references — Cargo.lock, mise.lock, mise.usage.kdl, and src/cli/usage.rs — are updated consistently.

  • completions/_mise: The zsh completion handler is reworked to consume 3-column tab-separated output (value, description, insert) from usage 3.5, replacing the old _describe-based approach with a padded display array fed to compadd.
  • Lockfiles: usage-lib in Cargo.lock and the aqua usage binary in mise.lock are pinned to 3.5.0 with updated checksums for all eight platform variants.
  • Version guard: min_usage_version in mise.usage.kdl and the inline constant in src/cli/usage.rs both advance from "3.4" to "3.5" with updated comments.

Confidence Score: 5/5

Safe to merge — all changes are a coordinated version bump with no runtime logic changes beyond the completion script rewrite, which is straightforward and correct.

All five files are touched only to advance the usage version from 3.4 to 3.5. The completion script rewrite in completions/_mise correctly handles the new 3-column output format: the array indexing, padding arithmetic, and compadd call are all well-formed zsh. Checksums are updated for every platform in mise.lock, and the version guard in both the KDL spec and the Rust source are in sync.

No files require special attention.

Important Files Changed

Filename Overview
completions/_mise Rewrites zsh completion handler to consume 3-column (value/desc/insert) output from usage 3.5, building a padded display array and using compadd instead of _describe.
mise.lock Updates usage CLI tool from 3.4.0 to 3.5.0 across all eight platform variants with new checksums and release URLs.
Cargo.lock Bumps usage-lib from 3.4.0 to 3.5.0 with updated checksum; mechanical lockfile change.
mise.usage.kdl Updates min_usage_version from "3.4" to "3.5" to match the new dependency floor.
src/cli/usage.rs Updates comment and min_version constant from 3.4 to 3.5 with references to the zsh colon completion fixes.

Reviews (2): Last reviewed commit: "fix(completions): require usage 3.5" | Re-trigger Greptile

@jdx jdx marked this pull request as ready for review June 11, 2026 19:09
@jdx jdx enabled auto-merge (squash) June 11, 2026 19:13
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.2 x -- echo 19.4 ± 0.7 17.9 23.1 1.00
mise x -- echo 20.5 ± 1.6 18.5 41.9 1.06 ± 0.09

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.2 env 19.4 ± 0.9 17.5 24.4 1.00
mise env 21.2 ± 1.1 18.9 26.7 1.09 ± 0.08

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.2 hook-env 20.2 ± 1.1 18.1 26.9 1.00
mise hook-env 20.6 ± 1.5 18.3 26.7 1.02 ± 0.09

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.2 ls 15.7 ± 0.8 14.2 19.0 1.00
mise ls 15.9 ± 0.7 14.6 19.8 1.01 ± 0.07

xtasks/test/perf

Command mise-2026.6.2 mise Variance
install (cached) 135ms 135ms +0%
ls (cached) 58ms 59ms -1%
bin-paths (cached) 62ms 65ms -4%
task-ls (cached) 127ms 126ms +0%

@jdx jdx force-pushed the codex/bump-usage-3.5 branch from 09f6325 to c96601b Compare June 11, 2026 19:29

@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`:
- Around line 34-37: The parser currently assumes 3 fields and unconditionally
does values+=("${parts[1]}"), descs+=("${parts[2]}"), inserts+=("${parts[3]}"),
which produces empty inserts for 2-column rows; change the logic around parts to
detect when parts[3] is empty and parts[2] exists, and in that case treat
parts[2] as the insert (i.e. append parts[2] to inserts and append an empty
string to descs), otherwise keep the current mapping; also ensure you only
append non-empty inserts to avoid compadd -a inserts receiving empty entries and
keep the needs_menu check using the actual insert value (the variable inserts /
the element that was appended).
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c8b61df-a448-46b9-8ced-7d802c8415d3

📥 Commits

Reviewing files that changed from the base of the PR and between 09f6325 and c96601b.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • mise.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • completions/_mise
  • mise.usage.kdl
  • src/cli/usage.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/cli/usage.rs
  • mise.usage.kdl

Comment thread completions/_mise
Comment on lines +34 to +37
values+=("${parts[1]}")
descs+=("${parts[2]}")
inserts+=("${parts[3]}")
[[ "${parts[3]}" == "'"* ]] && needs_menu=1

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 | 🟠 Major | ⚡ Quick win

Handle 2-column completion rows before calling compadd -a inserts.

This parser assumes 3 fields, but the provided completion examples are 2-field tab rows (value<TAB>insert). In that case, parts[3] is empty, inserts becomes empty entries, and compadd -a inserts can stop inserting the actual token.

Suggested fix
   while IFS= read -r line; do
     local -a parts=("${(`@ps`:\t:)line}")
-    values+=("${parts[1]}")
-    descs+=("${parts[2]}")
-    inserts+=("${parts[3]}")
-    [[ "${parts[3]}" == "'"* ]] && needs_menu=1
+    local _value="${parts[1]}"
+    local _desc=""
+    local _insert=""
+
+    if (( ${`#parts`[@]} >= 3 )); then
+      _desc="${parts[2]}"
+      _insert="${parts[3]}"
+    elif (( ${`#parts`[@]} == 2 )); then
+      _insert="${parts[2]}"
+    else
+      _insert="${parts[1]}"
+    fi
+
+    values+=("${_value}")
+    descs+=("${_desc}")
+    inserts+=("${_insert}")
+    [[ "${_insert}" == "'"* ]] && needs_menu=1
   done < <(command usage complete-word --shell zsh -f "$spec_file" -- "${(Q)words[@]}")

As per coding guidelines, this is based on the provided runtime evidence snippet showing 2-field completion rows in e2e/tasks/test_task_completion_global_cd:13-48.

Also applies to: 40-55

🤖 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` around lines 34 - 37, The parser currently assumes 3
fields and unconditionally does values+=("${parts[1]}"), descs+=("${parts[2]}"),
inserts+=("${parts[3]}"), which produces empty inserts for 2-column rows; change
the logic around parts to detect when parts[3] is empty and parts[2] exists, and
in that case treat parts[2] as the insert (i.e. append parts[2] to inserts and
append an empty string to descs), otherwise keep the current mapping; also
ensure you only append non-empty inserts to avoid compadd -a inserts receiving
empty entries and keep the needs_menu check using the actual insert value (the
variable inserts / the element that was appended).

@jdx jdx merged commit 73edf8d into main Jun 11, 2026
48 of 50 checks passed
@jdx jdx deleted the codex/bump-usage-3.5 branch June 11, 2026 20:25
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