Skip to content

fix(task): resolve task_config.includes relative to config root#8193

Merged
jdx merged 2 commits intomainfrom
fix/task-config-includes-resolve
Feb 16, 2026
Merged

fix(task): resolve task_config.includes relative to config root#8193
jdx merged 2 commits intomainfrom
fix/task-config-includes-resolve

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Feb 16, 2026

Summary

  • Fix [task_config].includes paths being resolved relative to the config file's parent directory instead of the config root
  • For configs like mise/config.toml, includes like "bindist/tasks" were incorrectly resolving to mise/bindist/tasks instead of bindist/tasks
  • Use config_root() which correctly computes the project root for all config path patterns
  • Rename monorepo includes test to drop _slow suffix (no tool compilation/installation)

Fixes #8187

Test plan

🤖 Generated with Claude Code


Note

Medium Risk
Changes core task discovery/path resolution behavior, which may alter which task files are loaded for existing projects relying on the previous (incorrect) relative-base behavior.

Overview
Fixes [task_config].includes path resolution by switching relative include expansion from the config file’s directory to the config’s computed config_root() in load_file_tasks and task_includes_for_dir.

Updates e2e tests to reflect the new semantics and cover nested config layouts (e.g. .config/mise/config.toml, .mise/config.toml) plus deeper monorepo nesting, ensuring tasks load from the config-root-relative include locations and not from config-file-parent-relative fallbacks.

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

Include paths in task_config.includes were being resolved relative to
the config file's parent directory. For configs like `mise/config.toml`,
this meant includes like `"bindist/tasks"` resolved to
`mise/bindist/tasks` instead of `bindist/tasks`.

Use `config_root()` instead, which correctly computes the project root
for all config path patterns (e.g., `mise/config.toml` → grandparent).

Fixes #8187

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 16, 2026 22:16
@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 addresses a critical bug where task_config.includes paths were incorrectly resolved relative to the config file's directory, leading to task discovery failures in certain monorepo setups. The fix ensures that these paths are now correctly resolved against the configuration root, improving the reliability of task inclusion across various project structures.

Highlights

  • Task Include Path Resolution: Corrected the resolution of task_config.includes paths to be relative to the configuration root instead of the config file's parent directory.
  • config_root() Utilization: Implemented the use of config_root() to ensure accurate computation of the project root for all configuration path patterns.
  • Test Renaming: Renamed the test_task_monorepo_includes_relative_path_slow e2e test to test_task_monorepo_includes_relative_path, removing the _slow suffix as it no longer involves tool compilation/installation.
Changelog
  • e2e/tasks/test_task_monorepo_includes_relative_path
    • Updated task include paths in packages/foo/mise/config.toml and packages/bar/src/mise/config.toml to reflect resolution from the config root.
  • src/config/mod.rs
    • Modified load_file_tasks to use cf.config_root() for expanding task includes.
    • Updated task_includes_for_dir to resolve include paths relative to the config root.
Activity
  • The issue was reproduced using https://codeberg.org/mdekstrand/opserve.git, confirming that all four tasks are now correctly discovered after the fix.
  • The test_task_monorepo_includes_relative_path e2e test was updated and now passes, validating the corrected include path resolution.
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
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 correctly fixes the resolution of [task_config].includes paths to be relative to the config root instead of the config file's parent directory. The changes in src/config/mod.rs are logical and consistently apply cf.config_root() for path resolution in both load_file_tasks and task_includes_for_dir. A notable improvement is the removal of a risky .unwrap() in load_file_tasks, which prevents a potential panic and enhances the code's robustness. The accompanying updates to the e2e tests validate the new behavior effectively. Overall, this is a solid fix that improves correctness and stability.


let mut tasks = vec![];
let config_root = Arc::new(config_root.to_path_buf());
let cf_dir = cf.get_path().parent().unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Using .unwrap() here is risky and could lead to a panic if the config file is located at the root of the filesystem (e.g., /config.toml). In such a case, parent() would eventually return None, causing the unwrap() to fail.

The change to use cf.config_root() is a great improvement as it not only fixes the path resolution logic but also makes the code more robust by avoiding this potential panic.

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

