Commit e9afca6
fix(github): use alias-specific options when tool_alias has its own config (#8892)
## Summary
- Fixed regression where `tool_alias` with per-alias `asset_pattern` (or
other options) would use the original tool's options instead of the
alias-specific ones
- Changed `get_tool_opts()` to prefer the alias-specific config entry
when it has options set, falling back to the resolved name match for
CLI-created requests without options (preserves the treesize/gitlab fix
from #8084)
- Added e2e test verifying both the original tool and its alias install
with their respective asset patterns
Fixes #8847
## Test plan
- [x] `cargo test` — all 563 unit tests pass
- [x] `mise run test:e2e test_github_tool_alias_asset_pattern` — new e2e
test passes
- [x] All lint hooks pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes tool option resolution for aliased backends, which can affect
how tools are downloaded/installed (e.g., `asset_pattern`) for some
configurations; scope is localized but impacts installation behavior.
>
> **Overview**
> Fixes a regression where a `tool_alias` could incorrectly inherit the
original tool’s option set (notably `asset_pattern`) instead of using
the alias-specific config.
>
> `Config::get_tool_opts()` now considers both the alias short-name
match and the resolved full-name match and selects the entry that
actually has options, preferring the alias-specific entry when present
while preserving the fallback for resolved-name configs.
>
> Adds an e2e regression test that configures a GitHub tool and its
alias with different `asset_pattern` values and verifies both install
using their respective assets.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
7f9ce83. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent f326d2f commit e9afca6
File tree
2 files changed
+52
-7
lines changed- e2e/backend
- src/config
2 files changed
+52
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
| 354 | + | |
| 355 | + | |
355 | 356 | | |
356 | 357 | | |
357 | | - | |
358 | | - | |
359 | 358 | | |
360 | 359 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
365 | 382 | | |
366 | 383 | | |
367 | 384 | | |
| |||
0 commit comments