Repository navigation
fix(pi): a fresh pane's first prompt waits for its bridge (#1315) - #1316
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Orchestration delivers a Pi child's bootstrap prompt right after spawn, while the bridge is still connecting, and it failed with "the Pi bridge is not connected" every time. Delivery now waits until the package settles the bridge startup (connected, unreachable after its deadline, listen failure, exit or stop); a mid-session disconnect still fails fast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a drop, and every settle path pinned The first test proved only that some request reached the rig. Now it asserts the prompt submitted; a delivery after a later disconnect fails at once; and exit, stop, a listen failure and the 35 s cap each settle a waiting delivery. Every mutation review B listed now fails a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juliusolsson05
added a commit
that referenced
this pull request
Sep 25, 2026
…dicts, #1316 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Final disposition (pre-merge), head fb4e6dc. Three independent reviewers:
Findings and dispositions: Round 1, B (all fixed in 129424f; B's round 2 confirmed each mutant now fails one test, 28/28 green, subset stable over 12 runs)
Round 1, A
Round 1, C
Residuals:
Merges through batch PR #1318 once every member passes its gate. 🤖 Generated with Claude Code |
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.
Fixes #1315.
Plan:
docs/plans/2026-09-25-pi-bootstrap-waits-for-bridge.md(first commit).Why
Pi
orchestration_create_agentcalls lost their bootstrap prompt withprompt_delivery_failed … the Pi bridge is not connected, and a later retry worked. The issue counted 5 of 5 on 2026-09-25. Review C found 27 such incidents in that day's journals: 26 bootstraps and 1send_prompt. Each failed 9–40 ms after start, and the bridge became ready a median 498 ms later (max 15.4 s).The cause:
PiSession.deliverPromptTextasked the package to submit while the bridge extension was still connecting, and the package answersno-live-channelat once. Codex already waits for readiness before its first write; Pi did not.What merges
PiSessionkeeps a flag, "bridge startup settled", that resets on each start. The package's own verdicts set it:connected;bridge-unreachable, after the package's connect deadline (30 s by default);bridge-listen-failed.Exit and stop set it too.
deliverPromptTextwaits for that flag before the first connect only. It reads the pane's state again after the wait, because the pane may have stopped meanwhile. A 35 s cap is a backstop in case the package never settles.not-ready, with the existing banner.Tests
piSession.system.test.ts, 28 tests, all driven by the recorded bridge replay:submitPromptargument. It is red on main.not-readyafter the deadline.npx tsc -bis clean.Residual
bridgeConnectDeadlineMs.🤖 Generated with Claude Code