Repository navigation
test(plugin): wait for the v2 lazy-refresh tier instead of sleeping past it - #12984
Merged
Merged
Conversation
…ast it
`lazy refresh: [m1] then [m1,m2] reloads once; identical runs never reload`
waited for the plugin's asynchronous optional tier with a fixed `await sleep(5)`.
That is a race, not a wait: when the tier landed after the sleep, its reload was
still pending, so the next assertion counted it and read
AssertionError: an identical run never reloads
2 !== 1
The test file fails on every isolated run on the current release tip; it only
passed when the whole suite ran together and unrelated work happened to give the
tier enough slack.
Replaces both sleeps with a `settle()` helper that polls until the observed value
holds steady for three consecutive turns (5s ceiling), so the wait tracks the
work rather than the clock. The assertions are unchanged — this fixes how the
test waits, not what it checks.
The failure was invisible to the base-green sweep because
`.github/workflows/opencode-plugin-ci.yml` filters on
`paths: @omniroute/opencode-plugin*/**`, so the job only runs when the plugin
directories change and the nightly sweep never triggers it.
Isolated file: 6/6 runs green (was 0/6). Full v2 suite: 218/218. Build passes.
Githab-capibara
added a commit
to Githab-capibara/OmniRoute
that referenced
this pull request
Sep 17, 2026
…ast it (diegosouzapw#12984) Merged as part of the owner batch of 2026-09-11. This PR had a live worktree in another session, so it sat outside the main 39. Merged on your explicit call, validated first rather than taken on trust: boarded with the other 10 worktree-held PRs into a consolidated worktree off `release/v3.8.51`. - ESLint over every changed file: no errors - `typecheck:core` clean; `check:dashboard-typecheck` OK; `check:changelog-integrity` OK - complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 - 203 of 208 assertions green. The 5 remaining (`guide-settings-route` ×4, `hard-session-lease-bypass-inventory` ×1) reproduce on the pure tip with nothing from this batch applied. - `imageGeneration.ts` rebaselined 3259 → 3293 for diegosouzapw#12945's image-only-model guard, landed separately in diegosouzapw#13392 so nothing was pushed onto a live branch.⚠️ base-red inherited: diegosouzapw#12732 — provider count 356 vs 358 and `open-sse/utils/stream.ts` 3115 > frozen 3098, both reproducing on the pure tip.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…ast it (diegosouzapw#12984) Merged as part of the owner batch of 2026-09-11. This PR had a live worktree in another session, so it sat outside the main 39. Merged on your explicit call, validated first rather than taken on trust: boarded with the other 10 worktree-held PRs into a consolidated worktree off `release/v3.8.51`. - ESLint over every changed file: no errors - `typecheck:core` clean; `check:dashboard-typecheck` OK; `check:changelog-integrity` OK - complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 - 203 of 208 assertions green. The 5 remaining (`guide-settings-route` ×4, `hard-session-lease-bypass-inventory` ×1) reproduce on the pure tip with nothing from this batch applied. - `imageGeneration.ts` rebaselined 3259 → 3293 for diegosouzapw#12945's image-only-model guard, landed separately in diegosouzapw#13392 so nothing was pushed onto a live branch.⚠️ base-red inherited: diegosouzapw#12732 — provider count 356 vs 358 and `open-sse/utils/stream.ts` 3115 > frozen 3098, both reproducing on the pure tip.
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.
Fixes a pre-existing race in the opencode plugin v2 suite. Surfaced by #12965 —
that PR is a dependency bump and does not cause this; it is simply the first PR
in a while to touch
@omniroute/opencode-plugin-v2/, which is what makes the jobrun at all.
The race
lazy refresh: [m1] then [m1,m2] reloads once; identical runs never reloadwaitsfor the plugin's asynchronous optional tier with a fixed
await sleep(5). Whenthe tier lands after that sleep, its reload is still pending and the next
assertion counts it:
The file fails on every isolated run against the current
release/v3.8.51tip, with no changes applied. It only passed when the whole suite ran together
and unrelated work happened to give the tier enough slack — which is why the
green local
npm testand the red CI job disagreed.The fix
Both sleeps become
await settle(() => reloads): poll until the observed valueholds steady for three consecutive turns, with a 5s ceiling. The wait now tracks
the work instead of the clock. The assertions themselves are untouched —
this changes how the test waits, not what it verifies.
Why nobody saw it
.github/workflows/opencode-plugin-ci.ymlfilters onso
Test v2only runs when those directories change. The nightly release-greensweep never triggers it, and the failure stayed off the base-red radar.
Validation
tests/index.test.tsisolated, 6 runsnpm test)npm run build(tsup)prettier --checkDiff is one file:
@omniroute/opencode-plugin-v2/tests/index.test.ts.release/v3.8.51is not green; any failingcheck outside
Test v2on this PR comes from the tip, not from this branch.