fix(sse): park request with heartbeat after repeated transient 429s, replay one capped leg - #13924
Merged
diegosouzapw merged 1 commit intoSep 21, 2026
Conversation
maxmad64bis
force-pushed
the
feat/n95-park-fanout
branch
3 times, most recently
from
September 16, 2026 21:15
d7c5ffb to
7b84ef5
Compare
maxmad64bis
marked this pull request as ready for review
September 16, 2026 21:16
maxmad64bis
force-pushed
the
feat/n95-park-fanout
branch
2 times, most recently
from
September 16, 2026 22:20
3cfb3c7 to
847cff7
Compare
5 tasks
maxmad64bis
force-pushed
the
feat/n95-park-fanout
branch
from
September 19, 2026 21:03
496a463 to
9da4b42
Compare
…replay one capped leg
maxmad64bis
force-pushed
the
feat/n95-park-fanout
branch
from
September 20, 2026 09:09
a42ee0b to
0f0368d
Compare
This was referenced Sep 20, 2026
diegosouzapw
merged commit Sep 21, 2026
893fef9
into
diegosouzapw:release/v3.8.51
7 of 16 checks passed
diegosouzapw
added a commit
to maxmad64bis/OmniRoute
that referenced
this pull request
Sep 21, 2026
…w#13924 rewrite Merges origin/release/v3.8.51 (which already carries diegosouzapw#13924's rewrite, squash-merged as 893fef9) into this PR branch. The three conflicting paths (open-sse/executors/opencode.ts, tests/unit/opencode-429-park-resume.test.ts, config/quality/file-size-baseline.json) are resolved to base's diegosouzapw#13924 semantics plus only diegosouzapw#14290's own egress-throttle additions (opencodeEgressThrottle.ts + its dedicated test file, untouched). Default-off (OPENCODE_EGRESS_THROTTLE_ENABLED unset): behavior is byte-identical to the tip, proven by the existing "env-module off by default: everything is a no-op" test plus the full opencode-* suite (101/101 passing). With the flag on, the new fleet-suspect slot-budget hands over to diegosouzapw#13924's park-and-replay path instead of returning the last 429, proven by the added handover test. Also fixes a rebaseline-note label carried over from the PR's own commit (wrong PR number, stray non-English word) in config/quality/file-size-baseline.json. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw
added a commit
that referenced
this pull request
Sep 21, 2026
…on, opt-in (#14290) Per-egress pacing and fleet-wide suspect backoff for OpenCode free-tier rotation, layered on #13924's park-and-replay: paces requests per egress identity, marks an egress fleet-suspect after repeated transient 429s, and hands a suspect slot budget over to the park/heartbeat path instead of surfacing the last 429. Opt-in via OPENCODE_EGRESS_THROTTLE_ENABLED (default off) — with the flag off every hook is a no-op and behavior is identical to the tip. Stacked on #13924 (merged as 893fef9); reconciled onto the merged form. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
5 tasks
diegosouzapw
added a commit
that referenced
this pull request
Sep 24, 2026
…nked markers (#14487) The external pool watcher (#13924) writes /tmp/opencode-pool-strain.json; moving the default under DATA_DIR would silently stop reading it. Keep the default and make the shared path safe instead: lstat (never follow a planted symlink), require a regular file owned by the process uid with no group/other write bit, bounded read. ENVIRONMENT.md reverted to the /tmp default so it stays in sync with .env.example and the i18n mirrors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repeated transient 429s from the opencode rotation used to sweep every account in the fleet, burning cooldown budget for no gain. After 6 consecutive transient 429s (or a fresh local pool-strain signal), the request now waits with a heartbeat and then retries through at most 3 accounts in order instead of sweeping the whole fleet. Default behavior is unchanged: the wait-and-retry path runs only when
OPENCODE_PARK_AND_RESUMEis set.Related Issues
Validation
npm run lintTests Added Or Updated
tests/unit/opencode-429-park-resume.test.ts(new, 7 cases: below-threshold rotation, threshold park with heartbeat and capped replay, fresh/stale/future strain signal, flag off, client abort mid-wait).tests/unit/feature-flags-settings.test.ts(flag count 72 to 73),docs/reference/FEATURE_FLAGS.md(catalog row),.env.example+docs/reference/ENVIRONMENT.md(OPENCODE_PARK_AND_RESUMEandOPENCODE_POOL_STRAIN_MARKER_PATH).tests/unit/opencode-transient-rotation.test.ts,tests/unit/opencode-rate-limited-classify.test.ts.Coverage Notes
open-sse/executors/opencode.ts(+40-line call site) is covered by the new test through the dispatch path; the park/replay helperopen-sse/executors/opencodeParkResume.tsis covered by all 7 new cases.open-sse/executors/opencode.ts(1185 to 1226, irreducible call site; logic lives in the new 258-line module under the cap).Reviewer Notes
OPENCODE_PARK_AND_RESUMEdefaults to off (fail-closed); with the flag off every 429 rotates exactly as before.release/v3.8.51fails the same 9 jobs (API Route Typecheck, Docs Gates, Fast Quality Gates, Merge integrity, ESLint, Unit fast-path 1-4/4); every file cited by the failing gates is outside this diff. Non-blocking for this PR.