Add explicit [plan mode] indicator to interactive prompt

- Change plan mode prompt from ' >> ' to ' [plan mode] >> ' for clarity
- Add magenta syntax highlighting for [plan mode] text in prompt
- Add tests for prompt highlighting behavior
This commit is contained in:
Dhanji R. Prasanna
2026-02-06 11:31:07 +11:00
parent f35807b728
commit bcd50190c6
2 changed files with 34 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ use crate::task_execution::execute_task_with_retry;
use crate::utils::display_context_progress;
/// Plan mode prompt string.
const PLAN_MODE_PROMPT: &str = " >> ";
const PLAN_MODE_PROMPT: &str = " [plan mode] >> ";
/// Build the interactive prompt string.
///
@@ -482,16 +482,16 @@ mod tests {
#[test]
fn test_build_prompt_plan_mode() {
let prompt = build_prompt(false, true, None, &None);
assert_eq!(prompt, " >> ");
assert_eq!(prompt, " [plan mode] >> ");
// Plan mode takes precedence over agent name
let prompt = build_prompt(false, true, Some("butler"), &None);
assert_eq!(prompt, " >> ");
assert_eq!(prompt, " [plan mode] >> ");
// Plan mode takes precedence over project
let project = Some(create_test_project("myapp"));
let prompt = build_prompt(false, true, None, &project);
assert_eq!(prompt, " >> ");
assert_eq!(prompt, " [plan mode] >> ");
}
#[test]