Fix issue #107: Skip acknowledgment prompt in non-interactive mode#121
Fix issue #107: Skip acknowledgment prompt in non-interactive mode#121
Conversation
- Add non_interactive parameter to run_onboard_wizard function - Skip safety acknowledgment prompt when --non-interactive flag is set - Update all call sites to pass the non_interactive flag - Fixes issue where 'rustyclaw onboard --non-interactive' still prompted for acknowledgment
| if !non_interactive { | ||
| println!( | ||
| "{}", | ||
| t::warn("⚠ Important: Please read before continuing.") | ||
| ); | ||
| println!(); | ||
| println!(" {}", t::muted("Onboarding cancelled.")); | ||
| println!( | ||
| " RustyClaw is an {}, meaning it can", | ||
| t::accent_bright("agentic coding tool") | ||
| ); | ||
| println!(" read, write, and execute code on your machine on your"); | ||
| println!(" behalf. Like any powerful tool, it should be used with"); | ||
| println!(" care and awareness."); | ||
| println!(); | ||
| println!( | ||
| " • {} and modify files in your project", | ||
| t::bold("It can create") | ||
| ); | ||
| println!(" • {} commands in your terminal", t::bold("It can run")); | ||
| println!( | ||
| " • {} with external APIs using your credentials", | ||
| t::bold("It can interact") | ||
| ); | ||
| println!(); | ||
| println!(" Always review actions before approving them, especially"); | ||
| println!(" in production environments. You are responsible for any"); | ||
| println!(" changes made by the tool."); | ||
| println!(); | ||
|
|
||
| let ack = prompt_line( | ||
| &mut reader, | ||
| &format!( | ||
| "{} ", | ||
| t::accent("Do you acknowledge and wish to continue? [y/N]:") | ||
| ), | ||
| )?; | ||
| if !ack.trim().eq_ignore_ascii_case("y") { | ||
| println!(); | ||
| println!(" {}", t::muted("Onboarding cancelled.")); | ||
| println!(); | ||
| return Ok(false); | ||
| } | ||
| println!(); | ||
| return Ok(false); | ||
| } |
There was a problem hiding this comment.
🔴 non_interactive flag only skips the safety acknowledgment but leaves all other interactive prompts active, causing the wizard to hang
The non_interactive parameter is only checked at crates/rustyclaw-tui/src/onboard.rs:42 to skip the safety acknowledgment prompt (step 0). However, the rest of the wizard (steps 0b through 8) still calls prompt_line, prompt_secret, and arrow_select without checking non_interactive, so the wizard immediately blocks waiting for stdin at the "Agent name" prompt (crates/rustyclaw-tui/src/onboard.rs:105). This is particularly problematic because the CLI flags document non_interactive as "Run wizard without prompts" (crates/rustyclaw-cli/src/main.rs:107-108) and "Run without prompts" (crates/rustyclaw-cli/src/main.rs:199-201), and for rustyclaw setup --non-interactive the flag's presence alone triggers the wizard path (crates/rustyclaw-cli/src/main.rs:598). Users in automated/CI environments will find the process hangs indefinitely.
Prompt for agents
The non_interactive flag in crates/rustyclaw-tui/src/onboard.rs needs to be threaded through the entire run_onboard_wizard function (not just the safety acknowledgment at line 42). When non_interactive is true, every interactive prompt should be skipped with sensible defaults:
1. Line 105: prompt_line for agent name - should use the current name or default "RustyClaw"
2. Lines 138-325: Secrets vault setup - should use auto-generated key file (no password), skip TOTP, skip SSH key
3. Lines 328-341: arrow_select for model provider - should use a default provider or the one already configured
4. Lines 350-449: Authentication prompts - should skip if credentials already exist, or fail gracefully
5. Lines 451-499: Base URL prompts - should use defaults
6. Lines 501-572: Model selection - should use default model
7. Lines 594-605: SOUL.md prompt - should use default
8. Line 623: setup_messaging - should skip
9. Line 627: setup_recommended_skills - should skip
Alternatively, consider early-returning with defaults when non_interactive is true, or passing the flag down to each helper function.
Was this helpful? React with 👍 or 👎 to provide feedback.
Fix issue #107: onboard --non-interactive still requires acknowledgment prompt
Problem
When running
rustyclaw onboard --non-interactive, the command still prompts the user with "Do you acknowledge and wish to continue? [y/N]:" which defeats the purpose of the--non-interactiveflag. Non-interactive mode should skip ALL prompts to enable automated setup workflows.Solution
non_interactiveparameter to therun_onboard_wizardfunctionmain.rsto pass thenon_interactiveflag from the command line argumentsChanges Made
crates/rustyclaw-tui/src/onboard.rs:
non_interactive: boolparameter torun_onboard_wizard()if !non_interactiveblockcrates/rustyclaw-cli/src/main.rs:
run_onboard_wizardcalls to pass thenon_interactiveflag:args.non_interactive_args.non_interactivefalse(since configure doesn't have non-interactive option)Testing
When
rustyclaw onboard --non-interactiveis run, the safety acknowledgment prompt will be skipped and the onboarding process will proceed directly to the agent naming step.Compatibility
This change is backwards compatible - existing interactive usage remains unchanged, and only adds the ability to truly skip prompts when the
--non-interactiveflag is specified.Fixes #107