Skip to content

feat(subagents): Let a child agent report that it is blocked - #2133

Merged
dcramer merged 16 commits into
mainfrom
feat/subagent-report-blocked
Oct 14, 2026
Merged

dcramer merged 16 commits into
mainfrom
feat/subagent-report-blocked

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

A child agent's reply goes to its parent agent, not to a person. When a child was missing access, input, or a decision, it could only ask a question that nobody answers, or guess. In both cases its agent invocation ended as completed, so the parent read the reply as finished work.

Each child run now has reportBlocked, a tool with one required missing field. It is exclusive, and it ends the run the same way finishAutomationRun ends an Automation run. The turn result carries the report, and the agent invocation ends as blocked with missing as its reason. The parent then gets an agent_invocation.blocked result that shows a Missing: section. The next step tells the parent to send the missing input back with spawnAgent and the same name, or to tell the user what is missing.

The report is read only from the new messages of the run. A named child keeps its history, so an old report must not end a later agent invocation.

This is the "child reports back" item in the Steering workstream of #2105. needs_input as its own status is not in this change. A named child that is blocked and then gets the missing input through spawnAgent covers that case for now.

via David Cramer.

--

View Junior Session [Sentry]

A child agent's reply goes to its parent agent, so a child that is missing
access or input either asked a question nobody would answer or guessed. Each
child run now has reportBlocked. It ends the run, and the agent invocation
ends as blocked with what is missing, so the parent gets an
agent_invocation.blocked result instead of a completed one.

Refs #2105

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 14, 2026 7:47am UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

A worker that died after the child Turn completed but before it saved the
agent invocation recovered the Turn as completed with an empty result. Read
the blocked report from the recovered Turn's messages too.
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38521847762.
The evals of this commit replay them in strict mode.

Eval-Suite: integration
@sentry-evals

sentry-evals Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 67 7 0 $1.28 0 238.15s

Base commit 734e9b4 has no eval run to compare against.

junior-guardian

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 53 0 5 $0.01 0 1.22s

Base commit 734e9b4 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 97 0 0 $0.68 0 186.83s

Base commit 734e9b4 has no eval run to compare against.

junior-router

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 12 0 0 $0.00 0 0.21s

Base commit 734e9b4 has no eval run to compare against.

The verification code task read like a request for a secret, so the parent
never started the child agent.
…ed work

In the eval, the child searched for the missing deploy region, found
nothing, and replied with text. That ended its agent invocation as
completed instead of blocked.
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38524841458.
The evals of this commit replay them in strict mode.

Eval-Suite: integration
A child run got the conversation rules, which tell the agent to ask the
user one question and to say what it checked. In the eval, the child
replied "I don't have the chosen deploy region" as text, so its agent
invocation ended as completed. The child_agent mode replaces those rules
and says that the final text is finished work and that a blocked task
ends with reportBlocked.
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38525864514.
The evals of this commit replay them in strict mode.

Eval-Suite: integration
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38525864516.
The evals of this commit replay them in strict mode.

Eval-Suite: behavioral

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b177faa. Configure here.

Comment thread packages/junior/src/chat/prompt.ts Resolved
The child_agent mode still used the conversation failure and output rules,
which ask for a final reply that explains a blocker. That reply ends the
agent invocation as completed. Child runs now put a stopping failure in
reportBlocked and reply with text only when the task is finished.
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38528876063.
The evals of this commit replay them in strict mode.

Eval-Suite: integration
github-actions Bot and others added 2 commits October 14, 2026 07:38
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38528876032.
The evals of this commit replay them in strict mode.

Eval-Suite: behavioral
…s missing

The user asks the parent to tell what happened, so the parent does not have
to ask for the region. The run before this one passed the child report and
failed only on that rubric line.
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38529759750.
The evals of this commit replay them in strict mode.

Eval-Suite: integration
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38529759768.
The evals of this commit replay them in strict mode.

Eval-Suite: behavioral
@dcramer
dcramer merged commit 742e472 into main Oct 14, 2026
54 of 55 checks passed
@dcramer
dcramer deleted the feat/subagent-report-blocked branch October 14, 2026 16:16

This branch was successfully deployed

1 active deployment
Preview – junior-docs — b2cd66b3 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant