Skip to content

fix(task): put a locked task tool's install dir on the task's PATH - #15958

Merged
jdx merged 1 commit into
mainfrom
claude/mise-issue-15957-97aee7
Nov 21, 2026
Merged

jdx merged 1 commit into
mainfrom
claude/mise-issue-15957-97aee7

Conversation

@jdx

@jdx jdx commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

A tool pinned in a task's tools and locked with mise lock was installed but missing from the task's PATH on a machine that had never run the task before the lockfile existed.

[tasks.where]
tools = { "npm:prettier" = "3.6.2" }
run = "command -v prettier || echo 'prettier: not found'"

After mise lock and with an empty data directory, mise run where installed prettier under installs/npm-prettier/3.6.2~aube~<digest> but printed prettier: not found. If another copy of the command was on PATH, the task ran that copy and reported no error, so the pin decided nothing. The same pin under [tools] worked.

Now mise run where prints …/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 through load_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 plain 3.6.2 directory, 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@1 from borrowing a stale pin from an unrelated config. A task's own tools are declared by the task, so ToolsetBuilder::with_task_tool_args keeps the default lockfile scope for them, matching what the install step uses. mise x is unchanged.

Testing

  • New e2e tasks/test_task_tools_locked_npm follows the report: lock, wipe the installs, run the task. It fails (status 127) without the fix and passes with it.
  • Extended the runtime_args_without_config_do_not_borrow_stale_pins unit test.
  • cargo clippy -p mise --all-targets gives no warnings in the changed files. -D warnings fails on an existing lint in crates/mise-ui, which also fails on origin/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 x behavior 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 (with mise lock) used the lockfile's dependency-graph identity (…~aube~…), but mise run built 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 from PATH. ToolsetBuilder::with_task_tool_args() marks task/mise run --tool arguments so those pins use the default lockfile lookup (while ad-hoc mise x still avoids borrowing unrelated pins). Task toolset construction in task_context_builder.rs now passes that flag on both monorepo and standard paths.

