Skip to content

fix(subagents): Tell a child that a missing-input reply is not a result - #2159

Open
sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/child-agent-report-blocked
Open

sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/child-agent-report-blocked

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

A child agent that is missing input sends a text reply that says the input is missing, for example "No deploy region was specified." It does not call reportBlocked. The parent then gets "Child agent finished its task", and the agent invocation ends as completed, not blocked.

The integration eval subagents.eval.ts › "when a child agent is missing input, it reports the block and the parent says what is missing" shows this. Live runs on #2156 failed 4 times in a row. In each run the child made no tool calls and replied with one sentence about the missing value. The parent now sets reasoning_level: "low" on spawnAgent, so the child answers in one step. Older recorded children searched first, and then they called reportBlocked.

The reportBlocked description said to call it when missing input "stops the task". The model reads a reply that names the gap as a finished answer, so it did not think that the task had stopped. The description now says to call the tool instead of a final text reply when the child cannot give the result that the task asks for. It also says that a reply that only says what is missing is not a result. The tool description is the one home for this rule (policies/agent-steering.md). The system prompt and the eval are unchanged.

How CI checks this: #2156 moved evals to the hosted Roach service, and it is merged into main. Roach has no recording for this case, and it drops recordings from failed tests. So the integration / shard 2/2 check on this PR calls the model live with the write token. Before #2156, main replayed an old recording from git, and that replay passed whatever the product did. A pass here is real evidence.

via Junior system actor event.

--

View Junior Session [Sentry]

@vercel

vercel Bot commented Oct 16, 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 16, 2026 3:40am UTC

Request Review

@dcramer
dcramer marked this pull request as ready for review October 16, 2026 03:22
@github-actions github-actions Bot added the risk: low PR risk score: low label Oct 16, 2026
@sentry-evals

sentry-evals Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 99 1 0 $0.79 0 300.60s

Base commit 238f7ee has no eval run to compare against.

},
description:
"End this delegated task as blocked. Call this when missing access, credentials, input, or a decision stops the task, also when a search for the missing part found nothing. Do not guess, mock, or fake results to work around it.",
"End this delegated task as blocked. Call this instead of a final text reply when you cannot give the result that the task asks for because access, credentials, input, or a decision is missing, also when a search for the missing part found nothing. A reply that only says what is missing is not a result. Do not guess, mock, or fake results to work around it.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the final text reply i dont think you get a choice on do you? given the assistant api contracts that exist? i might be forgetting something

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You do get a choice here. reportBlocked ends the run on the tool call. Its tool result returns terminate: true in packages/junior/src/chat/agent/index.ts (the FINISH_AUTOMATION_RUN_TOOL_NAME || REPORT_BLOCKED_TOOL_NAME branch), so no model call and no text reply follow it. finishAutomationRun works the same way. In the last step, the model either ends with text, which becomes the "finished" result, or it calls reportBlocked, which makes the agent invocation blocked. "Instead of a final text reply" means that choice.

This wording did not fix the eval. The case still failed live on both pushes: in each run the child replied with one sentence about the missing region and called no tools. I will revert the extra prompt-line edit, so that I do not stack prose that does not help. The root cause is still open.

@sentry-junior

sentry-junior Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Status: this change does not fix the eval yet. "Child Agents › when a child agent is missing input…" failed live in integration / shard 2/2 on 8f26613 (run 38844678298) and on 004013c (run 38845712623). 004013c also reworded the <child-agent-run> line in the system prompt, and f47acd3 reverts that. In every run the parent spawned the child with reasoning_level: "low". The child then sent one text sentence that said the region was not given, and it called no tools.

The last git recording (#2123) had a low-reasoning child that called reportBlocked at once. So something that changed the child request after #2123 probably caused the regression. The suspects are the tool list and the <disabled-tools> Turn context from #2148, listAgents for children (#2140), and the spawnAgent profile changes (#2141). I have not proved which one. Do not merge this as the fix.

This branch was successfully deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant