Skip to content

Class fallback chains (second-pass escalation, visited-set semantics) + guard extension - #9385

Merged
dezren39 merged 1 commit into
mainfrom
model-trials/class-fallbacks
Nov 13, 2026
Merged

dezren39 merged 1 commit into
mainfrom
model-trials/class-fallbacks

Conversation

@dezren39

@dezren39 dezren39 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Drew 2026-11-13. Implements the confirmed class fallback edges as the FINAL targets of each class route (regular chain first, completely; fallback = second pass on exhaustion only):

  • small → speed
  • speed → workhorse → summit → specialist
  • workhorse → scout → specialist (scout first, per main's recommendation to Drew: workhorse's failure mode is quota exhaustion and scout diversifies onto different doors — free Beam via CommandCode + low rungs; one-line swap if Drew picks speed-class instead)
  • summit → specialist
  • specialist = sink (no edges out)
  • PROPOSALS (marked as such in config + doc): scout → workhorse; background → workhorse

Semantics (Drew, pinned 2026-11-13): per-call visited set — a class already tried in the call is never re-entered; the walk is transitive and depth-first (an exhausted fallback subtree resumes the caller's remaining edges), terminating at specialist. Mechanism is the existing machinery, not new proxy code: the fork's route expander (model-routes plugin) carries the expansion path and prunes re-entry into a route already on it, which is exactly the visited-set rule; the workhorse stage chain already proves last-target escalation.

Guard (bin/check-opencode-route-rules.mjs): CLASS_FALLBACKS table kept in lockstep with the config — (a) drift check: each class route must end with its declared chain; (b) every class reaches specialist through the fallback graph; (c) simulated escalation walk (depth-first, visited set) reaches specialist from every class; (d) static cycle check over the whole composition graph EXCLUDING declared fallback pairs, reporting the cycle path. The tier resolver no longer flags declared fallback re-entries (workhorse<->scout) as model-route cycles. The walk simulation caught and fixed a real modeling bug during development (greedy first-edge walk strands at scout; the true router semantics resume the caller's chain).

Full layout for all 34 routes (classes, stages, *-plan door failover, provider routes): .opencode/route-fallbacks.md, added in this PR.

Tests: 97 pass / 0 fail across the guard suites, including 5 new fallback tests (layout pass, drift, composition cycle path, reachability, walk). Canonical config passes the extended guard. No restart; rides the coordinated switch.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Drew 2026-11-13 (final edges + pinned semantics). Edges wired as the final targets of each class route: small -> speed; speed -> workhorse, summit, specialist; workhorse -> scout, specialist (scout first per main recommendation - failure mode is quota exhaustion, scout diversifies doors); summit -> specialist; specialist = sink; scout -> workhorse and background -> workhorse as marked PROPOSALS. Semantics: regular chain first and completely, fallback as second pass on exhaustion only, walked transitively under a per-call visited set (fork route expander prunes re-entry into a route already on the expansion path; exhausted subtrees resume the caller remaining edges), terminating at specialist. Guard extended: declared-chain drift check, sink reachability, simulated escalation walk, whole-graph composition cycle check excluding declared fallback pairs; tier resolver no longer reports declared fallback re-entries as cycles. Full per-route layout: .opencode/route-fallbacks.md (all 34 routes). No restart - rides the coordinated switch.
@dezren39
dezren39 requested a review from a team as a code owner November 13, 2026 08:34
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-13T08:34:58.009060Z
We couldn’t complete this review. Comment @codex review to try again.
ce12993 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 7ef20ce into main Nov 13, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 deleted the model-trials/class-fallbacks branch November 13, 2026 08:35
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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