Skip to content

fix: force opencode as sole worker CLI, remove OAuth routing to claude CLI#2173

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/force-opencode-workers
Feb 22, 2026
Merged

fix: force opencode as sole worker CLI, remove OAuth routing to claude CLI#2173
marcusquinn merged 1 commit intomainfrom
bugfix/force-opencode-workers

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 22, 2026

Summary

  • Removes SUPERVISOR_PREFER_OAUTH and OAuth-aware routing that sent Anthropic model tasks to the claude CLI
  • OpenCode is now the only worker CLI (claude kept as last-resort fallback if opencode not installed)
  • SUPERVISOR_CLI env var override preserved for explicit user requests

Why

  1. Sandbox failures: The claude CLI sandbox blocks file creation even with bypassPermissions, causing permission_denied_write_operations failures (t1165 family, t1300 — 4 tasks failed repeatedly)
  2. No cost benefit: OpenCode already supports Anthropic OAuth subscription billing — routing through claude CLI provides zero marginal cost advantage
  3. Unverified context: The claude CLI has not been tested to load the full aidevops context chain (AGENTS.md, build.txt, subagents)

Files Changed

  • .agents/scripts/supervisor/dispatch.sh — simplified resolve_ai_cli() (+15/-37 lines)

Resolves the root cause behind #1762, #1763, #1764, #2106

Summary by CodeRabbit

  • Refactor

    • Simplified CLI selection logic for improved predictability
    • Updated fallback behavior with clearer messaging when options are unavailable
    • Removed conditional routing from CLI selection process
  • Documentation

    • Updated environment variable and argument documentation to reflect streamlined routing behavior

…e CLI

resolve_ai_cli() was routing Anthropic model tasks to the claude CLI
when OAuth was detected, causing permission_denied_write_operations
failures (t1165 family, t1300). The claude CLI sandbox blocks file
creation even with bypassPermissions.

OpenCode already supports Anthropic OAuth (subscription billing) so
there is no cost benefit to the claude CLI routing. Additionally, the
claude CLI has not been verified to load the full aidevops context
chain (AGENTS.md, build.txt, subagents).

Changes:
- Remove SUPERVISOR_PREFER_OAUTH and OAuth-aware routing logic
- OpenCode is now the only worker CLI (claude as last-resort fallback)
- SUPERVISOR_CLI env var override preserved for explicit user requests
- detect_claude_oauth() left as dead code (may be useful for future
  diagnostics)
@marcusquinn marcusquinn merged commit 279928c into main Feb 22, 2026
7 of 9 checks passed
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the AI CLI dispatch mechanism by designating opencode as the sole primary worker CLI. This change addresses issues with claude CLI sandbox failures during write operations and eliminates redundant OAuth-aware routing, as opencode already supports Anthropic OAuth billing. The update also ensures a more consistent and reliable context loading for AI tasks, resolving several reported worker failures.

Highlights

  • Removed OAuth-aware routing: The SUPERVISOR_PREFER_OAUTH environment variable and the associated logic for routing Anthropic model tasks to the claude CLI based on OAuth availability have been removed.
  • OpenCode as sole worker CLI: opencode is now established as the primary and preferred worker CLI for all tasks, including those involving Anthropic models with OAuth subscription billing.
  • Claude CLI as fallback: The claude CLI is retained only as a last-resort fallback if opencode is not installed, with a warning message encouraging opencode installation.
  • SUPERVISOR_CLI override preserved: The SUPERVISOR_CLI environment variable override for explicit user requests remains functional, allowing users to explicitly choose opencode or claude.
Changelog
  • .agents/scripts/supervisor/dispatch.sh
    • Updated comments in the resolve_ai_cli function to reflect the new routing priority, emphasizing opencode as the primary CLI and claude as a last-resort fallback.
    • Removed the SUPERVISOR_PREFER_OAUTH environment variable and all associated conditional logic for OAuth-aware routing to the claude CLI.
    • Modified the logic to directly prioritize opencode if installed, otherwise falling back to claude with a warning message.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request simplifies the CLI resolution logic in the dispatcher by removing OAuth-aware routing and establishing a straightforward precedence: explicit SUPERVISOR_CLI override, then opencode if installed, finally claude as fallback. Documentation and error handling have been updated to reflect this simpler approach.

Changes

Cohort / File(s) Summary
CLI Routing Simplification
.agents/scripts/supervisor/dispatch.sh
Refactored resolve_ai_cli() to remove OAuth-driven decision logic, replacing multi-step routing with direct opencode-first prioritization. Maintains SUPERVISOR_CLI override support with validation, adds fallback warning message, updates documentation blocks for arguments and environment variables.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #2080: Introduces SUPERVISOR_CLI override capability to resolve_ai_cli(); the current PR preserves this feature while simplifying the underlying auto-detection logic.
  • PR #1475: Adds Anthropic OAuth support via auth.json; the current PR removes OAuth-based CLI selection that depended on this capability.

Poem

Complexity shed like autumn leaves,
OAuth logic now takes its leave,
Opencode first, then claude's embrace—
Simplicity restored to this space. 🚀

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/force-opencode-workers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 40 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Feb 22 22:17:47 UTC 2026: Code review monitoring started
Sun Feb 22 22:17:48 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 40

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 40
  • VULNERABILITIES: 0

Generated on: Sun Feb 22 22:17:50 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

marcusquinn added a commit that referenced this pull request Feb 22, 2026
…tag t1165 family

- t1107: verify t1094 parent scope — was stuck-evaluating, not done
- t1108: audit 10 closed issues without PR linkage — never investigated
- t1110: issue-sync PR linkage guard — mis-categorised as superseded
- t1300: completed (root cause fixed in PR #2173)
- t1165/t1165.1/t1165.2: retagged #auto-dispatch, removed blocker labels
Copy link

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

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 simplifies the AI CLI resolution logic by making OpenCode the primary worker CLI and removing the complex OAuth-aware routing to the Claude CLI. This change addresses sandbox failures and permission issues encountered with the Claude CLI. The implementation correctly prioritizes user overrides via SUPERVISOR_CLI and provides a clear fallback path. I have a few suggestions regarding unused variables and ensuring the installation instructions in log messages use the correct package name.

# Last-resort fallback only if opencode is not installed
if command -v claude &>/dev/null; then
log_warn "Using deprecated claude CLI fallback. Install opencode: npm i -g opencode"
log_warn "opencode not found, falling back to claude CLI. Install opencode: npm i -g opencode"

Choose a reason for hiding this comment

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

medium

The package name for OpenCode was recently updated to opencode-ai (as noted in the changelog and setup.sh). The installation instruction in this warning message should be updated to reflect the correct package name to ensure users can install the tool successfully. Additionally, using the proper name 'OpenCode' improves clarity.

Suggested change
log_warn "opencode not found, falling back to claude CLI. Install opencode: npm i -g opencode"
log_warn "opencode not found, falling back to claude CLI. Install OpenCode: npm install -g opencode-ai"

marcusquinn added a commit that referenced this pull request Feb 22, 2026
… CLI)

3 tests expected claude CLI for Anthropic models, but PR #2173 removed
OAuth routing — opencode is now the sole worker CLI for all models.
Updated test expectations to match current behavior. 70/70 tests pass.
marcusquinn added a commit that referenced this pull request Feb 23, 2026
… CLI) (#2180)

3 tests expected claude CLI for Anthropic models, but PR #2173 removed
OAuth routing — opencode is now the sole worker CLI for all models.
Updated test expectations to match current behavior. 70/70 tests pass.
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