Skip to content

Route OpenCode yolo aliases to native auto mode#7187

Draft
Imagineer99 wants to merge 1 commit into
unslothai:mainfrom
Imagineer99:fix/opencode-native-auto
Draft

Route OpenCode yolo aliases to native auto mode#7187
Imagineer99 wants to merge 1 commit into
unslothai:mainfrom
Imagineer99:fix/opencode-native-auto

Conversation

@Imagineer99

Copy link
Copy Markdown
Collaborator

Summary

  • route Unsloth's normalized approval aliases to OpenCode's native --auto mode for the default TUI and run
  • omit the high-priority permission overlay on native-auto launches so OpenCode still enforces explicit deny rules
  • retain the existing config fallback for OpenCode before 1.17.12, utility subcommands that do not accept --auto, and the append-safe bare --no-launch recipe

Why

The current OpenCode integration approximates yolo with explicit allow entries for edit, bash, webfetch, and external_directory. Current OpenCode has a native --auto mode that approves any permission request that is not explicitly denied, so the approximation can still prompt or reject other requests such as doom_loop and protected .env reads.

--auto is command-scoped, so this inserts it only for the TUI/run, before a -- separator. opencode --auto run ... is not equivalent to opencode run --auto ..., so the bare append-safe --no-launch command 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

  • negative proof on latest main: the new TUI-resume and run regressions both failed because --auto was absent
  • pytest unsloth_cli/tests/test_start.py -q: 229 passed, 3 skipped
  • broader CLI suite excluding two unrelated frontend-build failures reproduced unchanged on clean main: 482 passed, 3 skipped, 2 deselected
  • ruff check and git diff --check: passed
  • generated TUI, resumed-TUI, run, and global-flag-before-run forms parsed successfully with released OpenCode 1.18.2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant