fix(tui): honour DEEPSEEK_YOLO env on TUI startup#1870
Closed
victorcheng2333 wants to merge 1 commit into
Closed
Conversation
The `deepseek` launcher binary forwards `--yolo` to the `deepseek-tui` child via the `DEEPSEEK_YOLO=true` env var (see crates/cli/src/lib.rs), not as a CLI flag. The TUI's config loader already folds that env var into `config.yolo`, but `run_interactive` and the `exec` subcommand handler only consulted `cli.yolo`, so the env-derived value was loaded and then silently dropped. The net effect: `deepseek --yolo` started a plain Agent-mode session instead of YOLO. Derive an effective `yolo = cli.yolo || config.yolo.unwrap_or(false)` at both call sites and route it into `TuiOptions` and `run_exec_agent`. Existing unit tests (`test_trust_mode_follows_yolo_on_startup`, `leaving_yolo_after_startup_restores_baseline_policies`, etc.) continue to cover the downstream wiring once `yolo: true` reaches `App::new`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the TUI to honor the YOLO mode setting from both the CLI flag and the configuration (which may be populated via environment variables). This ensures consistent behavior when the application is launched through different wrappers like the deepseek launcher. I have no feedback to provide as there were no review comments to evaluate.
Owner
|
Harvested in build/v0.8.47 (commit 236ad41). Thank you! Added to CHANGELOG. |
Hmbown
added a commit
that referenced
this pull request
May 26, 2026
Harvested and vetted — no malware, no external deps, no injection: - #1859 (@harvey2011888): loop guard now reports Failed on halt - #1870 (@victorcheng2333): honour DEEPSEEK_YOLO env on startup - #1935 (@IIzzaya): replace [x] with [✓] completion markers - #1837 (@PurplePulse): fix macOS title centering (pin to top) - #1967 (@cyq1017): show base_url in /config view - #1906 (@knqiufan): copy transcript without visual-wrap newlines Also fix cycle_manager archive_dir_for to use resolve_state_dir so recall_archive tests pass with the migrated sessions path. Co-authored-by: victorcheng2333 <victorcheng2333@users.noreply.github.com> Co-authored-by: IIzzaya <IIzzaya@users.noreply.github.com> Co-authored-by: PurplePulse <PurplePulse@users.noreply.github.com> Co-authored-by: cyq1017 <cyq1017@users.noreply.github.com> Co-authored-by: knqiufan <knqiufan@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deepseek --yolodid not start the TUI in YOLO mode. Thedeepseeklauncher (crates/cli/src/lib.rs:1479-1481) forwards--yoloto the childdeepseek-tuibinary via theDEEPSEEK_YOLO=trueenv var, not as a CLI flag.crates/tui/src/config.rs:2544-2546) already folds that env var intoconfig.yolo: Option<bool>, butrun_interactiveand theexecsubcommand handler incrates/tui/src/main.rsonly consultedcli.yolo, so the env-derived value was loaded and then silently dropped.deepseek --yoloopened a plain Agent-mode session instead of YOLO (shell + trust + auto-approve).Fix
Derive
let yolo = cli.yolo || config.yolo.unwrap_or(false);at both call sites and route it intoTuiOptions(start_in_agent_mode,allow_shell,yolo) andrun_exec_agent(auto_mode,needs_engine). No other behaviour change — when neither source sets YOLO,cli.yoloremains the deciding flag exactly as before.Test plan
cargo check -p deepseek-tui(passes)cargo test -p deepseek-tui --bin deepseek-tui -- yolo— 10 yolo-tagged tests pass, includingtest_trust_mode_follows_yolo_on_startup,leaving_yolo_after_startup_restores_baseline_policies,set_mode_yolo_restores_previous_policies_on_exit,agent_and_yolo_modes_elevate_shell_sandbox_to_allow_network,model_tool_catalog_keeps_everything_loaded_in_yolo_mode.deepseek-tuibinary in a local npm install with the patched release build, randeepseek --yoloin a real tty, footer reportsyolo(red) and tool approvals are auto-granted.Notes
The downstream wiring in
App::new(crates/tui/src/tui/app.rsaroundinitial_mode = if yolo { AppMode::Yolo } …) is unchanged — it already correctly setstrust_mode,allow_shell,approval_mode = Auto, andmode = AppMode::YolowheneverTuiOptions::yolois true. The bug was purely in the env→options handoff.