test: the suite does not start real `@opencode-ai/plugin` installs
Issue for this PR
No issue is filed yet. This fixes the CI failure that has affected main and every PR since 2026-12-01. The evidence is in draft PR #1871.
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
The problem. Some tests create a project that contains a custom tool file. When the app sees such a file, it starts an npm install of the plugin package into that project, because a custom tool may import it. The install is real: it downloads about 80 packages from the npm registry. It runs inside the test process, and the app does not wait for it.
So the install is still running when the test ends. The next test starts another one. With eight running at once, the test process stops making progress. Whichever tests run next then time out after minutes, or the job runs out of memory and is killed. Which tests fail changes from run to run, because they are only the ones that happen to come next.
The fix.
- The app skips this background install when
ALTIMATE_DISABLE_DEPENDENCY_INSTALLis set. When it is not set, the app behaves exactly as before. - The test setup file sets the variable, so no test starts a real install.
- 17 existing tests check that the app asks for an install in the right cases. They clear the variable for themselves. They use a fake installer that only records the request, so they do not reach the network either.
- One new test covers the variable, and it is added to the environment variable table in the CLI docs.
What this does not change. Users still get the background install, and it can still slow the app while it runs. That is a product change for a separate PR.
What is not known. Why this started failing on 2026-12-01. The same tests have always started these installs, and the packages installed have not changed since 2026-11-17. The likely explanation is that the installs became slow enough to overlap, but that is not confirmed.
How did you verify your code works?
Draft PR #1871 runs the test shards on CI with a script that reports every stall and every request to the npm registry.
| Run | Result |
|---|---|
| Shard 3, unchanged | Stalls. 8 installs running, 82 packages downloaded |
| Shard 3 without the one test file that creates custom tools | Passes. No stall, nothing downloaded |
| All four shards with this fix | All pass. No stalls, nothing downloaded |
This PR's own CI passes, including the four test shards that were failing. With the variable set and no other change, exactly the 17 install-request tests failed and no others, so no test depended on the real install.
Cost side effects
None.
Screenshots / recordings
Not a UI change.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
- I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"
🤖 Generated with Claude Code
Summary by CodeRabbit
- New Features
- Added the
ALTIMATE_DISABLE_DEPENDENCY_INSTALLenvironment setting. When enabled, automatic installation of plugin dependencies in configuration directories containing custom tools or plugins is skipped.
- Added the
- Documentation
- Documented the setting’s accepted values and clarified that custom tools or plugins importing the package must obtain it another way when installation is disabled.