Skip to content

fix(cli): fix flaky tests#9560

Open
alex-alecu wants to merge 17 commits intomainfrom
fix/provider-plugin-ci-flake
Open

fix(cli): fix flaky tests#9560
alex-alecu wants to merge 17 commits intomainfrom
fix/provider-plugin-ci-flake

Conversation

@alex-alecu
Copy link
Copy Markdown
Contributor

@alex-alecu alex-alecu commented Apr 27, 2026

Stabilizes the provider plugin test by avoiding global instance disposal and letting local plugins load before waiting on dependency setup.

This keeps the PR focused on the provider plugin flake: the remaining diff only touches plugin initialization and the provider test cleanup path.

All shared opencode changes are annotated with kilocode_change markers.

@alex-alecu alex-alecu changed the title fix(cli): avoid provider test flake fix(cli): fix flaky tests Apr 27, 2026
Comment thread packages/opencode/src/session/prompt.ts
Comment thread packages/opencode/src/session/prompt.ts Outdated
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 27, 2026

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/effect/runner.ts 163 Cancelled shells now hide unrelated cleanup failures.
packages/opencode/src/session/prompt.ts 747 The interrupt mask still makes shell preflight steps non-cancellable, so a stuck cleanup or shell.env hook can leave cancellation hanging indefinitely.
packages/opencode/src/session/prompt.ts 934 Signal-terminated shell commands are still treated as successful runs even when the user did not cancel them.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

None.

Files Reviewed (4 files)
  • packages/opencode/src/effect/runner.ts - 1 issue
  • packages/opencode/src/plugin/index.ts - 0 issues
  • packages/opencode/src/session/prompt.ts - 2 issues
  • packages/opencode/test/provider/provider.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.4-2026-03-05 · 1,615,673 tokens

Comment thread packages/opencode/src/effect/runner.ts Outdated
Comment thread packages/opencode/src/session/prompt.ts Outdated
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 27, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/effect/runner.ts 163 Cancelled shells now hide unrelated cleanup failures
packages/opencode/src/session/prompt.ts 934 Signal-terminated shell commands are treated as successful runs
Other Observations (not in diff)

None.

Files Reviewed (4 files)
  • packages/opencode/src/effect/runner.ts - 1 issue
  • packages/opencode/src/plugin/index.ts - 0 issues
  • packages/opencode/src/session/prompt.ts - 1 issue
  • packages/opencode/test/provider/provider.test.ts - 0 issues

Reviewed by gpt-5.4-2026-03-05 · 950,378 tokens

Comment thread packages/opencode/src/plugin/index.ts
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 27, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/plugin/index.ts 212 Local plugins that need workspace dependencies during server() initialization can still run before waitForDependencies() completes and be skipped.
Other Observations (not in diff)

No additional issues found outside the diff.

Files Reviewed (3 files)
  • packages/opencode/src/plugin/index.ts - 1 issue
  • packages/opencode/src/session/prompt.ts - 0 issues
  • packages/shared/src/util/flock.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.5-2026-04-23 · 2,597,003 tokens

Comment thread packages/opencode/src/session/prompt.ts Outdated
},
}),
)
// kilocode_change start - avoid blocking successful local plugins on background dependency installs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Plugin initialization can race dependency setup again

Removing the post-load wait() means a local plugin that imports successfully but needs workspace dependencies during server() initialization now runs before config.waitForDependencies() completes. PluginLoader.loadExternal() only retries failures through module import, not failures from applyPlugin(), so these plugins will still be skipped instead of waiting or retrying after dependency setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant