fix(config): respect --yes flag for config trust prompts#8288
Conversation
When MISE_YES=1 or --yes is passed, automatically answer yes to config trust prompts instead of requiring interactive confirmation. This aligns the behavior with the documented description of --yes as "Answer yes to all confirmation prompts". Fixes #8253 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @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 an inconsistency where the Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request aims to fix an issue where the --yes flag was ignored for configuration trust prompts. The proposed change correctly checks for the yes setting. However, the implementation could be more robust. It relies on settings being pre-loaded by the caller, which might not always be the case. I've suggested a small change to make it more resilient by attempting to load settings within the function, ensuring the --yes flag is always respected.
| let ans = (settings::is_loaded() && Settings::get().yes) | ||
| || prompt::confirm_with_all(format!( | ||
| "{} config files in {} are not trusted. Trust them?", | ||
| style::eyellow("mise"), | ||
| style::epath(&config_root) | ||
| ))?; |
There was a problem hiding this comment.
This implementation is a bit brittle. It relies on settings being loaded before this function is called. If trust_check is ever called in a context where settings haven't been loaded, settings::is_loaded() will be false, and the user will be prompted even if they passed --yes or MISE_YES=1.
A more robust approach would be to attempt to load the settings here. This ensures the --yes flag is always respected, regardless of the call context.
Using try_get() and mapping the result is a safe way to do this without panicking if settings fail to load, falling back to prompting in that case.
| let ans = (settings::is_loaded() && Settings::get().yes) | |
| || prompt::confirm_with_all(format!( | |
| "{} config files in {} are not trusted. Trust them?", | |
| style::eyellow("mise"), | |
| style::epath(&config_root) | |
| ))?; | |
| let ans = settings::Settings::try_get().map(|s| s.yes).unwrap_or(false) | |
| || prompt::confirm_with_all(format!( | |
| "{} config files in {} are not trusted. Trust them?", | |
| style::eyellow("mise"), | |
| style::epath(&config_root) | |
| ))?; |
There was a problem hiding this comment.
Pull request overview
This PR aligns config trust prompting with the documented --yes / MISE_YES=1 behavior by automatically approving untrusted-config trust prompts when the global “yes to all prompts” setting is enabled.
Changes:
- Update
trust_check()to short-circuit trust confirmation whenSettings::get().yesis enabled. - Preserve existing interactive prompting behavior when
--yes/MISE_YESis not set.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 x -- echo |
24.9 ± 0.4 | 24.1 | 27.4 | 1.00 |
mise x -- echo |
26.3 ± 0.7 | 25.3 | 29.8 | 1.06 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 env |
24.8 ± 0.6 | 23.7 | 29.7 | 1.00 |
mise env |
25.2 ± 0.8 | 24.0 | 28.0 | 1.02 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 hook-env |
25.9 ± 0.5 | 24.7 | 27.8 | 1.00 |
mise hook-env |
26.6 ± 0.6 | 24.9 | 29.0 | 1.03 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 ls |
23.3 ± 0.4 | 22.1 | 25.0 | 1.00 |
mise ls |
23.4 ± 0.7 | 22.3 | 25.6 | 1.01 ± 0.04 |
xtasks/test/perf
| Command | mise-2026.2.17 | mise | Variance |
|---|---|---|---|
| install (cached) | 135ms | 136ms | +0% |
| ls (cached) | 83ms | 84ms | -1% |
| bin-paths (cached) | 87ms | 87ms | +0% |
| task-ls (cached) | 812ms | 808ms | +0% |
The e2e test runner sets MISE_YES=1 globally, which now auto-trusts configs after the --yes trust prompt fix. Override with MISE_YES=0 for the assertion that verifies untrusted config warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same issue as the monorepo trust test — the e2e test runner sets MISE_YES=1 globally, which now auto-trusts configs. Override with MISE_YES=0 for the command that needs to verify untrusted behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
### 🚀 Features - **(install)** auto-lock all platforms after tool installation by @jdx in [#8277](#8277) ### 🐛 Bug Fixes - **(config)** respect --yes flag for config trust prompts by @jdx in [#8288](#8288) - **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [#8276](#8276) - **(install)** validate --locked before --dry-run short-circuit by @altendky in [#8290](#8290) - **(release)** refresh PATH after mise up in release-plz by @jdx in [#8292](#8292) - **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [#8285](#8285) - **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [#8275](#8275) - **(task)** use process groups to kill child process trees on Unix by @jdx in [#8279](#8279) - **(task)** run depends_post tasks even when parent task fails by @jdx in [#8274](#8274) - **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [#8286](#8286) - **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [#8291](#8291) - **(upgrade)** don't force-reinstall already installed versions by @jdx in [#8282](#8282) - **(watch)** restore terminal state after watchexec exits by @jdx in [#8273](#8273) ### 📚 Documentation - clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [#8283](#8283) ### Chore - replace gen-release-notes script with communique by @jdx in [#8289](#8289) ### New Contributors - @altendky made their first contribution in [#8290](#8290) ## 📦 Aqua Registry Updates #### New Packages (4) - [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs) - [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds) #### Updated Packages (2) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`k1LoW/runn`](https://github.com/k1LoW/runn)
## [2026.2.18](https://github.com/jdx/mise/compare/v2026.2.17..v2026.2.18) - 2026-02-21 ### 🚀 Features - **(install)** auto-lock all platforms after tool installation by @jdx in [#8277](jdx/mise#8277) ### 🐛 Bug Fixes - **(config)** respect --yes flag for config trust prompts by @jdx in [#8288](jdx/mise#8288) - **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [#8276](jdx/mise#8276) - **(install)** validate --locked before --dry-run short-circuit by @altendky in [#8290](jdx/mise#8290) - **(release)** refresh PATH after mise up in release-plz by @jdx in [#8292](jdx/mise#8292) - **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [#8285](jdx/mise#8285) - **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [#8275](jdx/mise#8275) - **(task)** use process groups to kill child process trees on Unix by @jdx in [#8279](jdx/mise#8279) - **(task)** run depends_post tasks even when parent task fails by @jdx in [#8274](jdx/mise#8274) - **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [#8286](jdx/mise#8286) - **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [#8291](jdx/mise#8291) - **(upgrade)** don't force-reinstall already installed versions by @jdx in [#8282](jdx/mise#8282) - **(watch)** restore terminal state after watchexec exits by @jdx in [#8273](jdx/mise#8273) ### 📚 Documentation - clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [#8283](jdx/mise#8283) ### Chore - replace gen-release-notes script with communique by @jdx in [#8289](jdx/mise#8289) ### New Contributors - @altendky made their first contribution in [#8290](jdx/mise#8290) ### 📦 Aqua Registry Updates #### New Packages (4) - [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs) - [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds) #### Updated Packages (2) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`k1LoW/runn`](https://github.com/k1LoW/runn) ## [2026.2.17](https://github.com/jdx/mise/compare/v2026.2.16..v2026.2.17) - 2026-02-19 ### 🚀 Features - **(prepare)** update mtime of outputs after command is run by @halms in [#8243](jdx/mise#8243) ### 🐛 Bug Fixes - **(install)** use backend bin paths for per-tool postinstall hooks by @jdx in [#8234](jdx/mise#8234) - **(use)** write to config.toml instead of config.local.toml by @jdx in [#8240](jdx/mise#8240) - default legacy .mise.backend installs to non-explicit by @jean-humann in [#8245](jdx/mise#8245) ### 🚜 Refactor - **(config)** consolidate flat task_* settings into nested task.* by @jdx in [#8239](jdx/mise#8239) ### Chore - **(prepare)** refactor common code into ProviderBase by @halms in [#8246](jdx/mise#8246) ### 📦 Aqua Registry Updates #### Updated Packages (1) - [`namespacelabs/foundation/nsc`](https://github.com/namespacelabs/foundation/nsc)
## Summary - `MISE_YES=1` and `--yes` now automatically approve config trust prompts, matching the documented behavior of "Answer yes to all confirmation prompts" - Previously, `trust_check()` called `prompt::confirm_with_all()` without checking the `yes` setting first, so the flag was silently ignored for trust prompts Fixes jdx#8253 ## Test plan - [ ] `cd $(mktemp -d) && echo '[env]\nFOO = "bar"' > mise.toml && MISE_YES=1 mise exec -- echo hello` should succeed without prompting - [ ] `cd $(mktemp -d) && echo '[env]\nFOO = "bar"' > mise.toml && mise exec --yes -- echo hello` should succeed without prompting - [ ] Without `--yes`, trust prompt should still appear as before 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small, localized change to confirmation logic; main risk is unintentionally trusting configs when `--yes` is enabled, which is expected behavior. > > **Overview** > Config trust prompting in `trust_check()` now respects the global “answer yes to all prompts” setting by skipping the interactive `prompt::confirm_with_all()` when `Settings::get().yes` is set, and automatically trusting the config root instead. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e5396fe. 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>
### 🚀 Features - **(install)** auto-lock all platforms after tool installation by @jdx in [jdx#8277](jdx#8277) ### 🐛 Bug Fixes - **(config)** respect --yes flag for config trust prompts by @jdx in [jdx#8288](jdx#8288) - **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [jdx#8276](jdx#8276) - **(install)** validate --locked before --dry-run short-circuit by @altendky in [jdx#8290](jdx#8290) - **(release)** refresh PATH after mise up in release-plz by @jdx in [jdx#8292](jdx#8292) - **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [jdx#8285](jdx#8285) - **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [jdx#8275](jdx#8275) - **(task)** use process groups to kill child process trees on Unix by @jdx in [jdx#8279](jdx#8279) - **(task)** run depends_post tasks even when parent task fails by @jdx in [jdx#8274](jdx#8274) - **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [jdx#8286](jdx#8286) - **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [jdx#8291](jdx#8291) - **(upgrade)** don't force-reinstall already installed versions by @jdx in [jdx#8282](jdx#8282) - **(watch)** restore terminal state after watchexec exits by @jdx in [jdx#8273](jdx#8273) ### 📚 Documentation - clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [jdx#8283](jdx#8283) ### Chore - replace gen-release-notes script with communique by @jdx in [jdx#8289](jdx#8289) ### New Contributors - @altendky made their first contribution in [jdx#8290](jdx#8290) ## 📦 Aqua Registry Updates #### New Packages (4) - [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs) - [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds) #### Updated Packages (2) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`k1LoW/runn`](https://github.com/k1LoW/runn)
Summary
MISE_YES=1and--yesnow automatically approve config trust prompts, matching the documented behavior of "Answer yes to all confirmation prompts"trust_check()calledprompt::confirm_with_all()without checking theyessetting first, so the flag was silently ignored for trust promptsFixes #8253
Test plan
cd $(mktemp -d) && echo '[env]\nFOO = "bar"' > mise.toml && MISE_YES=1 mise exec -- echo helloshould succeed without promptingcd $(mktemp -d) && echo '[env]\nFOO = "bar"' > mise.toml && mise exec --yes -- echo helloshould succeed without prompting--yes, trust prompt should still appear as before🤖 Generated with Claude Code
Note
Low Risk
Small change to the trust prompt gating logic plus test updates; risk is limited to potentially auto-trusting configs when
--yesis set as documented.Overview
Config trust validation now respects the global yes-to-all setting:
trust_check()auto-accepts the “config files are not trusted” prompt whenSettings::get().yesis enabled, avoiding interactive blocking when--yes/MISE_YES=1is used.E2E task trust tests are updated to run with
MISE_YES=0when asserting untrusted-config errors, ensuring they don’t accidentally auto-trust configs in non-interactive runs.Written by Cursor Bugbot for commit 048ab8c. This will update automatically on new commits. Configure here.