Skip to content

feat(subagents): add per-role first fallback dispatch - #116

Open
thisisjun786 wants to merge 6 commits into
lidge-jun:devfrom
thisisjun786:codex/subagent-first-fallback
Open

feat(subagents): add per-role first fallback dispatch#116
thisisjun786 wants to merge 6 commits into
lidge-jun:devfrom
thisisjun786:codex/subagent-first-fallback

Conversation

@thisisjun786

@thisisjun786 thisisjun786 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Problem and behavior

Subagent roles currently select one model, so an exhausted provider path cannot hand the task to a configured alternative. Add one optional fallback model and effort for explorer, reviewer and executor, preserving provider-qualified catalog IDs and global/project inheritance.

For a managed dispatch, xai/grok-4.6 can fall back once to cursor/grok-4.6. If both attempts fail with eligible errors, the dispatcher returns main-direct for the main agent to finish the remaining work. This does not spawn another child on the main model. Reviewer exhaustion still requires independent review evidence.

Implementation

  • Expose fallback configuration in the GUI, CLI and MCP; normalize old config to no fallback.
  • Persist the main-owned start/claim/report protocol and consume each native spawn marker once. Ambiguous execution requires child/workspace reconciliation before another attempt.
  • Add SessionStart guidance and apply each claimed candidate through the spawn hook, including independent fallback effort.
  • Decode observed Codex 0.153.4 HTTP/SSE error transformations. Permission codes remain ineligible; unknown errors remain conservative.
  • Update compiled runtime artifacts, hook inventory and documentation.

Verification

  • Full repository suite: 2,750 passed, 0 failed, 71 skipped (2,821 total; after merging upstream dev 3f9d22e5).
  • Build: 166 runtime files; GUI build and typechecks passed. Final decoder strict typecheck and repository gate passed.
  • Real isolated Codex + loopback provider: 24/24 scenarios passed, covering all three roles, normal completion, HTTP/SSE quota and server failures, permission denial, fallback success and exhaustion. Observed outbound routes were xai/grok-4.6/high then cursor/grok-4.6/low, with exact attempt-count and reviewer-independence assertions.
  • Regression tests failed before the native-error fix and passed afterward. Earlier independent feature review passed.
  • Browser/API checks covered persistence, validation, inheritance and widths 1440/768/390/320. The screenshot below uses fixture models; subsequent changes did not alter UI code.

Scope and remaining verification

This is a main-followed managed protocol, not transparent retry for arbitrary native spawn calls. Native testing scripts the main's protocol choices and uses the production hook commands as isolated trusted user hooks. It does not establish unscripted main-model compliance, code-mode/custom-native-role behavior, full plugin installation, live OCX/provider quota behavior, or the main's actual work after main-direct. HTTP 403 prose conservatively returns reconcile.

Detailed before/after evidence summaries are in devlog/_fin/260909_subagent_first_fallback/012_isolated_native_verification.md and 013_native_error_fix.md. Latest upstream integration and full-suite evidence are recorded in 015_upstream_integration.md. Fallback source/runtime and UI are unchanged by that merge; hook inventory now contains 25 hooks. Publication commits use the author’s GitHub noreply address.

Fallback settings with fixture provider routes

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