Skip to content

fix(task): resolve global tasks when running from monorepo root#8192

Merged
jdx merged 1 commit intomainfrom
fix/monorepo-global-task-resolution
Feb 16, 2026
Merged

fix(task): resolve global tasks when running from monorepo root#8192
jdx merged 1 commit intomainfrom
fix/monorepo-global-task-resolution

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Feb 16, 2026

Summary

  • When running a bare task name (e.g., mise run hello) from within a monorepo, the name gets auto-expanded to monorepo syntax (//:hello). Global tasks defined in ~/.config/mise/config.toml don't have the // prefix, so the matching logic failed to find them.
  • Fix by falling back to the original bare task name when the monorepo-expanded pattern yields no results.

Fixes #6564 (reply in thread)

Test plan

  • New e2e test test_task_monorepo_global_tasks verifies global tasks can be run from monorepo root
  • Existing monorepo tests pass (config_roots, wildcards, syntax, name_conflicts, run_project_tasks)

🤖 Generated with Claude Code


Note

Low Risk
Small, localized change to task name resolution with a clear fallback path and added e2e coverage; minimal impact beyond monorepo/global task matching edge cases.

Overview
Bare task names run from a monorepo root now fall back to matching the original (non-monorepo) name when :task/monorepo expansion yields no matches, restoring access to global tasks from within monorepo contexts.

Adds an e2e regression test covering global task execution, root and subproject task execution, task listing visibility, and ensuring explicit :task syntax does not incorrectly resolve to global tasks.

Written by Cursor Bugbot for commit 1711374. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings February 16, 2026 21:53
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where global tasks defined in ~/.config/mise/config.toml could not be executed from within a monorepo root. Previously, mise would auto-expand bare task names into monorepo-specific syntax, preventing it from finding globally defined tasks. The change introduces a fallback mechanism to re-attempt task resolution using the original, unexpanded task name if the monorepo-expanded lookup fails, thereby restoring expected behavior for global tasks in monorepo environments.

Highlights

  • Monorepo Task Resolution: Implemented a fallback mechanism to correctly resolve global tasks when invoked from a monorepo root, addressing an issue where task names were incorrectly auto-expanded.
  • New E2E Test: Added a dedicated end-to-end test (test_task_monorepo_global_tasks) to verify the fix and ensure global tasks can be run from within a monorepo context.
Changelog
  • e2e/tasks/test_task_monorepo_global_tasks
    • Added a new e2e test to verify global tasks can be run from a monorepo root.
  • src/task/task_list.rs
    • Introduced logic to store the original task name before monorepo expansion.
    • Implemented a fallback to search for tasks using the original bare name if the monorepo-expanded name yields no results.
Activity
  • A new end-to-end test (test_task_monorepo_global_tasks) was added to validate the fix for global tasks in monorepos.
  • Existing monorepo-related tests (config_roots, wildcards, syntax, name_conflicts, run_project_tasks) were confirmed to pass.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON, but a Cloud Agent failed to start.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses an issue where global tasks were not being resolved correctly within a monorepo context. The fix, which involves a fallback mechanism to the original task name, is sound and well-implemented. The addition of a new end-to-end test in e2e/tasks/test_task_monorepo_global_tasks is excellent, as it thoroughly validates the fix and protects against potential regressions. I have one minor suggestion in src/task/task_list.rs to improve code conciseness and efficiency.

Comment on lines +308 to +312
cur_tasks = tasks_with_aliases
.get_matching(&original_name)?
.into_iter()
.cloned()
.collect_vec();
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To make the code more efficient and concise, you can use extend to add the fallback tasks to the cur_tasks vector directly. This avoids creating a new intermediate vector with collect_vec() and then reassigning, which is slightly more performant.

            cur_tasks.extend(
                tasks_with_aliases
                    .get_matching(&original_name)?
                    .into_iter()
                    .cloned(),
            );

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where global tasks cannot be run from a monorepo root using bare task names. When a bare task name (e.g., hello) is run from a monorepo root, it gets auto-expanded to monorepo syntax (//:hello). However, global tasks defined in ~/.config/mise/config.toml don't have the // prefix, so the matching logic fails to find them. The fix adds a fallback mechanism that tries the original bare name when the expanded name yields no results.

Changes:

  • Modified task resolution logic to save the original task name before expansion and fall back to it when no monorepo task is found
  • Added comprehensive e2e test to verify global tasks work from monorepo root

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/task/task_list.rs Implements fallback logic to search for global tasks using original bare name when monorepo-expanded name yields no matches
e2e/tasks/test_task_monorepo_global_tasks Adds e2e test covering global task execution from monorepo root, root task execution, subproject task execution, and task visibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.collect_vec();
// If the task name was auto-expanded to monorepo syntax (e.g., "hello" -> "//:hello")
// but no monorepo task matched, fall back to the original bare name to find global tasks
if cur_tasks.is_empty() && t != original_name && !original_name.starts_with("//") {
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

The fallback condition should also exclude original names that start with ':' (colon syntax). If a user explicitly uses colon syntax like ':task', it should not fall back to the bare name ':task' after expansion fails. The condition should be: !original_name.starts_with("//") && !original_name.starts_with(":")

Suggested change
if cur_tasks.is_empty() && t != original_name && !original_name.starts_with("//") {
if cur_tasks.is_empty()
&& t != original_name
&& !original_name.starts_with("//")
&& !original_name.starts_with(":")
{

Copilot uses AI. Check for mistakes.
# Test 4: Global task visible in task list
echo "=== Test 4: Global task visible in task list ==="
assert_contains "mise tasks --all" "hello"

Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Consider adding a test case to verify that explicit colon syntax (e.g., mise run :hello) does not fall back to global tasks. This would help ensure that the fix for the fallback condition properly excludes colon patterns. The test should verify that :hello fails if no monorepo task exists, even if a global task named hello exists.

Suggested change
# Test 5: Explicit colon syntax should not fall back to global tasks
echo "=== Test 5: Explicit colon syntax does not fall back to global tasks ==="
if mise run :hello >/tmp/mise_test_colon_hello.out 2>&1; then
echo "ERROR: 'mise run :hello' succeeded but should have failed when no monorepo task exists"
exit 1
fi

Copilot uses AI. Check for mistakes.
When a bare task name like `hello` is run from within a monorepo, it gets
auto-expanded to monorepo syntax (`//:hello`). Global tasks defined in
`~/.config/mise/config.toml` don't have the `//` prefix, so the matching
logic fails to find them.

Fix by falling back to the original bare task name when the monorepo-expanded
pattern yields no results.

Fixes #6564 (reply in thread)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdx jdx force-pushed the fix/monorepo-global-task-resolution branch from c1d3e1e to 1711374 Compare February 16, 2026 21:59
@jdx jdx enabled auto-merge (squash) February 16, 2026 22:03
@jdx jdx merged commit 1d0b792 into main Feb 16, 2026
35 checks passed
@jdx jdx deleted the fix/monorepo-global-task-resolution branch February 16, 2026 22:13
@github-actions
Copy link

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 x -- echo 23.7 ± 0.4 23.2 28.3 1.00
mise x -- echo 23.8 ± 0.4 23.1 25.7 1.00 ± 0.02

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 env 23.3 ± 0.7 22.7 30.6 1.00 ± 0.04
mise env 23.3 ± 0.4 22.7 26.0 1.00

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 hook-env 23.9 ± 0.3 23.2 25.9 1.00
mise hook-env 24.1 ± 0.4 23.3 25.7 1.01 ± 0.02

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 ls 22.1 ± 0.3 21.5 24.3 1.00
mise ls 22.3 ± 0.3 21.6 23.7 1.01 ± 0.02

xtasks/test/perf

Command mise-2026.2.13 mise Variance
install (cached) 127ms 127ms +0%
ls (cached) 80ms 79ms +1%
bin-paths (cached) 83ms 82ms +1%
task-ls (cached) 821ms 826ms +0%

mise-en-dev added a commit that referenced this pull request Feb 17, 2026
### 🚀 Features

- **(task)** stream keep-order output in real-time per task by @jdx in
[#8164](#8164)

### 🐛 Bug Fixes

- **(aqua)** resolve lockfile artifacts for target platform (fix
discussion #7479) by @mackwic in
[#8183](#8183)
- **(exec)** strip shims from PATH to prevent recursive shim execution
by @jdx in [#8189](#8189)
- **(hook-env)** preserve PATH reordering done after activation by @jdx
in [#8190](#8190)
- **(lockfile)** resolve version aliases before lockfile lookup by @jdx
in [#8194](#8194)
- **(registry)** set helm-diff archive bin name to diff by @jean-humann
in [#8173](#8173)
- **(task)** improve source freshness checks with dynamic task dirs by
@rooperuu in [#8169](#8169)
- **(task)** resolve global tasks when running from monorepo root by
@jdx in [#8192](#8192)
- **(task)** prevent wildcard glob `test:*` from matching parent task
`test` by @jdx in [#8165](#8165)
- **(task)** resolve task_config.includes relative to config root by
@jdx in [#8193](#8193)
- **(upgrade)** skip untrusted tracked configs during upgrade by @jdx in
[#8195](#8195)

### 🚜 Refactor

- use enum for npm.pacakge_manager by @risu729 in
[#8180](#8180)

### 📚 Documentation

- **(plugins)** replace node/asdf-nodejs examples with vfox plugins by
@jdx in [#8191](#8191)

### ⚡ Performance

- call npm view only once by @risu729 in
[#8181](#8181)

### New Contributors

- @jean-humann made their first contribution in
[#8173](#8173)
- @mackwic made their first contribution in
[#8183](#8183)
- @rooperuu made their first contribution in
[#8169](#8169)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`BetterDiscord/cli`](https://github.com/BetterDiscord/cli)
- [`glossia.ai/cli`](https://github.com/glossia.ai/cli)
lucasew pushed a commit to lucasew/CONTRIB-mise that referenced this pull request Feb 18, 2026
…8192)

## Summary

- When running a bare task name (e.g., `mise run hello`) from within a
monorepo, the name gets auto-expanded to monorepo syntax (`//:hello`).
Global tasks defined in `~/.config/mise/config.toml` don't have the `//`
prefix, so the matching logic failed to find them.
- Fix by falling back to the original bare task name when the
monorepo-expanded pattern yields no results.

Fixes
jdx#6564 (reply in thread)

## Test plan

- [x] New e2e test `test_task_monorepo_global_tasks` verifies global
tasks can be run from monorepo root
- [x] Existing monorepo tests pass (config_roots, wildcards, syntax,
name_conflicts, run_project_tasks)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Small, localized change to task name resolution with a clear fallback
path and added e2e coverage; minimal impact beyond monorepo/global task
matching edge cases.
> 
> **Overview**
> Bare task names run from a monorepo root now fall back to matching the
original (non-monorepo) name when `:task`/monorepo expansion yields no
matches, restoring access to global tasks from within monorepo contexts.
> 
> Adds an e2e regression test covering global task execution, root and
subproject task execution, task listing visibility, and ensuring
explicit `:task` syntax does not incorrectly resolve to global tasks.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1711374. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
lucasew pushed a commit to lucasew/CONTRIB-mise that referenced this pull request Feb 18, 2026
### 🚀 Features

- **(task)** stream keep-order output in real-time per task by @jdx in
[jdx#8164](jdx#8164)

### 🐛 Bug Fixes

- **(aqua)** resolve lockfile artifacts for target platform (fix
discussion jdx#7479) by @mackwic in
[jdx#8183](jdx#8183)
- **(exec)** strip shims from PATH to prevent recursive shim execution
by @jdx in [jdx#8189](jdx#8189)
- **(hook-env)** preserve PATH reordering done after activation by @jdx
in [jdx#8190](jdx#8190)
- **(lockfile)** resolve version aliases before lockfile lookup by @jdx
in [jdx#8194](jdx#8194)
- **(registry)** set helm-diff archive bin name to diff by @jean-humann
in [jdx#8173](jdx#8173)
- **(task)** improve source freshness checks with dynamic task dirs by
@rooperuu in [jdx#8169](jdx#8169)
- **(task)** resolve global tasks when running from monorepo root by
@jdx in [jdx#8192](jdx#8192)
- **(task)** prevent wildcard glob `test:*` from matching parent task
`test` by @jdx in [jdx#8165](jdx#8165)
- **(task)** resolve task_config.includes relative to config root by
@jdx in [jdx#8193](jdx#8193)
- **(upgrade)** skip untrusted tracked configs during upgrade by @jdx in
[jdx#8195](jdx#8195)

### 🚜 Refactor

- use enum for npm.pacakge_manager by @risu729 in
[jdx#8180](jdx#8180)

### 📚 Documentation

- **(plugins)** replace node/asdf-nodejs examples with vfox plugins by
@jdx in [jdx#8191](jdx#8191)

### ⚡ Performance

- call npm view only once by @risu729 in
[jdx#8181](jdx#8181)

### New Contributors

- @jean-humann made their first contribution in
[jdx#8173](jdx#8173)
- @mackwic made their first contribution in
[jdx#8183](jdx#8183)
- @rooperuu made their first contribution in
[jdx#8169](jdx#8169)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`BetterDiscord/cli`](https://github.com/BetterDiscord/cli)
- [`glossia.ai/cli`](https://github.com/glossia.ai/cli)
risu729 pushed a commit to risu729/mise that referenced this pull request Feb 27, 2026
### 🚀 Features

- **(task)** stream keep-order output in real-time per task by @jdx in
[jdx#8164](jdx#8164)

### 🐛 Bug Fixes

- **(aqua)** resolve lockfile artifacts for target platform (fix
discussion jdx#7479) by @mackwic in
[jdx#8183](jdx#8183)
- **(exec)** strip shims from PATH to prevent recursive shim execution
by @jdx in [jdx#8189](jdx#8189)
- **(hook-env)** preserve PATH reordering done after activation by @jdx
in [jdx#8190](jdx#8190)
- **(lockfile)** resolve version aliases before lockfile lookup by @jdx
in [jdx#8194](jdx#8194)
- **(registry)** set helm-diff archive bin name to diff by @jean-humann
in [jdx#8173](jdx#8173)
- **(task)** improve source freshness checks with dynamic task dirs by
@rooperuu in [jdx#8169](jdx#8169)
- **(task)** resolve global tasks when running from monorepo root by
@jdx in [jdx#8192](jdx#8192)
- **(task)** prevent wildcard glob `test:*` from matching parent task
`test` by @jdx in [jdx#8165](jdx#8165)
- **(task)** resolve task_config.includes relative to config root by
@jdx in [jdx#8193](jdx#8193)
- **(upgrade)** skip untrusted tracked configs during upgrade by @jdx in
[jdx#8195](jdx#8195)

### 🚜 Refactor

- use enum for npm.pacakge_manager by @risu729 in
[jdx#8180](jdx#8180)

### 📚 Documentation

- **(plugins)** replace node/asdf-nodejs examples with vfox plugins by
@jdx in [jdx#8191](jdx#8191)

### ⚡ Performance

- call npm view only once by @risu729 in
[jdx#8181](jdx#8181)

### New Contributors

- @jean-humann made their first contribution in
[jdx#8173](jdx#8173)
- @mackwic made their first contribution in
[jdx#8183](jdx#8183)
- @rooperuu made their first contribution in
[jdx#8169](jdx#8169)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`BetterDiscord/cli`](https://github.com/BetterDiscord/cli)
- [`glossia.ai/cli`](https://github.com/glossia.ai/cli)
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.

2 participants