Skip to content

fix(auth): pause only the refused model on the no-auth path - #15443

Merged
diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/opencode-pause-per-model
Oct 6, 2026
Merged

diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/opencode-pause-per-model

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #15402. Only the last commit is this PR's; I'll rebase once it lands.

⚠️ base-red inherited: #15306

Summary

A free-tier refusal used to pause the whole provider for about three minutes and now pauses only the refused model, because the pause key holds the provider plus the model. Users saw healthy sibling models skipped after one unrelated refusal, since the key held only the provider name while each request targets one provider plus one model. Now the refused model alone waits out its pause while siblings keep serving, and a refusal recorded without a model still covers the whole provider as before.

Related Issues

Validation

  • Change type: routing
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/opencode-free-tier-per-model-pause.test.ts: 14 cases covering sibling isolation, refused-model pause and expiry, combo-filter scoping, the no-auth pause envelope, model-less reads, unknown and blank models, normalization, the entry bound, and the non-family guard.

Coverage Notes

  • open-sse/services/opencodeFreeTierSkip.ts: covered by the new per-model test (isolation, expiry, eviction, normalization, non-family guard).
  • open-sse/services/autoCombo/resilienceCandidateFilter.ts: covered by the new per-model test (filter drops only the refused model; pool scenario).
  • src/sse/services/noAuthModelCooldown.ts: covered by the new per-model test (envelope fires for the refused model only) plus the existing no-auth pause suite (unchanged, green).
  • open-sse/handlers/chatCore.ts: one-line write threading, guarded by the existing no-auth suites driving the chat handler (unchanged, green), key semantics covered by the new per-model test.
  • src/sse/services/auth.ts: four-site model threading, non-regression guarded by the existing no-auth suites (unchanged, green), pause semantics covered by the new per-model test.

Reviewer Notes

Paused no-auth selection returned null (401); now returns a connection-scoped 429 cooldown, proven by 16 passing selection tests (incl. combo fallthrough).
A free-tier refusal scoped to one model left siblings blocked; the pause key now includes the model.
@maxmad64bis
maxmad64bis force-pushed the fix/opencode-pause-per-model branch from c69fb0a to fb5ceba Compare October 4, 2026 15:30
@diegosouzapw
diegosouzapw merged commit a1f3d32 into diegosouzapw:release/v3.8.52 Oct 6, 2026
5 of 7 checks passed
diegosouzapw pushed a commit that referenced this pull request Oct 6, 2026
Onda 8. Este squash entra com o crédito de @maxmad64bis (fix(noauth): show active free-tier pauses on the account card).

#15402 e #15443 já estavam neste branch e entram com ele. O comportamento que o #15436 já publicou ficou o da release. O cartão de pausa e a rota de visibilidade são deste PR. O teto de file-size fica para o follow-up da onda.

⚠️ base-red inherited: #15306

Obrigado, @maxmad64bis.
@maxmad64bis
maxmad64bis deleted the fix/opencode-pause-per-model branch October 7, 2026 20:37
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.

2 participants