Repository navigation
Conversation
ymichael
force-pushed
the
bb/ci-flake-fix-pi-skill-command-child-startup-time-thr_eizccq4uhu
branch
from
September 8, 2026 23:32
92f26a5 to
ecb3545
Compare
ymichael
deleted the
bb/ci-flake-fix-pi-skill-command-child-startup-time-thr_eizccq4uhu
branch
September 9, 2026 03:46
ymichael
added a commit
that referenced
this pull request
Sep 11, 2026
## 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
- Added exact mixed text/local-file and file-only assertions to
`turn-input.test.ts`, directly against the typed conversion called by
both turn and steer handlers.
- Replaced the generic text prompt in the existing real-process
`stop{release}` lifecycle case with a metadata-bearing local-file-only
turn and retained the child shutdown/checkpoint assertions.
- Added a local file to the existing real-process successful steer case
and retained its accepted-input, turn-boundary, framing, and no-error
assertions.
- Deleted the standalone three-session `bridge.local-file.test.ts`.
This adds no subprocess startup: the meaningful `turn/start` and
`turn/steer` protocol 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, so `HOST_DAEMON_PROTOCOL_VERSION` is 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.ts` or
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-base
`a4f513251851bc357fbc0f28e61c331ea3f9f2e4`; `origin/main` advanced
afterward and this branch intentionally kept the frozen base.
- Unchanged-main focused run: 3 passed; 4.43 seconds of test time.
- Unchanged-main 32-burner reproduction: 3/3 timed out at the unchanged
5-second ceiling; 6.927/6.913/8.498 seconds reported.
- Final identical 32-burner conversion run: 12/12 passed in 50 ms of
test time; the local-file case took 3 ms.
- Final focused conversion plus reused turn/steer protocol checks: 3/3
passed.
- `pnpm exec turbo run test --filter=bb-plugin-provider-pi --force --
--maxWorkers=2`: 26 files and 154 tests passed, one file/test skipped.
- The default-worker full package run demonstrated the systemic
oversubscription separately: 150 tests passed and four unrelated
settings/conformance/lifecycle cases timed out or observed late cleanup;
both changed real-process cases passed under that load at 13.413 and
12.637 seconds. No clock was changed in response.
- `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.ts`
- `git diff --check`
Every 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.
> AGENT GENERATED
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
plugins/provider-pi/src/bridge/bridge.skill-command.test.tscoupled a deterministic input-to-Pi-prompt transformation matrix to full bridge process lifecycle. Per-test setup initialized a new isolated bridge harness, each case's first prompt started a fresh thread/session and spawned a fake Pi RPC Node child, and teardown stopped that child; the final case started two sessions. The 11-case file therefore paid for 12 serial child startups even though the behavior under test is a typed input conversion.The packages shard runs 89 package tests with Turbo
--concurrency=4, while each package starts its own Vitest worker pool. That nested CPU/process oversubscription is the systemic trigger: child construction crossed Vitest's 5 s case ceiling in unrelated PR #3295 attempt 1, PR #3295 attempt 2, and PR #3299 attempt 2. Attempt 1 timed out the no-arguments case; attempts 2 and 3 timed out the two-turn unchanged-input case.PR #3295 subsequently merged a file-wide 30 s timeout override for this test. That masks the repeated-startup cost instead of removing it. Scheduler contention exposes the flake, but the root cause is the avoidable process lifecycle around pure transformation assertions.
What changed
The existing typed input conversion now lives in
turn-input.ts, andbridge.tscalls it for start and steer input. The exact transformation matrix and raw schema-boundary rejection cases run directly inturn-input.test.ts. The old process-backed feature test and its newly merged 30 s override are removed.Feature behavior remains covered at the narrowest deterministic boundary: native skill invocation, no-argument invocation, command-position movement, whitespace, text/file/image composition, multiple skills, malformed ranges, text mismatch, provider commands, raw slash text, and invalid protocol inputs. Generic real-process bridge lifecycle and input delivery remain covered by the existing conformance, lifecycle, local-file, framing, and session suites. Keeping another child solely around the skill conversion is redundant: the bridge now directly calls the tested typed function, and the existing integration suites cover delivery of its output to Pi.
No timeout, polling deadline, retry budget, wrapper limit, protocol assertion, or production behavior is increased or weakened. This does not change host-daemon wire behavior, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged. There is no CLI, SDK, configuration, or documentation surface change.How you verified
The mandatory fresh-main gate ran on enrolled Intel host
host_nwqfteeqz4at frozen SHA and merge-base124cf2e8888a396726f3f00271074b6a622bdb42. After #3295 merged, the final commit was rebased ontobb26b4fd9a054d50e564642416319711bc4db16aand deliberately removed its timeout-only workaround.pnpm exec turbo run typecheck --filter=bb-plugin-provider-pi --force— 4 Turbo tasks passed.bridge.lifecycle.test.tslocal-image process case timed out at 5.262 s while many unrelated process cases ran 2–3× slower. An earlier unloaded full run with the same production extraction passed 28 files plus 1 skipped and 156 tests plus 1 skipped. The separate recurrence is outside this focused fix and is reported as a limitation.pnpm exec turbo run build --filter=@bb/host-daemon --force— 5 Turbo tasks passed. Provider-pi has no package-local build task.pnpm exec turbo run test --filter=@bb/plugin-build --force— 10 files and 137 tests passed (1 skipped), including bundling and importing the built-in provider-pi server and host artifacts.pnpm exec oxfmt --check plugins/provider-pi/src/bridge/bridge.ts plugins/provider-pi/src/bridge/turn-input.ts plugins/provider-pi/src/bridge/turn-input.test.tsgit diff --checkEvery stress/load/test/build/watch command used a tracked process group, external deadline, and cleanup trap. The 32-burner stress is intentionally synthetic and models nested worker oversubscription rather than treating contention as the root cause. Hosted CI on final head
ecb35451f9407c9de5c6e9cd29cb41854e42d027passed every required check, including the packages shard and both package-smoke jobs.