Symptom
On CI (GitHub Actions, 2-core, under vitest cross-file parallelism),
tests/cli/work.test.ts > kb work CLI > handoff > clears handoff with --clear intermittently fails:
AssertionError: expected 1 to be +0 // expect(exitCode).toBe(0)
i.e. the kb work handoff --clear CLI subprocess exits 1 instead of 0.
Evidence it is a pre-existing, non-deterministic flake
Why it matters
It threatens every PR in the v2 privileged-write-channel chain (and the
repo generally) with red CI that requires a manual re-run.
Suggested fix direction
Harden tests/cli/work.test.ts against CI load: ensure the CLI
bundle/build is fresh before the subprocess runs, increase per-runKb
robustness (retry/await on the spawn), or isolate the heavy CLI-subprocess
E2E files from cross-file parallel contention (a vitest projects split
for process-spawning E2E — same class as artifact-isolation.test.ts).
Tracking-only; not blocking the v2 chain unless it reproduces
deterministically (per maintainer decision 2026-05-16).
Symptom
On CI (GitHub Actions, 2-core, under vitest cross-file parallelism),
tests/cli/work.test.ts > kb work CLI > handoff > clears handoff with --clearintermittently fails:i.e. the
kb work handoff --clearCLI subprocess exits 1 instead of 0.Evidence it is a pre-existing, non-deterministic flake
same tree (25951896448) passed; a
--failedre-run also passed.src/daemon/*only; this iskb workCLI subprocess plumbing).ci: pre-build CLI bundle before vitest to dodge worker RPC timeoutcommit. Likely an isolation / CLI-bundle-staleness / spawn-timing race
in
work.test.ts(heavy 55-test, ~30s file) under loaded CI.Why it matters
It threatens every PR in the v2 privileged-write-channel chain (and the
repo generally) with red CI that requires a manual re-run.
Suggested fix direction
Harden
tests/cli/work.test.tsagainst CI load: ensure the CLIbundle/build is fresh before the subprocess runs, increase per-
runKbrobustness (retry/await on the spawn), or isolate the heavy CLI-subprocess
E2E files from cross-file parallel contention (a
vitestprojects splitfor process-spawning E2E — same class as
artifact-isolation.test.ts).Tracking-only; not blocking the v2 chain unless it reproduces
deterministically (per maintainer decision 2026-05-16).