Repository navigation
Conversation
ymichael
force-pushed
the
bb/ci-flake-fix-codex-topology-late-child-release-r-thr_eusqkhq9cd
branch
from
September 8, 2026 22:40
2777338 to
576f792
Compare
ymichael
deleted the
bb/ci-flake-fix-codex-topology-late-child-release-r-thr_eusqkhq9cd
branch
September 8, 2026 22:45
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 recurring packages job failure was triggered by package-shard CPU contention but rooted in a lifecycle mismatch in the test. The runtime started its 200 ms
thread/startrequest deadline after provider initialization but before the bridge necessarily handled the request and spawned the app-server child. The test then requiredspawned === 1 && exited === 1; when cancellation retired the bridge before its request handler ran, no child could ever publish either marker. An instrumented 24-run stress reproduced 22 exact failures, all withspawned=0,exited=0, no child PID, and an expected bridge exit. The predicate-before-deadline polling fix from #2352 remains present; this was an impossible lifecycle state rather than a missed final poll.The audit of closed PR #2506 also confirmed that its adjacent child-stdin finding remains real on current
main: a live app-server child that closes fd 0 produced an unhandledEPIPEand left its request pending. Currentmainhas since madekill()awaitable in #3025, so the old patch could not be reused unchanged.The package shard's nested concurrency is systemic: CI runs four Turbo package tasks on a 4-vCPU runner, and each package's Vitest process independently schedules worker pools. That explains the reproduction condition, but it is not the root cause addressed here.
The independently verified merge base is
06047280e04e6ce57554052ec788a1c5defe7d1e.What changed
thread/start, hold only the runtime's request clock until the real child publishes its spawn marker, then advance the unchanged 200 ms deadline. The test still requires the child to record its SIGTERM exit and verifies its PID is gone.EPIPEandERR_STREAM_DESTROYEDas terminal connection failures. New work is rejected immediately, the unusable child is force-stopped, and pending work still finalizes on the observable child exit/close boundary so natural exit status, stderr, and final stdout are preserved. The current awaitablekill()contract remains intact.No request, polling, release, or test timeout was increased. There is no server/daemon wire change, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged. There are no CLI, SDK, guide, or configuration-surface changes.How you verified
Timed out after 10000ms waiting for the late-constructed child was releasedsignature.spawned=0,exited=0, no child PID, andbridgeExits=[{expected:true}].write EPIPE. After: the three-test connection file passed, then passed 32/32 parallel stress runs with no unhandled error or survivor.pnpm exec turbo run test --filter=@bb/agent-runtime -- --run src/runtime.codex-topology.test.ts— 1 file / 4 tests passed.pnpm exec turbo run test --filter=bb-plugin-provider-codex -- --run src/bridge/app-server-connection.test.ts— 1 file / 3 tests passed.pnpm exec turbo run test --filter=@bb/agent-runtime --force— 22 files / 318 tests passed.pnpm exec turbo run test --filter=bb-plugin-provider-codex --force— 27 files / 264 tests passed.pnpm exec turbo run typecheck --filter=@bb/agent-runtime --filter=bb-plugin-provider-codex --force— passed.pnpm exec turbo run build --filter=@bb/agent-runtime --filter=bb-plugin-provider-codex --force— passed (the scoped packages have no direct build tasks; their applicable dependency graph passed).pnpm exec prettier --check packages/agent-runtime/src/runtime.codex-topology.test.ts plugins/provider-codex/src/bridge/app-server-connection.ts plugins/provider-codex/src/bridge/app-server-connection.test.ts plugins/provider-codex/src/bridge/fake-codex-app-server.mjs— passed.host_nwqfteeqz4; cleanup checks reported no surviving group or matching test/fake-child process.Fixes: no issue — exact path/signature searches found no open issue or PR, and the prior BB owners are archived without environments.