Skip to content

bug(pi): orchestration_create_agent's bootstrap prompt always fails for Pi — delivery does not wait for the bridge to connect #1315

Closed

Description

@Juliusolsson05

Evidence (2026-09-25, quality loop)

5 of 5 orchestration_create_agent calls with kind: "pi" (reviewer spawns for codex-headless#53 and for #1257, #1284, #1287 and #1298) returned:

{"ok":false,"error":"prompt_delivery_failed","message":"pi prompt delivery failed for session …: the Pi bridge is not connected","retrySafe":true,"disposition":"retry-same-session"}

An orchestration_send_prompt of the same text to the same session seconds later succeeded every time. Codex and Grok spawns in the same batches bootstrapped fine.

Cause

  • deliverPiPrompt → PiSession.deliverPromptText → PiTerminalHeadless.submitPrompt fails at once with no-live-channel while the bridge extension is still connecting after spawn.
  • Codex's delivery waits up to 15 s for awaitReadyForPrompt before writing.
  • Pi has no readiness wait, and orchestration's pending-prompt mechanism ("if its provider supports waiting, the prompt waits") does not cover Pi. So every freshly created Pi child loses its bootstrap prompt, and the parent has to notice the failure and resend.

Expected

A freshly started Pi session's first delivery waits, bounded, for the bridge channel (or joins the orchestration pending-prompt path) instead of failing. A bridge that never connects still fails, with the existing provider_bridge_unreachable explanation. Nothing is ever pasted into the TUI (#877).

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    class:C1-prompt-deliveryPrompt delivery inferred from the terminal screenprovider:piAffects Pi integrationsev:P2Real bug with a workaroundtype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions