fix(tasks): restore tool loading from idiomatic version files#6559
Merged
Conversation
Fixes regression where tasks were unable to access tools from idiomatic version files (e.g., .node-version) when idiomatic_version_file_enable_tools was configured. The issue was introduced in the monorepo task support where tasks would only use tools from their defining config file instead of all config files in the hierarchy. This change ensures: 1. Non-monorepo tasks use the standard toolset build that includes ALL config files (including idiomatic version files) 2. Monorepo tasks (those with task.cf set) continue to use their specific config file context as intended The fix checks task.cf.is_some() to determine if a task is truly a monorepo task before using monorepo-specific toolset building logic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a regression introduced in v2025.10.3 where tasks could no longer access tools from idiomatic version files (like .node-version) when idiomatic_version_file_enable_tools was configured. The issue occurred because the monorepo task logic was incorrectly applied to all tasks with a config source, not just actual monorepo tasks.
- Modified the toolset building logic to distinguish between monorepo tasks and regular tasks
- Added proper condition check to only apply monorepo-specific toolset building for actual monorepo tasks
- Added comprehensive e2e test to verify tasks can use tools from idiomatic version files
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/cli/run.rs | Updated build_toolset_for_task() to only use task-specific config context for actual monorepo tasks by checking both task_cf.is_some() and task.cf.is_some() |
| e2e/tasks/test_task_idiomatic_version_file | Added new e2e test that verifies tasks can access tools from .node-version files with idiomatic_version_file_enable_tools enabled |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fixes issue where monorepo subdirectory tasks were not inheriting tools from parent config files, only using tools defined in their own config. The previous implementation only used `task_cf.to_toolset()` which returns tools from a single config file. This meant that if a subdirectory's mise.toml didn't define any tools, the task would have no tools available, even if parent configs defined them. The fix: 1. Build a base toolset from all global config files (which includes parent configs in the monorepo hierarchy) 2. Merge the subdirectory's config file tools on top, allowing subdirectories to override parent tools This ensures proper tool inheritance while still allowing subdirectories to override specific tool versions as needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixes clippy::unnecessary_unwrap warning by using if let pattern matching instead of checking is_some() and then calling unwrap(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.10.3 x -- echo |
22.0 ± 0.3 | 21.4 | 25.3 | 1.00 |
mise x -- echo |
22.0 ± 0.2 | 21.5 | 23.4 | 1.00 ± 0.02 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.10.3 env |
21.1 ± 0.6 | 20.6 | 27.1 | 1.00 |
mise env |
21.2 ± 0.2 | 20.8 | 22.4 | 1.00 ± 0.03 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.10.3 hook-env |
20.7 ± 0.3 | 20.3 | 24.3 | 1.00 |
mise hook-env |
21.0 ± 0.9 | 20.4 | 30.5 | 1.01 ± 0.05 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.10.3 ls |
18.2 ± 0.2 | 17.8 | 20.6 | 1.00 |
mise ls |
18.4 ± 0.6 | 17.9 | 26.0 | 1.02 ± 0.03 |
xtasks/test/perf
| Command | mise-2025.10.3 | mise | Variance |
|---|---|---|---|
| install (cached) | 238ms | ✅ 126ms | +88% |
| ls (cached) | 75ms | 75ms | +0% |
| bin-paths (cached) | 83ms | 82ms | +1% |
| task-ls (cached) | 589ms | 556ms | +5% |
✅ Performance improvement: install cached is 88%
jdx
added a commit
that referenced
this pull request
Oct 6, 2025
## Summary Creates comprehensive documentation for monorepo tasks in a dedicated page and updates related documentation to reference it. ## Changes - **New documentation**: `docs/tasks/monorepo.md` - comprehensive guide covering: - Overview and benefits - Configuration and setup - Task path syntax (absolute, current directory, wildcards) - Tool inheritance from parent configs (new feature documented) - Performance tuning - Best practices - Troubleshooting - **Updated references**: - `docs/tasks/task-configuration.md` - replaced full monorepo section with link to new doc - `docs/configuration.md` - added mention of tool inheritance feature and updated link ## Why The monorepo task information was embedded in the task configuration page, making it hard to find and navigate. With the recent addition of tool inheritance support (#6559), this seemed like a good time to: 1. Give monorepo tasks their own dedicated documentation page 2. Make it easier to discover and understand the feature 3. Consolidate all monorepo-related information in one place 4. Document the new tool inheritance behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a comprehensive Monorepo Tasks doc and updates existing docs to point to it, noting tool/env inheritance and simplifying the monorepo root wording. > > - **Docs**: > - **New**: `docs/tasks/monorepo.md` — overview, target path syntax (`//`, `:`), wildcards (`...`, `*`), tool/env inheritance, discovery rules, listing, performance tuning, best practices. > - **Updated**: > - `docs/tasks/task-configuration.md` — replace detailed monorepo section with a brief enablement note and link to `Monorepo Tasks`. > - `docs/configuration.md` — simplify monorepo root wording, add inheritance note (“Subdirectory tasks inherit tools from parent configs”), and update link to `Monorepo Tasks`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0a9ca2f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes regression where tasks were unable to access tools from idiomatic version files (e.g.,
.node-version) whenidiomatic_version_file_enable_toolswas configured.Issue
Since v2025.10.3, the monorepo task support changes caused tasks to only use tools from their defining config file instead of all config files in the hierarchy. This meant that tools from idiomatic version files like
.node-versionwere no longer available in task PATH.Root Cause
The issue was in
build_toolset_for_task()insrc/cli/run.rs. When a task had a config file reference (task_cf), the code would build a toolset from ONLY that config file usingtask_cf.to_toolset(). This excluded tools from other config files in the same directory, such as.node-versionfiles.The monorepo logic was intended to use subdirectory config files for monorepo tasks, but it incorrectly applied this logic to ALL tasks that had a
config_source, not just monorepo tasks.Solution
The fix distinguishes between:
task.cfset) - use the monorepo-specific toolset building logicThis is done by checking
task.cf.is_some()before applying the monorepo logic.Test Plan
test_task_idiomatic_version_filethat verifies tasks can use tools from.node-versionfiles🤖 Generated with Claude Code
Note
Restores task tool resolution from idiomatic version files and corrects monorepo inheritance by merging global and subdirectory toolsets; adds e2e tests covering both cases.
task.cfpresent).task_cf) so parent tools are inherited and idiomatic version files (e.g.,.node-version) are honored.e2e/tasks/test_task_idiomatic_version_file: verifies tasks use tools from.node-versionwhenidiomatic_version_file_enable_toolsis set.e2e/tasks/test_task_monorepo_tool_inheritance: validates root inheritance, overrides, and multi-level inheritance for Node versions in monorepo tasks.Written by Cursor Bugbot for commit 43f9fd6. This will update automatically on new commits. Configure here.