Route OpenCode yolo aliases to native auto mode#7187
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for OpenCode's native --auto CLI flag when running in YOLO mode, replacing the configuration-based permission fallback for supported subcommands. It introduces version detection to ensure the local opencode binary is at least version 1.17.12 before applying the flag, along with argument parsing to correctly place --auto and avoid applying it to unsupported subcommands. Comprehensive unit tests have been added to verify this new behavior, including version gating, argument routing, and fallback scenarios. No review comments were provided, so there is no feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
--automode for the default TUI andrundenyrules--auto, and the append-safe bare--no-launchrecipeWhy
The current OpenCode integration approximates yolo with explicit
allowentries foredit,bash,webfetch, andexternal_directory. Current OpenCode has a native--automode that approves any permission request that is not explicitly denied, so the approximation can still prompt or reject other requests such asdoom_loopand protected.envreads.--autois command-scoped, so this inserts it only for the TUI/run, before a--separator.opencode --auto run ...is not equivalent toopencode run --auto ..., so the bare append-safe--no-launchcommand deliberately keeps the config fallback until the downstream subcommand is known.The flag is version-gated at 1.17.12, the first OpenCode release containing native auto mode.
Validation
runregressions both failed because--autowas absentpytest unsloth_cli/tests/test_start.py -q: 229 passed, 3 skippedruff checkandgit diff --check: passedrun, and global-flag-before-runforms parsed successfully with released OpenCode 1.18.2