# Benchmark-informed fallback cascade

Status: implemented and verified. Publication and active runtime replacement
remain with the user. Telegram progress presentation stays deferred.

## User request

Try all free OpenCode models from highest capability to lowest before Hermes,
then descend through remaining keyless endpoints. Research published benchmarks
for the actual listed model versions to determine the stack. Do not derail the
ongoing inference compatibility repair.

## Findings and work

The prior helper tried configured providers first, preferred Nemotron over
stronger available models, and interleaved providers before exhausting OpenCode.
OpenCode's catalog provides no quality score; its upstream default follows
release date, which is not an intelligence ranking.

The [benchmark evidence](evidence/fallback-model-benchmarks-20261012.json) uses
current Artificial Analysis v4.3.2 plus original vendor coding evaluations.
Current comparable OpenCode order is Muse 1.3, Step 5, Ling 3.1, MiMo 2.6,
Nemotron 3.5. Three additional anonymous/unmeasured models remain eligible;
they are explicitly unranked rather than assigned fabricated scores. Free
gateway reasoning settings and checkpoint equivalence remain unverified.

Implement OpenCode-all → Hermes-all → remaining keyless merged by model quality
→ configured keyed tail. Preserve explicit configured-only policy, model-specific
and provider-wide quota scopes, schema adapters, tool/context/cost admission,
deadline bounds, manual permission and no replay after output. Do not delay
ready alternatives for a throttled higher route. Ready retries use original
cascade priority. Research scores must never confer free-access authority.

The [priority reference](../inference-fallback-priority.md) records the source
URLs, exact settings, unknown-model behavior and operational limitations.

## Acceptance

- A successful 512th OpenCode model produces zero lower-provider dispatches;
  full OpenCode exhaustion reaches Hermes only after all eligible OpenCode rows.
- A stronger measured nonpreferred model precedes a weaker seed. Catalog or
  registry row order does not change selection. Newly discovered unknown models
  remain included; incompatible or nonfree rows remain excluded.
- Remaining providers merge by model quality, so a weak alternative does not
  preempt a stronger model at another endpoint. Opaque selectors claim no fixed
  benchmark identity.
- Cooldowns immediately allow ready alternatives; recovery returns to higher
  routes. Stop, stale ownership, total deadlines and bounded retries still hold.
- Verify source suites, complete workspace build, freshly installed package and
  actual bundled backend ordering/schema checks. Commit and push scoped work.

## Verification receipt

542 orchestrator tests passed with one existing skip; 122 CLI tests passed.
The complete workspace build, package bundle, README/tarball audit and fresh
compiler-free global npm installation passed. SQLite, CLI and library loaded.

The [freshly installed backend receipt](evidence/fallback-quality-installed-20261012.json)
records 64/64 mocked transport cases passing. Six reach the 512th OpenCode alias
with zero other-provider generations; two prove benchmark preference over the
Nemotron seed and larger unmeasured context limits; two exhaust ten eligible
keyless aliases before the configured keyed tail. Native tool, Responses,
structured validation and the original-schema `uniqueItems` regressions remain
green. These checks made no real inference requests or Telegram sends.

Prepared artifact: `publish/omnius-1.0.848.tgz`, SHA-256
`2f0b02299333dea363eaa93c8e1f7e10a4371aeb3388fba35e6a3a39359c8611`.
Its bundled backend SHA-256 is
`651aa2819b85678d8aac1fa84f9e9c6fd7a088d17645d9cd212b00500bcf468c`.
No publication or active runtime restart was performed.
