Avoid redundant Pi local-file child sessions - #3455
Merged
ymichael merged 1 commit intoSep 11, 2026
Merged
Conversation
ymichael
deleted the
bb/ci-flake-fix-pi-local-file-child-startup-timeout-thr_b22yrsxskd
branch
September 11, 2026 03:02
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.
Human comments
What was wrong
The local-file bridge test wrapped three deterministic input-to-prompt assertions in three independent real fake-Pi session lifecycles. Each case constructed a Pi RPC child, loaded the real extension boundary, delivered one local-file conversion, and tore the child down. The packages shard runs Turbo at concurrency 4 while each package starts a Vitest pool, so CPU/process oversubscription made those avoidable serial child startups cross Vitest's unchanged 5-second case ceiling. Scheduler contention is the reproduction trigger; the root cause is paying three feature-specific subprocess startups for a typed conversion already exposed as
extractPiPromptInput.On the frozen Intel base, the unchanged file passed unloaded in 4.43 seconds of test time (2.197/1.117/1.118 seconds per case). With 32 bounded CPU burners, all three unchanged cases timed out at the existing 5-second ceiling and were reported at 6.927/6.913/8.498 seconds.
What changed
turn-input.test.ts, directly against the typed conversion called by both turn and steer handlers.stop{release}lifecycle case with a metadata-bearing local-file-only turn and retained the child shutdown/checkpoint assertions.bridge.local-file.test.ts.This adds no subprocess startup: the meaningful
turn/startandturn/steerprotocol checks ride real child sessions already required for lifecycle coverage. No timeout, polling deadline, retry budget, production behavior, protocol field, CLI/SDK surface, or host-daemon wire contract changed, soHOST_DAEMON_PROTOCOL_VERSIONis unchanged.A timeout increase was rejected because the work is deterministic and its repeated process construction is avoidable. A shared feature-specific fake-Pi session was also rejected because it would preserve unnecessary startup exposure and duplicate existing lifecycle sessions. The retained real-process checks continue waiting for observable turn boundaries and child exit, while the conversion matrix itself completes synchronously.
Open PR/issue searches found no owner for
bridge.local-file.test.tsor the exact timeout. The only open PR touching the Pi bridge is #3249, for skill-command behavior; it does not touch this test. BB thread searches likewise found no overlapping local-file flake owner. Merged #3302 is the structural precedent for the distinct skill-command suite.How you verified
Mandatory host gate and every workload ran on enrolled Intel host
host_nwqfteeqz4(Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz,x86_64). HEAD began at and retains merge-basea4f513251851bc357fbc0f28e61c331ea3f9f2e4;origin/mainadvanced afterward and this branch intentionally kept the frozen base.pnpm exec turbo run test --filter=bb-plugin-provider-pi --force -- --maxWorkers=2: 26 files and 154 tests passed, one file/test skipped.pnpm exec turbo run typecheck --filter=bb-plugin-provider-pi --force: 4 Turbo tasks passed.pnpm exec turbo run build --filter=@bb/host-daemon --force: 5 Turbo tasks passed.pnpm exec turbo run test --filter=@bb/plugin-build --force -- --maxWorkers=2: 10 files and 137 tests passed, one skipped, including provider-Pi server and host artifact builds.pnpm exec oxfmt --check plugins/provider-pi/src/bridge/bridge.lifecycle.test.ts plugins/provider-pi/src/bridge/bridge.round2.test.ts plugins/provider-pi/src/bridge/turn-input.test.tsgit diff --checkEvery test, build, formatting, and synthetic-load command used an external deadline and a dedicated top-level process group; the load runner trapped EXIT/INT/TERM/HUP and reaped its workers. Post-run process and temporary-directory audits found no surviving burner, Vitest, Turbo, fake-Pi child, or task-specific temporary directory.