Repository navigation
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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18d73f7360
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "completion acp mcp attach debug providers auth agent upgrade uninstall serve web " | ||
| "models stats export import github pr session plugin plug db".split() |
There was a problem hiding this comment.
Add missing OpenCode utility commands to fallback list
When --yolo is used with OpenCode utility commands that are not in this denylist, _opencode_native_auto_args treats the first word as a TUI project path and appends --auto. Current OpenCode registers top-level console and generate commands, while --auto is only defined for the TUI/run, so commands such as unsloth start opencode --yolo --no-launch console login or ... generate now become strict-CLI unknown-argument failures instead of using the config fallback as before.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in dfd3315. Added the hidden console and generate commands to the native-auto denylist, so --yolo now keeps the config permission fallback for them instead of appending --auto to a command OpenCode rejects. Verified against opencode 1.18.3 that both reject --auto and now run cleanly.
| if arg.startswith("-"): | ||
| return None |
There was a problem hiding this comment.
Preserve yolo behavior for OpenCode --mini
When the passthrough starts the mini interface, e.g. unsloth start opencode --yolo --no-launch --mini, this branch classifies --mini as an auto-capable TUI option, so write_opencode_config is called with yolo=False and the config fallback is omitted. In OpenCode 1.18.x, the TUI --mini path calls runMini(...) without forwarding args.auto, and runMini invokes RunCommand with auto: false, so the appended --auto is ignored and permission prompts are no longer auto-approved for that mode.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in dfd3315. --mini now routes through the config permission fallback, since runMini always runs with auto=false and never forwards --auto, so appending --auto silently disabled auto-approval. The fallback restores it.
Add the hidden console and generate commands to the native-auto denylist so --yolo does not append --auto to a subcommand OpenCode rejects, and route --mini through the config permission block since runMini always runs with auto=false and never forwards --auto.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
left a comment
There was a problem hiding this comment.
Reviewed: routes OpenCode --yolo to native --auto with correct fallback for no-auto commands (console/generate) and --mini. Verified against opencode 1.18.3.
Route --yolo to OpenCode native --auto for the default TUI and run; keep the config permission fallback for no-auto subcommands (including hidden console/generate) and for --mini, which ignores --auto.
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