Repository navigation
test(server): isolate plugin reuse fixture from config dependency install - #264
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 1c4490e)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 1c4490e)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous reviewStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by free · Input: 146.1K · Output: 3.9K · Cached: 14.3K |
There was a problem hiding this comment.
New flag OPENCODE_DISABLE_CONFIG_DEP_INSTALL is added here, but it is undocumented. The sibling escape hatches OPENCODE_DISABLE_PROJECT_CONFIG and OPENCODE_DISABLE_DEFAULT_PLUGINS are listed in packages/core/src/plugin/skill/customize-opencode.md under "Escape hatches", and the CLI/test helpers (packages/opencode/test/lib/cli-process.ts) enumerate the env vars they set. Without documentation, this flag is invisible to operators who want to reproduce the fixture behavior locally, and there is no single source of truth for what it does.
| get OPENCODE_DISABLE_PROJECT_CONFIG() { | ||
| return truthy("OPENCODE_DISABLE_PROJECT_CONFIG") | ||
| }, | ||
| get OPENCODE_DISABLE_CONFIG_DEP_INSTALL() { |
There was a problem hiding this comment.
SUGGESTION: New flag OPENCODE_DISABLE_CONFIG_DEP_INSTALL is undocumented. Add it to the "Escape hatches" list in packages/core/src/plugin/skill/customize-opencode.md (next to OPENCODE_DISABLE_DEFAULT_PLUGINS) and note it is for test/CI use only, since production config dependency installs are unchanged by default.
…meout Config initialization forks an @opencode-ai/plugin registry install per config directory, and plugin loading joins those fibers. A stalled registry could keep waitForDependencies - and instance disposal behind it - waiting indefinitely (20-minute HttpApi action timeouts near worktree creation in PRs #264/#265). - Npm.reify threads an AbortSignal through Arborist -> pacote -> npm-registry-fetch -> make-fetch-happen and aborts it when the fiber is interrupted, so cancellation reaches in-flight registry work instead of orphaning it. The scoped install flock is released while unwinding. ignoreScripts stays set, so no child processes are spawned that could outlive cancellation. - config.ts and tui.ts bound the forked installs with Effect.timeout (design proposal: 60s, override via OPENCODE_CONFIG_DEP_INSTALL_TIMEOUT_MS). On expiry the install fiber is interrupted and a warning is logged; failed installs keep the existing warning. Warn-and-continue is safe here because plugin resolution still installs and reports per-plugin requirements (PluginLoader) when plugins actually load. - Tests: deterministic stalled-registry regressions at both layers (core npm-interrupt.test.ts, opencode dep-install.test.ts) covering bounded waits, actual fiber/signal cancellation, prompt disposal, self-terminating detached fibers, normal successful installs, and failed/incomplete install reporting. Refs #271 Co-authored-by: arena-agent <[email protected]>
…meout Config initialization forks an @opencode-ai/plugin registry install per config directory, and plugin loading joins those fibers. A stalled registry could keep waitForDependencies - and instance disposal behind it - waiting indefinitely (20-minute HttpApi action timeouts near worktree creation in PRs #264/#265). - Npm.reify threads an AbortSignal through Arborist -> pacote -> npm-registry-fetch -> make-fetch-happen and aborts it when the fiber is interrupted, so cancellation reaches in-flight registry work instead of orphaning it. The scoped install flock is released while unwinding. ignoreScripts stays set, so no child processes are spawned that could outlive cancellation. - config.ts and tui.ts bound the forked installs with Effect.timeout (design proposal: 60s, override via OPENCODE_CONFIG_DEP_INSTALL_TIMEOUT_MS). On expiry the install fiber is interrupted and a warning is logged; failed installs keep the existing warning. Warn-and-continue is safe here because plugin resolution still installs and reports per-plugin requirements (PluginLoader) when plugins actually load. - Tests: deterministic stalled-registry regressions at both layers (core npm-interrupt.test.ts, opencode dep-install.test.ts) covering bounded waits, actual fiber/signal cancellation, prompt disposal, self-terminating detached fibers, normal successful installs, and failed/incomplete install reporting. Refs #271 Co-authored-by: arena-agent <[email protected]>
…meout Config initialization forks an @opencode-ai/plugin registry install per config directory, and plugin loading joins those fibers. A stalled registry could keep waitForDependencies - and instance disposal behind it - waiting indefinitely (20-minute HttpApi action timeouts near worktree creation in PRs #264/#265). - Npm.reify threads an AbortSignal through Arborist -> pacote -> npm-registry-fetch -> make-fetch-happen and aborts it when the fiber is interrupted, so cancellation reaches in-flight registry work instead of orphaning it. The scoped install flock is released while unwinding. ignoreScripts stays set, so no child processes are spawned that could outlive cancellation. - config.ts and tui.ts bound the forked installs with Effect.timeout (design proposal: 60s, override via OPENCODE_CONFIG_DEP_INSTALL_TIMEOUT_MS). On expiry the install fiber is interrupted and a warning is logged; failed installs keep the existing warning. Warn-and-continue is safe here because plugin resolution still installs and reports per-plugin requirements (PluginLoader) when plugins actually load. - Tests: deterministic stalled-registry regressions at both layers (core npm-interrupt.test.ts, opencode dep-install.test.ts) covering bounded waits, actual fiber/signal cancellation, prompt disposal, self-terminating detached fibers, normal successful installs, and failed/incomplete install reporting. Refs #271 Co-authored-by: arena-agent <[email protected]>
Issue for this PR
Closes #263. Manual Development link verified.
Type of change
What does this PR do?
Make the plugin reuse fixture independent of a real registry install. Adds
OPENCODE_DISABLE_CONFIG_DEP_INSTALL, evaluated at access time. Production config installation is unchanged by default. The fixture sets the flag because its file plugin imports no dependencies, then restores it infinally. Assertions and timeout budgets are unchanged.This isolates the fixture, not the separate SDK-to-REST diagnostic gap. Mock-registry dependency-install coverage remains follow-up work in #263. Windows filesystem/scanner overhead is a hypothesis, not a measured cause.
How did you verify your code works?
Independent review of exact tree c51232b79b0d776c3ade3d9e45e7ea3e5def6e0a on base 06b727. Focused test passed under the default 5-second budget. Patch and matched baseline full-file runs both had 10 passes and the same first HTTP/PTY 5-second timeout, with 35 assertions. Not an all-green local claim. Fresh CI and review are pending.
Screenshots / recordings
Not a UI change.
Checklist