Fixes relative path resolution for [task_config].includes so includes are interpreted from the config root (project root) rather than the config file’s parent directory—important for configs stored under mise/config.toml and monorepo layouts.

Changes:

  • Resolve task include paths using ConfigFile::config_root() instead of cf.get_path().parent().
  • Update the monorepo e2e test include paths to match the new resolution base.

Reviewed changes

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

File Description
src/config/mod.rs Switches include-path expansion to use config_root() for correct project-root-relative includes.
e2e/tasks/test_task_monorepo_includes_relative_path Updates include paths/comments to reflect config-root-relative resolution in monorepo scenarios.
Comments suppressed due to low confidence (1)

e2e/tasks/test_task_monorepo_includes_relative_path:54

  • This test file now treats includes as relative to the config root, but the header comment / example monorepo layout earlier in the file still describes includes as relative to the config file’s directory (and shows the old ../../../... path). Please update those earlier comments to match the new semantics so the test remains self-explanatory.

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

Comment on lines 2268 to +2272
.rev()
.find_map(|cf| {
cf.task_config().includes.clone().map(|includes| {
// Resolve relative paths from the config file's directory, not the search directory
let cf_dir = cf.get_path().parent().unwrap_or(dir);
(includes, cf_dir.to_path_buf())
// Resolve relative paths from the config root, not the config file's directory
(includes, cf.config_root())
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 comment immediately above this block still says includes are resolved relative to the config file’s directory, but the implementation now resolves relative to cf.config_root(). Update/remove the stale comment so it matches the new behavior to avoid future confusion.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 x -- echo 23.5 ± 0.6 22.9 32.9 1.00
mise x -- echo 23.6 ± 0.8 22.9 31.1 1.00 ± 0.04

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 env 23.0 ± 0.4 22.5 28.9 1.00
mise env 23.0 ± 0.2 22.5 24.2 1.00 ± 0.02

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 hook-env 23.7 ± 0.3 23.2 28.4 1.00
mise hook-env 23.7 ± 0.4 23.0 27.8 1.00 ± 0.02

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.13 ls 21.9 ± 0.2 21.4 23.4 1.00
mise ls 22.2 ± 0.2 21.7 23.5 1.01 ± 0.01

xtasks/test/perf

Command mise-2026.2.13 mise Variance
install (cached) 125ms 131ms -4%
ls (cached) 79ms 80ms -1%
bin-paths (cached) 82ms 84ms -2%
task-ls (cached) 833ms 827ms +0%

Update test_task_monorepo_nested_config to place task files at
config_root-relative paths instead of config-file-parent-relative
paths, matching the new include resolution behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdx jdx enabled auto-merge (squash) February 16, 2026 23:13
@jdx jdx merged commit 6586d1a into main Feb 16, 2026
35 checks passed
@jdx jdx deleted the fix/task-config-includes-resolve branch February 16, 2026 23:26
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
…8193)

## Summary
- Fix `[task_config].includes` paths being resolved relative to the
config file's parent directory instead of the config root
- For configs like `mise/config.toml`, includes like `"bindist/tasks"`
were incorrectly resolving to `mise/bindist/tasks` instead of
`bindist/tasks`
- Use `config_root()` which correctly computes the project root for all
config path patterns
- Rename monorepo includes test to drop `_slow` suffix (no tool
compilation/installation)

Fixes jdx#8187

## Test plan
- [x] Reproduced with https://codeberg.org/mdekstrand/opserve.git — all
4 tasks now discovered
- [x] `test_task_monorepo_includes_relative_path` e2e test passes
(updated include paths to be relative to config root)

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes core task discovery/path resolution behavior, which may alter
which task files are loaded for existing projects relying on the
previous (incorrect) relative-base behavior.
> 
> **Overview**
> Fixes `[task_config].includes` path resolution by switching relative
include expansion from the config file’s directory to the config’s
computed `config_root()` in `load_file_tasks` and
`task_includes_for_dir`.
> 
> Updates e2e tests to reflect the new semantics and cover nested config
layouts (e.g. `.config/mise/config.toml`, `.mise/config.toml`) plus
deeper monorepo nesting, ensuring tasks load from the
config-root-relative include locations and *not* from
config-file-parent-relative fallbacks.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2ede60c. 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