You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pi extension-triggered turn stays working after agent_end #1633
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportprovider-piBuilt-in plugin: provider-piprovidersCross-provider bridges, models, login
Start a process through the pi-processes extension.
Configure its completion notification with onSuccess: "turn".
Let the process finish while the agent is idle.
Pi starts an extension-triggered turn and the assistant returns a final response.
bb continues to show the thread as working until the user stops the turn.
Cause
The Pi adapter validates each agent_end.messages[] item with a schema that accepts only content-block arrays. Pi 0.84.0 also permits string content for user and custom messages. pi-processes sends a custom message with string content through pi.sendMessage({ triggerTurn: true, deliverAs: "steer" }).
The invalid schema rejects the complete agent_end event. bb reports sdk/agent_end as provider/unhandled and does not emit turn/completed. Client-started turns have a separate prompt settlement path. Extension-triggered turns do not.
Expected behavior
The adapter must accept every valid Pi AgentMessage.content form. A valid extension-triggered agent_end must emit turn/completed and must not be classified as unhandled.
The required onSuccess: "turn" pi-processes behavior must remain unchanged.
Root cause (short): piConversationMessageSchema in packages/agent-runtime/src/pi/event-translation.ts accepts only array content, so a string-content extension custom message in agent_end.messages makes the whole agent_end parse fail -> provider/unhandled instead of turn/completed; extension-triggered turns have no pi/prompt/settled fallback, so the turn never closes.
Linked PR review:Fix Pi extension-triggered turn completion #1663 → MERGE — One-line zod union fix is correct and verified live (thread completes, item/completed + turn/completed emitted); non-blocking nits: still an allowlist of content shapes for messages bb never reads, no defensive 'agent_end always closes turn' net, custom message_start/message_end still render as Unha
Proposed fix: (1) Loosen piAgentEndEventSchema.messages to role-only passthrough records and keep strict assistant narrowing in findLastAssistantMessage (PR Fix Pi extension-triggered turn completion #1663's string|array union is an acceptable narrower variant). (2) In the agent_end case, when detailed parse fails but type==='agent_end' and willRetry!==true, still emit provider/unhandled AND turn/completed + finishTurn so a terminal event can never wedge a turn. (3) Add 'custom' (and other non-model roles) to toPiMessageBoundaryRole in visibility.ts so extension messages stop rendering as 'Unhandled Pi event'. All in packages/agent-runtime; no wire …
Caveats: Did not install pi-processes itself; used a minimal user-scope Pi extension calling the same pi.sendMessage({content:string},{triggerTurn:true,deliverAs:'steer'}) API. Live repro required PI_CODING_AGENT_DIR pointing at a scratch agent dir (copy of ~/.pi/agent auth/models/settings, deleted afterwards) because project-scope .pi/extensions are untrusted in the bridge and silently not loaded. Worktre…
The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportprovider-piBuilt-in plugin: provider-piprovidersCross-provider bridges, models, login
Activity
SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1633.html
The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).Fix Pi extension-triggered turn completion (get-bb#1663)