Repository navigation
feat(subagents): Send agent invocation results to the parent conversation - #2106
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
marked this pull request as ready for review
October 13, 2026 17:11
sentry-junior
Bot
force-pushed
the
feat/agent-invocation-parent-results
branch
from
October 13, 2026 17:27
6d53513 to
6795623
Compare
sentry-junior
Bot
force-pushed
the
feat/agent-invocation-parent-results
branch
from
October 13, 2026 17:32
6795623 to
aeeba27
Compare
sentry-junior
Bot
force-pushed
the
feat/agent-invocation-parent-results
branch
from
October 13, 2026 17:45
aeeba27 to
44b5979
Compare
sentry-junior
Bot
force-pushed
the
feat/agent-invocation-parent-results
branch
from
October 13, 2026 18:56
44b5979 to
ae066fc
Compare
…tion A terminal agent invocation result now wakes the parent Conversation. The SQL write that stores the result marks it pending for the parent. The worker appends it to the parent mailbox as a junior/agent_invocation.* Event before it acks the child work, and the heartbeat repairs results that stay pending. The result Turn runs as the Actor that spawned the child, read from SQL. The automated-turn limit does not drop results. spawnAgent returns the child conversation_id, so the parent can read child history with searchConversationEvents. Refs #878, #2105 Co-Authored-By: David Cramer <[email protected]>
sentry-junior
Bot
force-pushed
the
feat/agent-invocation-parent-results
branch
from
October 13, 2026 19:03
ae066fc to
e0bf571
Compare
…AgentDepth Add limits.maxAgentDepth. The default, 0, keeps today's behavior: only the root Conversation can start child agents. The invocation worker counts a child's parents and hides spawnAgent once the child is deeper than the limit. Child runs now read the root Location and visibility, not the parent's. A result for a child Conversation cannot run an Event Turn, because a child has no Location. Instead it starts a new agent invocation on that child, keyed by the result's agent invocation id. That invocation uses the child's parent, Actor, and credentials and skips the busy and active-count checks. The parent gets one report per piece of child work. A child agent invocation that finishes while the child still has open work (a queued invocation, a running child, or a result no invocation has received) is marked `replaced`. The open work starts a later invocation, which sends the report. Result Events no longer put the task in verified details. For an invocation that receives a result, the input holds another child's output. Co-Authored-By: David Cramer <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1487161. Configure here.
…evals A replaced child result is never sent, so it no longer counts as an unreceived result. Before, a child whose own child had replaced a result never reported to its parent when maxAgentDepth was 2 or more. Simplify the open-work check to two reads, derive the result agent invocation id from the result alone, and drop the ancestor loop guard. Add integration evals for a child agent result and a nested child report through the real app wiring. Co-Authored-By: David Cramer <[email protected]>
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38459361637. The evals of this commit replay them in strict mode. Eval-Suite: integration
Sentry Evalsjunior-behavioral
Base commit junior-guardian
Base commit junior-integration
Base commit junior-router
Base commit |
dcramer
approved these changes
Oct 13, 2026
11 of 35 tasks
This was referenced Oct 15, 2026
This was referenced Nov 2, 2026
This branch was successfully deployed
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.

Before this change,
spawnAgentstarted a child agent, but the parent never saw the result. Now a terminal result wakes the parent Conversation. Part of #2105, refs #878.pendingfor the parent.pending. The message id comes from the agent invocation id, so retries do not add a second parent Turn.junior/agent_invocation.{completed,blocked,failed}). It uses the same mailbox and Event Turn path as Watches, but without a Watch. The parent replies at its Location.spawnAgentand the result Event give the model only the childconversation_id. The parent reads child history with the existingsearchConversationEventstool. The agent invocation id stays internal.awaiting_resumeis nowpaused, and every terminal agent invocation has aparentMailboxStatus. Migration0050converts existing rows.Child agents can also start child agents, up to
limits.maxAgentDepth:spawnAgentonce the child is deeper than the limit. Child runs read the root Location and visibility.replaced. That open work starts a later invocation, which sends the report.Codex and Claude Code also push child completion into the parent. Junior must start a new parent Turn for it, because the parent Turn may have ended.
listAgents,stopAgent(including stopping a whole tree of children), and auth pauses are separate follow-ups (#881).via David Cramer.
--
View Junior Session [Sentry]