Skip to content

fix(runtime): filter broken models from OpenCode Free probe candidates - #5185

Open
SummerC0zyR0ck wants to merge 1 commit into
apache:mainfrom
SummerC0zyR0ck:fix/opencode-free-probe-broken-models
Open

fix(runtime): filter broken models from OpenCode Free probe candidates#5185
SummerC0zyR0ck wants to merge 1 commit into
apache:mainfrom
SummerC0zyR0ck:fix/opencode-free-probe-broken-models

Conversation

@SummerC0zyR0ck

@SummerC0zyR0ck SummerC0zyR0ck commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Fixes #3449

OpenCode Free connection tests could still probe a quarantined model saved in enabledModelIds or defaultModel, even though the model catalog and execution authorization already rejected the same brokenModelIds entry.

This change makes the connection-test candidate path use the same quarantine authority as the catalog and execution paths:

  • filter quarantined enabled/default models before probing;
  • preserve the existing fallback order for healthy OpenCode Free models;
  • return a clear No model to test result when every candidate is quarantined;
  • keep explicit model tests unchanged;
  • do not introduce automatic in-turn failover, silent model switching, or new
    provenance behavior.

Verification

Focused Runtime regression coverage passed: 10 tests, 0 failures. The affected OpenCode Free connection-test suite verifies:

  • quarantined models persisted in enabledModelIds are excluded from probing;
  • a quarantined persisted defaultModel does not block selection of a healthy fallback;
  • when all enabled and fallback models are quarantined, no network request is issued and the result is No model to test;
  • customized OpenCode Free connections preserve their existing candidate order;
  • a successful fallback is selected after an error envelope or malformed completion from the first candidate;
  • explicitly requested models are tested once and do not trigger fallback probing;
  • anonymous OpenCode Free requests omit the Authorization header;
  • reasoning completions with content: null remain valid;
  • all fallback attempts share one overall timeout budget.

Build and static checks also passed:

  • Storage build;
  • Runtime build;
  • Runtime typecheck;
  • Biome checks for the changed Runtime source and test files.

The full repository test suite was not run.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex investigated the defect and fixed, authored the implementation review and Runtime/UI/TUI regression tests.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — connection tests no longer probe models quarantined by the provider
    registry; explicit model testing and manual model switching are unchanged.
  • No

@github-actions github-actions Bot added the effort/S Under 100 readable lines label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenCode Free: runtime model failover and health signals for per-request availability

1 participant