Repository navigation
fix(extension): skip the engine's boot-time plugin install in the H4 fixture (Closes #2199) - #2200
Merged
Merged
Conversation
…art warm-up stalls The H4 warm-up fails on main with "warm-up GET /config (instance cold start) timed out after 120s", and the engine prints only that it is listening, so the failure cannot tell a hung package install from a hung boot. On a warm-up timeout the error now also carries: - the engine and installer processes (ps) - a bounded listing of what the engine wrote into HOME - a probe of the package registry from the runner The helper is best-effort and bounded; it never throws from the error path. This does not change test behavior, only the failure message. Refs #2199 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…all report The first stall report showed the registry answers (HTTP 200 in 175ms) and that the engine process was alive for 2 minutes with no installer child process, so the stall is inside the engine, not a subprocess or a network outage. To see what it waits on, the report now also carries: - open TCP sockets with owning process (ss -tnp): a half-open connection names the host the engine waits on - CPU and state per process: a busy loop versus an idle wait - HOME listed three levels deep: what the engine managed to write Refs #2199 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ve model catalog The second stall report showed the engine at 100% CPU in state R for the whole 120s warm-up, with no installer child process, idle connections only, and models.json (downloaded from models.opencode.ai) on disk. The registry answered in about 200ms. So the stall is inside the engine after its inputs arrived, not a network wait. The H4 fixture uses its own dead-port provider and needs no model catalog. Set OPENCODE_DISABLE_MODELS_FETCH so the first request does not download live, time-varying data. This tests the theory that the catalog triggers the spin; it also removes an external dependency from the test either way. Refs #2199 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…fixture Root cause of the H4 warm-up timeout on main: with a plugin configured, the first GET /config waits for the engine's background install of @opencode-ai/plugin. The engine runs that install inside its own process (@npmcli/arborist on the one JavaScript thread), once per config directory (global and project). Measured with the vendored 1.18.30 binary in WSL on a 20-core machine, with the H4 config and a no-op plugin: - two dirs: 96.2 s, 101 CPU-seconds - project config disabled: 48.7 s, 51 CPU-seconds (one dir) - "already installed" seeded: 0.0 s, 1 CPU-second A CI runner is slower per thread, so the 120 s warm-up budget is unreachable. A provider-only config (no plugin) answers in 0.1 s, and an empty plugin reproduces the stall, so the plugin code is not involved. The engine skips the install when <dir>/node_modules exists and the dir's package.json and package-lock.json already name the package. The H4 plugins import only node built-ins, so the fixture seeds that state in both config dirs. seedInstalledPluginDeps is unit tested. Also drop OPENCODE_DISABLE_MODELS_FETCH from the previous commit: the model catalog was disproved as the cause (the stall persisted with it off). Refs #2199 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
bc037
marked this pull request as ready for review
December 2, 2026 20:54
Closed
4 tasks
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.
Related Issue
Closes #2199
Description
fastwas red onmain: the H4 warm-up test (mode_block.test.ts) timed out after 120 s onGET /config.Root cause. With a plugin in the config, the first
GET /configwaits for the engine's boot-time install of@opencode-ai/plugin. The engine runs that install inside its own process (@npmcli/arborist, one JavaScript thread), once per config directory (global and project). Measured with the vendored 1.18.30 binary (the CI artifact) in WSL on a 20-core machine, with the H4 config and a no-op plugin:GET /configA CI runner is slower per thread, so the 120 s budget is not reachable. The plugin's code does not matter (an empty plugin reproduces it), and the package registry answers in about 100–200 ms. The model catalog was tested and ruled out.
Fix. The engine skips the install when
<dir>/node_modulesexists and the dir'spackage.jsonandpackage-lock.jsonalready name the package.seedInstalledPluginDepswrites that state in both config dirs for this fixture. The H4 plugins import only node built-ins, so they do not need the package.Also in this PR (test-only): when a warm-up times out, the error now reports the engine and installer processes, open sockets, a bounded view of HOME, and a registry probe. This is what exposed the CPU spin and the
effectfiles being written.Changes:
test/fixtures/seed_plugin_deps.ts(+ unit tests),test/fixtures/stall_diagnostics.ts(+ unit tests),test/mode_block.test.ts. No product code changes.Type of Change
Verification
pnpm -r run buildexits 0pnpm -r run testexits 0 (orpnpm -r run typecheckif tests aren't relevant)All 11 CI checks pass on this branch, including
fast(the H4 file ran 38 tests in 6.2 s; before the fix it ran for 132 s and failed). The new unit tests were written first and failed before the helpers existed. On the author's Windows machine the full suite does not pass, and the H4 test is skipped there (no engine binary); those failures also occur on unchangedmain.Manual Testing Notes
fastto pass on two consecutive runs onmain. That can only be checked after merge.🤖 Generated with Claude Code