feat(task): allow to set confirmation default#9089
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for configuring the default-selected value of task confirmation prompts by allowing confirm to be specified as either a string or an object { message, default }.
Changes:
- Introduces
TaskConfirm(string-or-object) and updates task/task_template parsing to use it. - Extends the confirmation prompt API to allow specifying the default selection and wires it into task execution.
- Updates schemas + docs and adds parsing tests for the new
confirmobject form.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ui/prompt.rs | Adds confirm_with_default and changes confirm() behavior. |
| src/task/task_template.rs | Switches confirm from Option<String> to Option<TaskConfirm>. |
| src/task/task_executor.rs | Renders TaskConfirm.message() and applies parsed default selection for prompts. |
| src/task/task_confirm.rs | New TaskConfirm enum with helpers + a test for header parsing. |
| src/task/mod.rs | Updates Task.confirm type and task header parsing for confirm. |
| src/config/config_file/mise_toml.rs | Adds tests ensuring TOML parsing supports confirm object form. |
| schema/mise.json | Expands confirm schema to accept string or {message, default}. |
| schema/mise-task.json | Same as above for task schema. |
| docs/tasks/task-configuration.md | Documents object form for confirm and updates example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR extends the
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Task has confirm field] --> B{TaskConfirm variant}
B -->|Message string| C[message = string\ndefault_yes = true]
B -->|Options object| D[message = options.message\ndefault = options.default]
D --> E[parse_confirm_default]
E -->|yes / y / true| F[default_yes = true]
E -->|no / n / false| G[default_yes = false]
E -->|other| H[Error: invalid default]
C --> I{Settings.yes flag?}
F --> I
G --> I
I -->|set| J[Skip prompt - Task runs]
I -->|not set| K{user_attended_stderr?}
K -->|No terminal| L[Returns Ok false - Task aborts - default_yes ignored]
K -->|Interactive| M[confirm_with_default with default_yes]
M -->|User confirms| J
M -->|User denies| N[Error: aborted by user]
|
|
maybe it would also be useful to have some way to force the user to type something in like "I'm really sure" or an app name or something for confirmations? doesn't replace this though, I think this is still useful on its own |
There was a problem hiding this comment.
Code Review
This pull request enhances the task confirmation feature by allowing users to specify a default value (e.g., "yes", "no", "true", "false") through a new object-based configuration for the confirm property. The changes include updates to the documentation, JSON schemas, and the internal task execution logic to support both the legacy string format and the new structured format. Feedback focuses on ensuring the internal Rust implementation of the TaskConfirm enum strictly aligns with the optional nature of the default field as defined in the schema, and correcting a change in the global prompt utility that inadvertently altered the default behavior for existing confirmation prompts.
### 🚀 Features - **(npm)** use --min-release-age for npm 11.10.0+ supply chain protection by @webkaz in [#9072](#9072) - **(registry)** add openfga by @mnm364 in [#9084](#9084) - **(task)** allow to set confirmation default by @roele in [#9089](#9089) - support os/arch compound syntax in tool os filtering by @RobertDeRose in [#9088](#9088) ### 🐛 Bug Fixes - **(activate)** export __MISE_EXE and resolve bare ARGV0 to absolute path by @fru1tworld in [#9081](#9081) - **(install)** support aliased installs sharing a backend by @jdx in [#9093](#9093) - **(shim)** use which_no_shims when resolving mise binary in reshim and doctor by @kevinswiber in [#9071](#9071) - filter empty segments in colon-separated env var parsing by @baby-joel in [#9076](#9076) ### 📚 Documentation - fix wrong file reference to forgejo backend implemenation by @roele in [#9090](#9090) - fix cli token command for token resolution by @roele in [#9077](#9077) ### 📦 Registry - add trzsz-go ([aqua:trzsz/trzsz-go](https://github.com/trzsz/trzsz-go)) by @ZeroAurora in [#9083](#9083) - add copilot ([aqua:github/copilot-cli](https://github.com/github/copilot-cli)) by @risu729 in [#9082](#9082) ### Chore - add AGENTS.md symlink by @jdx in [#9094](#9094) ### New Contributors - @kevinswiber made their first contribution in [#9071](#9071) - @webkaz made their first contribution in [#9072](#9072) - @RobertDeRose made their first contribution in [#9088](#9088) ## 📦 Aqua Registry Updates #### New Packages (7) - [`IBM-Cloud/ibm-cloud-cli-release`](https://github.com/IBM-Cloud/ibm-cloud-cli-release) - [`max-sixty/worktrunk`](https://github.com/max-sixty/worktrunk) - [`micelio.dev/hif`](https://github.com/micelio.dev/hif) - [`pgplex/pgschema`](https://github.com/pgplex/pgschema) - [`rose-pine/rose-pine-bloom`](https://github.com/rose-pine/rose-pine-bloom) - [`santosr2/TerraTidy`](https://github.com/santosr2/TerraTidy) - [`trzsz/trzsz-go`](https://github.com/trzsz/trzsz-go) #### Updated Packages (3) - [`mvdan/sh`](https://github.com/mvdan/sh) - [`rvben/rumdl`](https://github.com/rvben/rumdl) - [`temporalio/temporal`](https://github.com/temporalio/temporal)
## [2026.4.14](https://github.com/jdx/mise/compare/v2026.4.13..v2026.4.14) - 2026-04-15 ### Chore - bump sigstore-verification by @jdx in [#9128](jdx/mise#9128) ## [2026.4.13](https://github.com/jdx/mise/compare/v2026.4.12..v2026.4.13) - 2026-04-15 ### 🐛 Bug Fixes - **(go)** honor install_before for module versions by @mariusvniekerk in [#9097](jdx/mise#9097) - **(vfox-plugin)** support Git URL with commit hash for mise.toml by @Oyami-Srk in [#9099](jdx/mise#9099) - `MISE_FETCH_REMOTE_VERSIONS_CACHE` not respected by @mcncl in [#9096](jdx/mise#9096) ### 📦️ Dependency Updates - unblock cargo-deny advisories check by @jdx in [#9112](jdx/mise#9112) ### New Contributors - @mariusvniekerk made their first contribution in [#9097](jdx/mise#9097) - @mcncl made their first contribution in [#9096](jdx/mise#9096) - @Oyami-Srk made their first contribution in [#9099](jdx/mise#9099) ## [2026.4.12](https://github.com/jdx/mise/compare/v2026.4.11..v2026.4.12) - 2026-04-15 ### 🚀 Features - **(npm)** use --min-release-age for npm 11.10.0+ supply chain protection by @webkaz in [#9072](jdx/mise#9072) - **(registry)** add openfga by @mnm364 in [#9084](jdx/mise#9084) - **(task)** allow to set confirmation default by @roele in [#9089](jdx/mise#9089) - support os/arch compound syntax in tool os filtering by @RobertDeRose in [#9088](jdx/mise#9088) ### 🐛 Bug Fixes - **(activate)** export __MISE_EXE and resolve bare ARGV0 to absolute path by @fru1tworld in [#9081](jdx/mise#9081) - **(install)** support aliased installs sharing a backend by @jdx in [#9093](jdx/mise#9093) - **(shim)** use which_no_shims when resolving mise binary in reshim and doctor by @kevinswiber in [#9071](jdx/mise#9071) - filter empty segments in colon-separated env var parsing by @baby-joel in [#9076](jdx/mise#9076) ### 📚 Documentation - fix wrong file reference to forgejo backend implemenation by @roele in [#9090](jdx/mise#9090) - fix cli token command for token resolution by @roele in [#9077](jdx/mise#9077)
Currently the default selected option for
confirmin tasks isYeswhich might not be a sensible default for destructive actions. While keeping this behaviour we add an option to defineconfirmas map withmessageanddefault=yes|no.