Skip to content

fix(opencode): keep each request on its own member list - #14323

Closed
maxmad64bis wants to merge 2 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/opencode-accounts-scope
Closed

maxmad64bis wants to merge 2 commits into
diegosouzapw:release/v3.8.51from
maxmad64bis:fix/opencode-accounts-scope

Conversation

@maxmad64bis

Copy link
Copy Markdown
Contributor

Stacked on #14149. This branch is cut from #14149 and will be rebased after it merges.

Summary

  • Before: two concurrent requests on one shared executor could replace each other's member list mid-run → After: each request walks its own member list built from its own credentials.
  • The per-request list reuses the parent request-keyed state pattern (state indexed by request body identity, never on the shared instance); the shared pick index is kept and clamped to the local list, and per-member health is kept in a named store with write-back so selection order for a single request is unchanged.

Related Issues

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-accounts-per-request.test.ts — overlap isolation for two interleaved requests with different credentials, shared pick-index continuity across sequential requests, cooldown survival across re-sync, cold default member, and fleet to direct to fleet index reset.
  • New test file passes 5/5; neighbouring executor suites pass with 0 failures.

Coverage Notes

  • The changed executor paths in open-sse/executors/opencode.ts and the new open-sse/executors/opencodeAccountScope.ts are covered by the new overlap test (isolation, index continuity, health write-back) plus the existing neighbouring executor tests that guard single-request selection order.
  • No coverage drop is expected in the touched files; any move will be recovered with an added case in the same new test file.

Reviewer Notes

  • Delta vs the parent base: 1 commit touching open-sse/executors/opencode.ts, new open-sse/executors/opencodeAccountScope.ts, and one new test file; rebase needed once fix(opencode): keep the target format and client session per request, not on the shared executor #14149 merges.
  • Behaviour to check: shared pick index kept (reset only on the single direct-member path), per-member health preserved across re-sync, entry reuse when the same request body re-enters, release in execute.
  • Manual check: two concurrent requests on two connections of the same alias each dispatch on their own list, with masked identifiers only in logs.

Max added 2 commits September 20, 2026 11:13
…s are refused

Tool-shape refusal replays once in the other shape and remembers the working shape per prompt digest.
@maxmad64bis
maxmad64bis force-pushed the fix/opencode-accounts-scope branch from 6777c55 to 26e9507 Compare September 21, 2026 15:03
@maxmad64bis

Copy link
Copy Markdown
Contributor Author

Superseded by #14353 — rebuilt as a fresh PR on the current release base (park/pacing reconciled, no parent dependency).

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