test(cli): warm plugin import pipeline and share plugin fixture#9569
Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Open
test(cli): warm plugin import pipeline and share plugin fixture#9569kilo-code-bot[bot] wants to merge 1 commit intomainfrom
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Conversation
The two plugin tests in provider.test.ts that were spuriously failing on Windows CI each wrote a unique .opencode/plugin/*.ts file into a fresh tmp dir and then triggered a cold Bun TS import. Cold .ts imports on Windows can exceed 30 s which caused the test timeout. - Add a shared plugin fixture (test/fixture/plugins/config-mutator.ts) that accepts tuple options to mutate provider, enabled_providers, and disabled_providers. The two tests now reference this single file so Bun's module cache short-circuits after the first import. - Warm Bun's TS import pipeline by importing the fixture once during test/preload.ts so the first test to hit the plugin loader does not pay the full cold-start cost. Provider test suite drops from ~88 s to ~46 s locally and both plugin tests now complete well inside the 30 s per-test ceiling.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by gpt-5.4-2026-03-05 · 404,915 tokens |
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
Alternative fix for the spurious Windows failures in
packages/opencode/test/provider/provider.test.ts(see #9566 for the root-cause fix in Provider.layer).The two failing tests each wrote a unique
.opencode/plugin/*.tsfile into a fresh tmp dir and triggered a cold Bun TSimport(). On Windows that cold transpile exceeded the 30 s per-test ceiling.test/fixture/plugins/config-mutator.tsthat accepts tuple options to mutateprovider,enabled_providers, anddisabled_providers. The two tests now reference this single file viaconfig.plugin, so Bun's module cache short-circuits after the first import.import()ing the fixture once duringtest/preload.tsso the first plugin-loading test does not pay the full cold-start cost.Why not the other approach
This is a pure test-infrastructure change -- it does not touch
src/and does not alter runtime behavior. #9566 changes Provider.layer ordering; this PR is the safer alternative when the ordering fix is not desirable.How to test
Provider test file drops from ~88 s to ~46 s locally and both plugin tests complete inside the 30 s per-test ceiling.