Skip to content

fix(cli): deflake prompt and background process races - #11827

Merged
catrielmuller merged 4 commits into
mainfrom
mark/deflake-prompt-cancel-race
Jul 1, 2026
Merged

fix(cli): deflake prompt and background process races#11827
catrielmuller merged 4 commits into
mainfrom
mark/deflake-prompt-cancel-race

Conversation

@markijbema

@markijbema markijbema commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

Deflake two macOS-sensitive CLI test paths:

  • Isolate the prompt cancellation race fixture from real agent and skill discovery.
  • Make persistent background process readiness output durable before forwarding it to the parent process.

Why

The prompt test verifies assistant finalization when cancellation interrupts processor creation, but it used the full agent layer before reaching the blocking processor. On slower CI hosts, unrelated agent initialization could consume the per-test budget before the actual race was reached.

Persistent background process readiness could also resolve from the runner's forwarded stdout before the same bytes were flushed to the persistent log file. Re-adoption then saw an empty log-backed output even though readiness had already been reported.

Notes

The prompt fixture still exercises the real prompt loop, run state, runner cancellation, and message persistence paths. The background process change preserves ordering by writing to the persistent log before forwarding output to the parent.

@markijbema markijbema changed the title test(cli): deflake prompt cancellation race fix(cli): deflake prompt and background process races Jun 30, 2026
@markijbema
markijbema marked this pull request as ready for review July 1, 2026 12:43
@kilo-code-bot

kilo-code-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/kilocode/background-process/runner.ts
  • packages/opencode/test/session/prompt.test.ts

Reviewed by claude-sonnet-5-20260630 · Input: 6.8K · Output: 13.4K · Cached: 1.6M

Review guidance: REVIEW.md from base branch main

@catrielmuller
catrielmuller merged commit 10eda62 into main Jul 1, 2026
26 checks passed
@catrielmuller
catrielmuller deleted the mark/deflake-prompt-cancel-race branch July 1, 2026 13:42
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…ancel-race

fix(cli): deflake prompt and background process races
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.

2 participants