Coverage adds e2e tasks/test_task_tools_locked_npm (lock, wipe installs, assert semver resolves under node_modules/.bin with ~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

  • Bug Fixes
    • Task-defined tools now honor lockfile pins when resolving versions, including tools that are not otherwise declared in the project configuration.
    • Task-specific tool arguments are consistently applied when building toolsets, including for tasks with their own configuration hierarchy.

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
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Task tool arguments now enter both task toolset-building paths with task-tool mode enabled. In lockfile mode, unconfigured task arguments use the default lockfile scope. An end-to-end test checks that a locked npm CLI appears on the task PATH after installed tools are removed.

Changes: Task tool lockfile integration

Layer / File(s) Summary
Task tool lockfile scope
src/toolset/builder.rs
ToolsetBuilder adds task-tool mode. In lockfile mode, task arguments without a supported configured request use the default scope; other argument scope handling remains unchanged. A unit test checks the lockfile source for a task argument.
Task toolset wiring and validation
src/task/task_context_builder.rs, e2e/tasks/test_task_tools_locked_npm
Both task toolset-building paths now include task-specific arguments. The end-to-end test locks npm:semver 7.6.0, removes installed tools, and checks that the task outputs a node_modules/.bin/semver path containing ~aube~.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: greptile-apps

Merge Risk: Minimal · up to bea13

The change addresses locked task tools missing from PATH after a fresh installation. No actionable merge-blocking regression is established; merge after normal checks pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix: a locked task tool's install directory is now placed on the task's PATH. The raw summary and objectives describe the same change: task tool arguments resolve against the lockf…
Linked Issues check Passed Issue #15957 requires a locked npm tool in a task's tools to be on the task's PATH after the install directory is removed, matching the [tools] behavior. The diff adds `ToolsetBuilder::with_task_t…
Out of Scope Changes check Passed All changed hunks relate to the linked issue. The with_task_tool_args() builder method, its call sites in task_context_builder.rs, the lockfile-scope branch in builder.rs, the unit test extension, a…
Full details: Title check

Explanation

The title names the fix: a locked task tool's install directory is now placed on the task's PATH. The raw summary and objectives describe the same change: task tool arguments resolve against the lockfile when a task runs, which keeps the install directory on PATH. The title uses the conventional fix(task) prefix and is specific enough for a teammate scanning history.

Full details: Linked Issues check

Explanation

Issue #15957 requires a locked npm tool in a task's tools to be on the task's PATH after the install directory is removed, matching the [tools] behavior. The diff adds ToolsetBuilder::with_task_tool_args() (src/toolset/builder.rs) and calls it in both toolset build paths in src/task/task_context_builder.rs (monorepo branch and standard branch). When set, an argument that no config lists uses LockfileScope::Default instead of LockfileScope::NoOwner, so the lockfile pin is read at run time, as the install step does. The unit test added to runtime_args_without_config_do_not_borrow_stale_pins asserts that a task-tool argument without config reads the argument-sourced lockfile pin. The PR description reports an e2e test (tasks/test_task_tools_locked_npm) that fails with status 127 before the fix and passes after it. I did not run the tests. The code change covers the reported defect.

Full details: Out of Scope Changes check

Explanation

All changed hunks relate to the linked issue. The with_task_tool_args() builder method, its call sites in task_context_builder.rs, the lockfile-scope branch in builder.rs, the unit test extension, and the e2e test all address the task-tool lockfile scope. The NoOwner scope for mise x and other non-task paths is unchanged, as the PR states. The builder doc comment also mentions mise run --tool, which passes through the same task tool args path, so that case follows from the same change. It is not a separate unrelated change.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 75f8576 and bea137c.

Files selected for processing: 3

  • e2e/tasks/test_task_tools_locked_npm
  • src/task/task_context_builder.rs
  • src/toolset/builder.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Task tools can now read their locked version and dependency graph when the task builds its PATH.

  • Tasks find their locked tools in the install directory on PATH.

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

@github-actions

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ███▇██▃▃▂▃▁ 36,144,859 → 35,986,771 -0.44% 21.84 → 21.65ms -0.88%
hook-env ▇▇█▇██▂▃▂▃▁ 38,114,734 → 37,960,568 -0.40% 22.94 → 22.47ms -2.06%
ls █▇█▇██▃▃▃▃▁ 40,901,391 → 40,698,262 -0.50% 24.29 → 24.21ms -0.33%
registry ███▇▇▇▃▃▃▃▁ 43,153,945 → 42,944,267 -0.49% 19.03 → 19.17ms +0.72%
startup █▇▇▇█▇▂▂▂▂▁ 12,559,874 → 12,486,625 -0.58% 13.51 → 13.02ms -3.61%

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.

bea137c57085 vs 9f3a312862ce · measured on the runner, not pushed to the history.

@jdx
jdx merged commit 0956e8e into main Nov 21, 2026
51 checks passed
@jdx
jdx deleted the claude/mise-issue-15957-97aee7 branch November 21, 2026 07:20
gabrielcosi pushed a commit to gabrielcosi/home-ops that referenced this pull request Nov 21, 2026
…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 [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15942](jdx/mise#15942)
- **(daemons)** export a project reference's port and URL under its own name by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15956](jdx/mise#15956)
- **(dotfiles)** default a dotfile group's root to its name by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15953](jdx/mise#15953)
- **(dotfiles)** let a dotfile group entry deploy outside the group's target by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15954](jdx/mise#15954)
- **(prune)** add --system and prune replaced system installs after upgrade by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15949](jdx/mise#15949)
- **(upgrade)** add a per-tool bump option to exclude a tool from --bump by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15947](jdx/mise#15947)

##### 🐛 Bug Fixes

- **(java)** resolve sdkman temurin hotfixes by their canonical version by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15928](jdx/mise#15928)
- **(lock)** refuse version upgrades that drop a platform in generate mode by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15939](jdx/mise#15939)
- **(lock)** skip platforms a tool has no build for in --check by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15941](jdx/mise#15941)
- **(lock)** record platforms a tool has no build for in mise.lock by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15952](jdx/mise#15952)
- **(secrets)** let tasks, including global ones, list keys from your own fnox config by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15937](jdx/mise#15937)
- **(task)** put a locked task tool's install dir on the task's PATH by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15958](jdx/mise#15958)

##### 📚 Documentation

- **(watch)** say that ::: tasks share one watcher by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;15938](jdx/mise#15938)

##### 📦️ Dependency Updates

- watch aube-workspace.yaml and workspace members' manifests by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;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
jdx added a commit that referenced this pull request Nov 21, 2026
… 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>
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.

A locked npm tool in a task's tools is installed but not put on the task's PATH

1 participant