Repository navigation
fix(task): put a locked task tool's install dir on the task's PATH - #15958
Conversation
A tool in a task's `tools` was installed from the lockfile, including its dependency graph identity (`3.6.2~aube~<digest>`), but the task ran with the tool resolved without the lockfile. It then looked for the unsuffixed install dir, which a fresh machine does not have, so the tool was missing from PATH. Resolve task tool args against the lockfile when running, as installing does. Fixes #15957 Co-authored-by: hajikelu <139537890+hajikelu@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> AI-Assisted: Tool: Claude Code; model: unavailable; version: 2.1.328 Entire-Checkpoint: 01M7YCM9SSGY0AZT3FMAPYEX9S
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
[Medium impact] The PR appears safe to merge. SummaryTask tools can now read their locked version and dependency graph when the task builds its
No actionable issues found. Verification was limited to source review; tests were not run. Reviews (1) · Last reviewed commit: "fix(task): put a locked task tool's inst..." · Reviewed by Greptile |
Instruction counts
No instruction-count regression above 1%. Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.
|
…2) (#1869) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/jdx/mise](https://github.com/jdx/mise) | patch | `2026.11.11` → `2026.11.12` | --- ### Release Notes <details> <summary>jdx/mise (ghcr.io/jdx/mise)</summary> ### [`v2026.11.12`](https://github.com/jdx/mise/blob/HEAD/CHANGELOG.md#20261112---2026-11-21) [Compare Source](jdx/mise@v2026.11.11...v2026.11.12) ##### 🚀 Features - **(audit)** add `mise audit` and `mise upgrade --vulnerable` by [@​jdx](https://github.com/jdx) in [#​15942](jdx/mise#15942) - **(daemons)** export a project reference's port and URL under its own name by [@​jdx](https://github.com/jdx) in [#​15956](jdx/mise#15956) - **(dotfiles)** default a dotfile group's root to its name by [@​jdx](https://github.com/jdx) in [#​15953](jdx/mise#15953) - **(dotfiles)** let a dotfile group entry deploy outside the group's target by [@​jdx](https://github.com/jdx) in [#​15954](jdx/mise#15954) - **(prune)** add --system and prune replaced system installs after upgrade by [@​jdx](https://github.com/jdx) in [#​15949](jdx/mise#15949) - **(upgrade)** add a per-tool bump option to exclude a tool from --bump by [@​jdx](https://github.com/jdx) in [#​15947](jdx/mise#15947) ##### 🐛 Bug Fixes - **(java)** resolve sdkman temurin hotfixes by their canonical version by [@​jdx](https://github.com/jdx) in [#​15928](jdx/mise#15928) - **(lock)** refuse version upgrades that drop a platform in generate mode by [@​jdx](https://github.com/jdx) in [#​15939](jdx/mise#15939) - **(lock)** skip platforms a tool has no build for in --check by [@​jdx](https://github.com/jdx) in [#​15941](jdx/mise#15941) - **(lock)** record platforms a tool has no build for in mise.lock by [@​jdx](https://github.com/jdx) in [#​15952](jdx/mise#15952) - **(secrets)** let tasks, including global ones, list keys from your own fnox config by [@​jdx](https://github.com/jdx) in [#​15937](jdx/mise#15937) - **(task)** put a locked task tool's install dir on the task's PATH by [@​jdx](https://github.com/jdx) in [#​15958](jdx/mise#15958) ##### 📚 Documentation - **(watch)** say that ::: tasks share one watcher by [@​jdx](https://github.com/jdx) in [#​15938](jdx/mise#15938) ##### 📦️ Dependency Updates - watch aube-workspace.yaml and workspace members' manifests by [@​jdx](https://github.com/jdx) in [#​15940](jdx/mise#15940) ##### 📦 Aqua Registry Updates ##### New Packages (1) - [`ynqa/vy`](https://github.com/ynqa/vy) </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/Berlin) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Operator](https://github.com/mogenius/renovate-operator). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.xcd.dev/gabrielcosi/home-ops/pulls/1869
… lists the tool (#15969) With `--locked` (or `MISE_LOCKED=1`), a task whose `tools` pins a tool was run without that tool on its `PATH` whenever a parent or global config listed the same tool at another version. The task still exited 0, so the pin decided nothing. ```toml # mise.toml [tools] jq = "1.6" # child/mise.toml [tasks.where] tools = { jq = "1.7.1" } run = "jq --version" ``` After `mise lock` in both directories, `MISE_LOCKED=1 mise run where` from `child/` warned `jq@1.7.1 is not in the lockfile` and ran a different `jq` (or none). Now it prints `jq-1.7.1`, the same as without `--locked`. ## Cause `load_runtime_args` gives a runtime argument the lockfile of the config that already lists the tool. For a task's `tools` that was the parent's `mise.lock`, which records `1.6` and not `1.7.1`; the pin in `child/mise.lock` was never read. #15958 fixed the case where no config lists the tool; this is the case where one does. ## Fix A task declares its own tools, so task tool arguments (`with_task_tool_args`) now always use the default lockfile lookup. `mise x tool@1` is unchanged and keeps the owner scope. ## Testing - New e2e `tasks/test_task_tools_locked_parent` fails without the fix (`jq@1.7.1 is not in the lockfile`) and passes with it. - Extended the `runtime_args_without_config_do_not_borrow_stale_pins` unit test. - `cargo clippy -p mise --all-targets -- -D warnings` fails only on an existing lint in `crates/mise-ui`, which also fails on `origin/main`. Fixes #15965 *AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.* 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes lockfile scope for task tool resolution, which affects PATH and version selection under `--locked`, but is narrowly scoped to task-declared tools with new tests. > > **Overview** > Fixes **locked-mode task runs** picking the wrong tool version when a parent `mise.toml` lists the same tool at a different version than the task’s own `tools` block. > > **`ToolsetBuilder`** now accepts **`with_task_tool_lockfile_owner`**, pointing lockfile resolution at the config that declares the task. For tools the task actually declares, pinned versions are read from **that** config’s `mise.lock` (including monorepo subprojects), not from a parent’s lockfile. CLI **`mise run --tool`** overrides keep the prior lookup behavior. > > **`task_context_builder`** passes the task config source and declared tool args when building the task toolset. > > Adds e2e **`test_task_tools_locked_parent`** and extends unit tests for parent conflicts, monorepo owners, and `--tool` edge cases. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 31637d6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Task tools now use versions pinned in the task’s configuration, even when a parent configuration lists a different version. This also applies when running tasks in locked mode; other tools continue to follow their existing version-selection behavior. * **Tests** * Added end-to-end coverage verifying that tasks use the child configuration’s pinned tool version in normal and locked-mode runs, despite a conflicting version in the parent configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
A tool pinned in a task's
toolsand locked withmise lockwas installed but missing from the task'sPATHon a machine that had never run the task before the lockfile existed.After
mise lockand with an empty data directory,mise run whereinstalledprettierunderinstalls/npm-prettier/3.6.2~aube~<digest>but printedprettier: not found. If another copy of the command was onPATH, the task ran that copy and reported no error, so the pin decided nothing. The same pin under[tools]worked.Now
mise run whereprints…/3.6.2~aube~<digest>/node_modules/.bin/prettier, the same as the[tools]form.Cause
Installing a task's tools read the lockfile, so the tool resolved with its dependency graph and installed under the
~aube~<digest>directory. Running the task built its toolset throughload_runtime_args, which gives an argument no config lists a "no owner" lockfile scope, so no lock entry was read. The tool resolved to the plain3.6.2directory, which doesn't exist on a fresh machine, and its bin path was never added. A tool listed in[tools]has an owning config, which is why that case worked.The "no owner" scope is meant to stop
mise x tool@1from borrowing a stale pin from an unrelated config. A task's owntoolsare declared by the task, soToolsetBuilder::with_task_tool_argskeeps the default lockfile scope for them, matching what the install step uses.mise xis unchanged.Testing
tasks/test_task_tools_locked_npmfollows the report: lock, wipe the installs, run the task. It fails (status 127) without the fix and passes with it.runtime_args_without_config_do_not_borrow_stale_pinsunit test.cargo clippy -p mise --all-targetsgives no warnings in the changed files.-D warningsfails on an existing lint incrates/mise-ui, which also fails onorigin/main.Fixes #15957
AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.328.
🤖 Generated with Claude Code
Note
Medium Risk
Changes lockfile scope only for task-declared tools at run time, which affects PATH/install resolution for locked npm-style graphs;
mise xbehavior is intentionally unchanged.Overview
Locked task tools now resolve from the same lockfile-backed install path when a task runs as when their dependencies are installed.
Previously, installing a tool declared only under a task's
tools(withmise lock) used the lockfile's dependency-graph identity (…~aube~…), butmise runbuilt the task toolset with a no-owner lockfile scope, so the runtime pointed at the plain version directory that did not exist on a fresh machine and the binary was missing fromPATH.ToolsetBuilder::with_task_tool_args()marks task/mise run --toolarguments so those pins use the default lockfile lookup (while ad-hocmise xstill avoids borrowing unrelated pins). Task toolset construction intask_context_builder.rsnow passes that flag on both monorepo and standard paths.Coverage adds e2e
tasks/test_task_tools_locked_npm(lock, wipe installs, assertsemverresolves undernode_modules/.binwith~aube~) and extends the existing runtime-args lockfile unit test.Reviewed by Cursor Bugbot for commit bea137c. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit