Skip to content

fix(opencode): only a refusal naming the model clears borrowed tools - #15475

Merged
diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/free-tier-429-not-tool-refusal
Oct 6, 2026
Merged

diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/free-tier-429-not-tool-refusal

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #15306

Summary

Requests that reuse stored tool names lost them after three failures of any kind, so a busy model answered with 429 and the next request went out bare, then drew a 403.

This change counts a refusal only when a 403 or 451 response names the model — every notation site passes such a verdict — and a 200 on reused names clears the refusal streak while the stored entry stays in place.

The stored names now survive 429 answers, and the request after them still carries the working tool shape.

Related Issues

  • No linked issue — reproduced on the release base

Validation

  • Change type: provider
  • 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-request-contract.test.ts: three 429 answers on reused names keep the stored names, three 403 answers carrying the refusal still clear them after the third, a 200 on reused names resets the streak to one, unrelated refusals never touch the stored names, notes without a verdict never count, and a deferred 403 verdict still counts

Coverage Notes

  • open-sse/executors/opencodeFreeTierContract.ts: covered by the request-contract suite (discriminant guard and streak confirmation cases)
  • open-sse/executors/opencode.ts: covered by the request-contract, shape-retry, refusal-rotation, and balance shard suites (notification sites)
  • open-sse/executors/opencodeRequestShape.ts: covered by the shape-retry suite (verdict read once, replayed note)
  • open-sse/executors/opencodeToolObservation.ts: covered by the request-contract suite (confirmation and threshold cases)

Reviewer Notes

A 429 no longer counts as a tool refusal; a 200 on borrowed tools confirms the shape.
@maxmad64bis
maxmad64bis force-pushed the fix/free-tier-429-not-tool-refusal branch from cc43ed0 to 81cc3ea Compare October 4, 2026 15:37
@diegosouzapw
diegosouzapw merged commit 3d43b67 into diegosouzapw:release/v3.8.52 Oct 6, 2026
6 of 9 checks passed
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