fix(cli): forward --yolo to TUI binary via DEEPSEEK_YOLO env

The CLI dispatcher accepted --yolo but only passed it to Exec(TuiPassthroughArgs),
not to the plain Run(RunArgs) path used for interactive sessions.

Fix: pass DEEPSEEK_YOLO=true env var to the TUI binary. The TUI already
reads this env var (matching DEEPSEEK_SANDBOX_MODE pattern) and sets
allow_shell + start_in_agent_mode + yolo.

Also adds yolo field to CliRuntimeOverrides and ResolvedRuntimeOptions
so the flag propagates through the full resolve chain.
This commit is contained in:
fuleinist
2026-05-09 00:26:13 +08:00
committed by Hunter Bown
parent c227a805bd
commit 665801bb8e
5 changed files with 24 additions and 0 deletions
+7
View File
@@ -92,6 +92,9 @@ struct Cli {
no_mouse_capture: bool,
#[arg(long = "skip-onboarding")]
skip_onboarding: bool,
/// YOLO mode: auto-approve all tools
#[arg(long)]
yolo: bool,
#[arg(short = 'p', long = "prompt", value_name = "PROMPT")]
prompt_flag: Option<String>,
#[arg(
@@ -425,6 +428,7 @@ fn run() -> Result<()> {
telemetry: cli.telemetry,
approval_policy: cli.approval_policy.clone(),
sandbox_mode: cli.sandbox_mode.clone(),
yolo: Some(cli.yolo),
};
let command = cli.command.take();
@@ -1441,6 +1445,9 @@ fn build_tui_command(
if let Some(mode) = cli.sandbox_mode.as_ref() {
cmd.env("DEEPSEEK_SANDBOX_MODE", mode);
}
if cli.yolo {
cmd.env("DEEPSEEK_YOLO", "true");
}
if let Some(api_key) = cli.api_key.as_ref() {
cmd.env("DEEPSEEK_API_KEY", api_key);
if resolved_runtime.provider == ProviderKind::Openai {