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
I searched open and closed issues and did not find a report of this problem.
I reviewed this report and removed credentials, tokens, private paths, hostnames, and other sensitive data.
Problem
#1631 moved child output onto an idle/run/hold delivery router so an idle parent is woken through prompt() and before_agent_start (#1528). Three delivery paths in extensions/gentle-agents.ts are still outside that guarantee on main (2549f17a):
Incoming session messages still start a direct turn. The orchestrator_send_message receiver (gentle-agents.ts:501) still calls pi.sendMessage(message, { deliverAs: "followUp", triggerTurn: true }).
While the receiver compacts without a run, the host is neither idle nor streaming, so the same call starts a direct run during compaction.
Held content is never released after /tree. Content held for a parent that is busy without a run is released only by agent/turn boundaries and session_compact(_failed). /tree branch summarization also makes the host busy without a run, but session_tree is not handled, and a cancelled or aborted summarization emits no event at all. Held child output, child messages and session messages then wait for an unrelated user prompt. The fix(agents): preserve prompt lifecycle for idle child delivery #1631 task notes list "missing compact event can delay held content until next boundary" as a known limitation.
A wake can race the user's own prompt. A user prompt is in its pre-run phase from input until before_agent_start (input handlers, auth, model checks) while ctx.isIdle() still reads true. Child content arriving in that window dispatches an idle wake. The wake prompt and the user's prompt both reach Agent.prompt(), and the user's session.prompt() rejects with Agent is already processing, so the human's message is lost. The fix(agents): preserve prompt lifecycle for idle child delivery #1631 notes call this a residual pre-run race.
Steps to reproduce
Each case is reproduced on the real Pi host (createAgentSession, SessionManager.inMemory, the pi-ai faux provider, the real Gentle Agents factory). A probe extension appends a marker to the system prompt in before_agent_start, and every provider request is checked for it.
Idle parent, incoming session message: the woken provider request lacks the before_agent_start marker.
Manual session.compact() with the summary response held; deliver a session message during compaction: a provider request for the message is issued before compaction ends.
session.navigateTree(target, { summarize: true }) with the summary held; settle a child completion; complete (or abortBranchSummary()) the summarization: no turn ever delivers the completion.
Park a user session.prompt() inside a probe input handler; settle a child completion; release: session.prompt() rejects with Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.
Expected and actual behavior
Expected: every model-visible message Gentle Agents hands to the parent starts its turn through the prompt lifecycle in every host state, and held content reaches the parent without waiting for an unrelated user prompt.
Before submitting
Problem
#1631 moved child output onto an idle/run/hold delivery router so an idle parent is woken through
prompt()andbefore_agent_start(#1528). Three delivery paths inextensions/gentle-agents.tsare still outside that guarantee onmain(2549f17a):orchestrator_send_messagereceiver (gentle-agents.ts:501) still callspi.sendMessage(message, { deliverAs: "followUp", triggerTurn: true })._runAgentPromptwithoutbefore_agent_start. This is the bug(prompt): background subagent completion turn fails on claude-bridge (prompt-capture miss; appended harness likely missing) #1528 failure on another path: prompt-capture integrations such as the Claude bridge reject the turn, and other providers run it without the harness./tree. Content held for a parent that is busy without a run is released only by agent/turn boundaries andsession_compact(_failed)./treebranch summarization also makes the host busy without a run, butsession_treeis not handled, and a cancelled or aborted summarization emits no event at all. Held child output, child messages and session messages then wait for an unrelated user prompt. The fix(agents): preserve prompt lifecycle for idle child delivery #1631 task notes list "missing compact event can delay held content until next boundary" as a known limitation.inputuntilbefore_agent_start(input handlers, auth, model checks) whilectx.isIdle()still readstrue. Child content arriving in that window dispatches an idle wake. The wake prompt and the user's prompt both reachAgent.prompt(), and the user'ssession.prompt()rejects withAgent is already processing, so the human's message is lost. The fix(agents): preserve prompt lifecycle for idle child delivery #1631 notes call this a residual pre-run race.Steps to reproduce
Each case is reproduced on the real Pi host (
createAgentSession,SessionManager.inMemory, the pi-ai faux provider, the real Gentle Agents factory). A probe extension appends a marker to the system prompt inbefore_agent_start, and every provider request is checked for it.before_agent_startmarker.session.compact()with the summary response held; deliver a session message during compaction: a provider request for the message is issued before compaction ends.session.navigateTree(target, { summarize: true })with the summary held; settle a child completion; complete (orabortBranchSummary()) the summarization: no turn ever delivers the completion.session.prompt()inside a probeinputhandler; settle a child completion; release:session.prompt()rejects withAgent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.Expected and actual behavior
Expected: every model-visible message Gentle Agents hands to the parent starts its turn through the prompt lifecycle in every host state, and held content reaches the parent without waiting for an unrelated user prompt.
Actual: the three paths above, as described.
gentle-pi version
Unreleased
mainat2549f17a(includes #1631).Pi version
0.99.2
Operating system
Linux
Relevant logs or error output (optional)
Related: #1528 (closed by #1631), #1518 (receiver-side admission for session messages), #1092 / #1574.