Skip to content

feat(task): allow customizing confirm answer labels - #13944

Merged
jdx merged 1 commit into
mainfrom
claude/project-thread-z78jin
Oct 4, 2026
Merged

jdx merged 1 commit into
mainfrom
claude/project-thread-z78jin

Conversation

@jdx

@jdx jdx commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

https://entire.io/gh/jdx/mise/trails/414

Requested by Jeff · project thread

Task confirm prompts always showed "Yes" / "No", which doesn't fit confirmations whose outcome isn't a plain yes or no (see discussion #13940). The object form of confirm now accepts yes and no labels:

[tasks.deploy]
confirm = { message = "Deploy to production?", yes = "Deploy", no = "Cancel", default = "no" }
run = "deploy.sh"

The interactive prompt shows Deploy / Cancel instead of Yes / No.

  • default is now optional in the object form (it still defaults to yes), so { message, yes, no } is valid on its own.
  • The labels support the same Tera templates as the message, including usage.* values.
  • Non-interactive use is unchanged: piped answers (echo y | mise run deploy) still accept y/n, and --yes still skips the prompt. When labels are set, the stdin hint adds (y = Deploy, n = Cancel).
  • Plain-string confirm and existing { message, default } configs behave as before.

Docs and both JSON schemas are updated. Added unit tests for parsing (header and mise.toml); cargo clippy --workspace --all-features --all-targets -- -D warnings is clean. The interactive widget rendering itself wasn't exercised in a TTY.

AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.

🤖 Generated with Claude Code

https://claude.ai/code/session_013RFawR941sEpBL1ZrKgDbJ


Generated by Claude Code


Note

Low Risk
UX-focused extension to task confirmation with backward-compatible defaults; piped answers and --yes behavior are preserved.

Overview
Task confirm prompts can now use custom affirmative/negative labels instead of fixed Yes / No. The object form accepts optional yes and no strings (Tera-templated like message), and default is optional (still defaults to yes when omitted).

Runtime wiring renders message and labels through Tera when needed, then confirm_with_labels drives both the interactive dialog and piped stdin ( y/n unchanged; custom labels appear in the stdin hint). TaskConfirm parsing, JSON schemas, docs, and parse tests are updated accordingly.

Reviewed by Cursor Bugbot for commit 1574460. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features
    • Task confirmations can now use custom affirmative and negative labels, with the default answer optional.
    • Confirmation messages and custom labels support templates, including task usage arguments.
    • Piped responses continue to accept y and n, regardless of the displayed labels.
  • Documentation
    • Updated task configuration guidance and examples for optional defaults, custom labels, and templated confirmation text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013RFawR941sEpBL1ZrKgDbJ
@jdx jdx self-assigned this Oct 4, 2026
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1b6f4081-c9cf-4d6b-bbf9-db82fa833be7
📥 Commits

Reviewing files that changed from the base of the PR and between b101275 and 1574460.

📒 Files selected for processing (7)
  • docs/tasks/task-configuration.md
  • schema/mise-task.json
  • schema/mise.json
  • src/config/config_file/mise_toml.rs
  • src/task/task_confirm.rs
  • src/task/task_executor.rs
  • src/ui/prompt.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Task confirmations now accept optional defaults and custom affirmative and negative labels. The task executor renders templates in confirmation messages and labels, then passes the resulting text to the prompt.

Changes

Task confirmation options

Layer / File(s) Summary
Confirmation options and configuration contract
schema/mise-task.json, schema/mise.json, src/task/task_confirm.rs, src/config/config_file/mise_toml.rs, docs/tasks/task-configuration.md
The configuration schemas and TaskConfirm::Options support optional defaults and custom labels. Tests cover parsing custom labels without a default. Documentation describes the options, piped answers, and template support.
Prompt display for custom labels
src/ui/prompt.rs
The prompt API accepts optional affirmative and negative labels. Terminal and non-terminal prompts display supplied labels, using “Yes” and “No” for labels that are not supplied.
Template rendering and labeled confirmation
src/task/task_executor.rs
The task executor renders templated confirmation messages and labels, then passes them and the default-answer setting to the labeled prompt.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant TaskExecutor
  participant UsageTemplateContext
  participant confirm_with_labels
  TaskExecutor->>UsageTemplateContext: Build context when confirmation text contains templates
  UsageTemplateContext-->>TaskExecutor: Return template values
  TaskExecutor->>TaskExecutor: Render templated message and labels
  TaskExecutor->>confirm_with_labels: Pass rendered text, default answer, and labels
Loading

Suggested reviewers: risu729

Merge Risk: ⚪ Minimal · up to 15744

No actionable issue was identified that needs to be resolved before merging. Interactive display with custom labels has not been verified in a TTY.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 15744

The approval and rejection behavior is preserved, and no new approval bypass was established. Confirmation labels now share the existing ability to evaluate executable configuration before approval. Interactive behavior and the broader configuration trust context remain incompletely verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — Outside safe mode, a configuration author can invoke command execution or file reads during label rendering, before approval. Exposure can extend to commands and files accessible to the invoking process, not merely displayed text. Equivalent authority already existed through confirmation-message templates; the comparison did not establish increased privileges.

Trust Boundaries and Controls

  • observed — Both renderer versions disable exec and read_file when safe mode is enabled. Prompt calls retain mutex serialization, and EOF remains distinguishable from an explicitly submitted blank answer, preventing absent stdin from applying the affirmative default.

Resilience and Maintainability Implications

  • observed — Refusal is not a rollback boundary for all preparation: task-context construction precedes confirmation and can write wrapper shims or populate a toolset cache. This ordering predates the label change and is not retained as an introduced concern.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 4 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: task confirmations can use custom yes/no answer labels.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 4 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds customizable labels to task confirmation prompts.

The PR appears safe to merge, with a non-blocking request to test label templates.

Fix All in Claude CodeFindings

  1. P2 Label templates lack tests ▶

Summary

Adds custom yes and no labels to task confirmation prompts.

  • Allows the object form to omit default, which still means yes.
  • Renders labels with the same Tera context as the message.
  • Keeps piped answers and EOF behavior unchanged.
  • Updates both schemas, documentation, and parsing tests.
  • Add coverage for rendering labels that reference task arguments.

jdx acknowledged that interactive widget rendering was not exercised in a TTY.

Reviews (1) · Last reviewed commit: "feat(task): allow customizing confirm an..."

Comment thread src/task/task_executor.rs
Comment on lines +2004 to +2008
for (slot, text) in rendered.iter_mut().zip(texts) {
if let Some(text) = text
&& contains_template_syntax(text)
{
*slot = Some(render_str(&mut tera, text, &tera_ctx)?);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Label templates lack tests

Both added tests use fixed labels and stop after parsing. They would pass even if check_confirmation stopped rendering labels, leaving users with raw templates. Add a test with a plain message and yes/no labels using usage.*, then assert the rendered labels reach the prompt. This covers the new case where only a label needs Tera.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@jdx
jdx merged commit 85ab64e into main Oct 4, 2026
56 of 59 checks passed
@jdx
jdx deleted the claude/project-thread-z78jin branch October 4, 2026 16:35
jdx pushed a commit that referenced this pull request Oct 5, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/411
<!-- entire-trail-link-end -->

### 🚀 Features

- **(bootstrap)** render templates in Compose projects by @jdx in
[#13938](#13938)
- **(dotfiles)** add dotfile groups by @jdx in
[#13945](#13945)
- **(task)** allow customizing confirm answer labels by @jdx in
[#13944](#13944)

### 🐛 Bug Fixes

- **(env)** resolve dotenv ${VAR} against the file's own values before
ambient env by @jdx in [#13946](#13946)
- **(exec)** limit @latest resolution to the tools named on the command
line by @jdx in [#13943](#13943)
- **(ruby)** expose depends tools to ruby-build by @seuros in
[#13942](#13942)

### 📚 Documentation

- show pinned packslip bootstraps for mise and Docker by @jdx in
[#13935](#13935)

### Chore

- update pr-closer policy by @jdx in
[e19e8cb](e19e8cb)

### Security

- **(env)** stop copying secret values into shell state and the env
cache by @jdx in [#13950](#13950)
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