Skip to content

fix(supervisor): map opencode's --auto flag so autonomous dispatch accepts it - #468

Merged
getappz merged 3 commits into
masterfrom
task/103
Aug 12, 2026
Merged

fix(supervisor): map opencode's --auto flag so autonomous dispatch accepts it#468
getappz merged 3 commits into
masterfrom
task/103

Conversation

@getappz

@getappz getappz commented Aug 12, 2026

Copy link
Copy Markdown
Owner
  • fix(supervisor): map opencode's --auto flag so autonomous dispatch accepts it

Summary by CodeRabbit

  • New Features

    • Opencode now runs with automatic execution enabled by default.
  • Bug Fixes

    • Improved autonomous-agent detection and handling for Opencode.
    • Updated agent classification to accurately distinguish confirmed and unconfirmed autonomous agents.

…cepts it

resolve_confirmed_agent requires autonomous_args() to return Some before
dispatching, as a safety gate against agents with no known permission-bypass
flag. opencode's entry was None, so items assigned to it were silently
skipped by the discovery tick forever (dispatched 0, skipped 1 every tick).

opencode run --help confirms --auto: "auto-approve permissions that are
not explicitly denied" -- the same role --dangerously-skip-permissions
plays for claude-code. Mapped it in autonomous_args, flipped the now-wrong
resolve_confirmed_agent_rejects_opencode test to
resolve_confirmed_agent_accepts_opencode, and switched
unconfirmed_agent_gets_skipped_not_dispatched's example agent from opencode
(now confirmed) to cursor (still unmapped).

Agentflare-Agent: claude-code
Agentflare-Branch: task/103
Agentflare-Item: 103
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fbb187c5-34fb-41ea-895e-1098a4546ac1

📥 Commits

Reviewing files that changed from the base of the PR and between 2a5e752 and f027b34.

📒 Files selected for processing (4)
  • src/cli/work.rs
  • src/quota/decide.rs
  • src/supervisor.rs
  • src/supervisor_tests.rs
📝 Walkthrough

Walkthrough

The agent registry now returns --auto for Agent::Opencode. Supervisor tests recognize Opencode as autonomous and use Cursor for the unconfirmed-agent case.

Changes

Opencode autonomy

Layer / File(s) Summary
Autonomous-mode mapping and validation
crates/agent-registry/src/registry.rs, src/supervisor.rs
Agent::Opencode now receives --auto instead of no argument. Supervisor tests confirm Opencode as autonomous and use cursor for the unconfirmed-agent case.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete and omits the required Summary, Test plan, and Notes for reviewers sections. Add the required sections and describe the change, test status, risk areas, and backward compatibility.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: mapping OpenCode's --auto flag for autonomous dispatch.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/103

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/supervisor.rs (1)

596-600: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the exact autonomous argument.

This test verifies agent recognition only. It would also pass if Agent::Opencode returned an incorrect non-empty argument. Add an assertion for autonomous_args(Agent::Opencode) == Some(&["--auto"]), or verify that the dispatched command contains run and --auto.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/supervisor.rs` around lines 596 - 600, Extend
resolve_confirmed_agent_accepts_opencode to assert the exact autonomous
arguments for Agent::Opencode, verifying autonomous_args returns
Some(&["--auto"]). Keep the existing agent-recognition assertion and use the
established autonomous_args helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/supervisor.rs`:
- Around line 596-600: Extend resolve_confirmed_agent_accepts_opencode to assert
the exact autonomous arguments for Agent::Opencode, verifying autonomous_args
returns Some(&["--auto"]). Keep the existing agent-recognition assertion and use
the established autonomous_args helper.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7db20c01-c893-4f72-97ed-c7567d93ed7d

📥 Commits

Reviewing files that changed from the base of the PR and between 8aa2da2 and 2a5e752.

📒 Files selected for processing (2)
  • crates/agent-registry/src/registry.rs
  • src/supervisor.rs

shiva added 2 commits August 12, 2026 20:18
…was unconfirmed

Same class of breakage as the supervisor.rs test fixed in the prior commit --
src/quota/decide.rs's decide() calls the same supervisor::resolve_confirmed_agent,
and this test used opencode as its 'definitely unconfirmed' example. Switched to
cursor, matching the supervisor.rs fix.

Agentflare-Agent: claude-code
Agentflare-Branch: task/103
Agentflare-Item: 103
…gh to --model

Adds WorkArgs.model (agentflare work --model <name>, CLI) and a matching
metadata.model item field (read by supervisor::item_model_override) for
autonomous dispatch -- set via handoff/item update's metadata, e.g.
{"model": "anthropic/claude-sonnet-5"}. Threaded through enqueue_work_job's
job args and WorkItemExecutor::execute the same way folder_path already is,
then appended in build_extra_args as --model <name> for any confirmed agent
(claude-code and opencode's --help both confirm the same flag spelling).

No allowlist: passed straight through with no validation against a hardcoded
model list, since catalogs change too often to keep in sync and the
underlying agent CLI already rejects an unknown name itself.

Also splits supervisor.rs's test module out to supervisor_tests.rs (pure
code motion, #[path] attribute) -- the new tests pushed it over the repo's
1500-line LOC gate.

Agentflare-Agent: claude-code
Agentflare-Branch: task/103
Agentflare-Item: 103
@getappz
getappz merged commit 59ec6a8 into master Aug 12, 2026
16 checks passed
@getappz
getappz deleted the task/103 branch August 12, 2026 15:07
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