Repository navigation
feat(agents): Deliver child updates through the starter's Watch - #4271
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A child agent's Turn end now reaches its parent through publishAgentUpdate, the same path that Watches use. The parent edge is the starter's Watch: it never expires, and watchEvents on your own child returns it. A noReply Turn that only the child's own Watch Events started gives the parent a quiet note. Final text wakes the parent. The update status completed is now done, and the watch resource type conversation is now agent; stored values with the old names still read. Co-Authored-By: David Cramer <[email protected]>
a8ce184 to
2db7bfa
Compare
|
2 screenshot changes — 2 changed · 0 added · 0 removed Review screenshots in Frameshift
|
…e type Co-Authored-By: David Cramer <[email protected]>
dcramer
left a comment
There was a problem hiding this comment.
It's fine, but we're gonna need to clean up the legacy stuff too. That can be in another PR
Co-Authored-By: David Cramer <[email protected]> # Conflicts: # packages/junior/src/api/lead/routes.ts # packages/junior/src/chat/tools/start-conversation.ts
|
I think agents are supposed to just deliver a response no matter what and let the parent agent decide if it should act or not. Don't put that on the child. So no quiet note based on the tool call. Unless you think there's a problem with that |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 325edff. Configure here.
| quiet: | ||
| (await startedByEventsOnly()) || | ||
| (await childWorkGoesOn(input.conversationId)), | ||
| }; |
There was a problem hiding this comment.
Catch republish drops child answer
High Severity
Child final text lives only on the complete caller as answer, and is not stored on the terminal event. Parent delivery now happens in that publish. If starter enqueue throws after turn_completed is written, the last attempt's catch calls lifecycle.fail(), which cannot overwrite the terminal and republishes the completed Turn without answer. readTurnUpdate then yields empty done text, so the parent can close waiting_on on (empty) and the child's real reply is never delivered.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 325edff. Configure here.
|
Agreed. It also matches The parent closes a child's To-dos on the child's newest result (
What I'd do: drop |
This is the daily design doc audit of `design/` at 0ac434c34. It covers main commits from 00967f406. @dcramer confirmed the exact text of every changed line and each intent change. **New gaps** - `inbox.md`: in a private Space, the Inbox lists and counts a "To do for you" item by Participants and Destination, not by Space membership (#4279). - `inbox.md`: a typed message leaves a question for Everyone, or a question with no assignees, open (#4225). - `spaces.md`: a Space's Lead cannot archive a Conversation that it started. - `spaces.md`: a Space's Lead has no To-do list. - `spaces.md`: the public MCP server does not show a Conversation's Space. - `spaces.md`: private work cannot move out of its Space, and only public work can join a Space (#4279). - `inbox-stacks.md`: on a phone, question rows and "To do for you" rows show the names of Dismiss and Snooze. **Intent changes** - `inbox.md`: "Only an assignee answers a private item" is now scoped to private items that have assignees. This matches the no-assignee rule confirmed in #4218. **Closed or corrected** - `agent-teams.md`: removes three closed gaps. Thread and Task replies, and cut-off text counted as a reply, were closed by #4180. `noReply` with a Watch sending no update was closed by #4271. - `agent-teams.md`: the toolset gap now names only the Lead, because `spawnAgent` is gone (#4182). The Watch Events gap is narrowed, because the starter now gets the update (#4271). - `child-agents.md`: the kind gap now quotes the rule from #4292 and adds #4275. - `inbox-stacks.md`: the stack gap uses "summary", not "Brief", and names the rule that it breaks. **Cuts** - `agent-teams.md`: "from the same code". - `github.md`: the cache and tables detail. - `inbox-stacks.md`: a repeat of `inbox.md`, the title layout detail, and the code change row click line. - `sandbox-credentials.md`: the intro is scoped to requests that ask for access. - `context-compaction.md`: the setting name. **Skipped** - `guardian.md`: the Lead wording and the child-agent Inbox gap. Open #4139 covers both. - `github.md`: the draft conflict and Watch expiry gaps. Open #3885 covers both. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent-dispatch%3Adispatch_4a4fb37d9a36598fc60b2e47348ad753 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_4a4fb37d9a36598fc60b2e47348ad753) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_4a4fb37d9a36598fc60b2e47348ad753/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>


A parent now hears from its child agents through the same
agent.updatedelivery as any Watch (design/agent-teams.md,design/child-agents.md). Track 2 of 5.What changes
publishAgentUpdatedelivers to the starter first, then to stored Watches. The starter's Watch is the stored parent edge: it never expires, no stop cancels it, and it is not a Watch record.enqueueChildResultToParent,createDeliverToParent, thesendToParent/reportFailureladder inconversation-turn.ts,childWorkEnded, and theendResult/failureNoticebehavior fields are gone. The Turn lifecycle is the only publisher; worker-crash and person-stop updates use the same function. The parent's Turn still runs as the Actor from the parent relation (parentResultActor), andwaiting_onis unchanged.noReplygives the parent a Conversation note that carries the child's note, not a Turn. AnoReplywhile the child's work goes on is also a note. Final text wakes the parent. Blocked, failed, and stopped wake it as before.completed→done(readAgentUpdateStatusstill readscompleted). Watch resource typeconversation→agent(isAgentResourceTypestill reads storedconversationWatches). Event keys keep their old prefix, so a retry across the deploy delivers once. The Lead dashboard readsdoneand keepscompletedfor stored transcripts.watchEventson your own child returns the starter's Watch (starter:<child>) and stores nothing.done, so the parent's To-do for that Thread closes.Design gaps
Closes these Gap lines in
design/agent-teams.md:reply…"noReplywhile the agent has a Watch sends no update…"Still open:
waitingupdate. Only stored Watches on the child hear it.Related PRs
juniorand typeagent.update.status="completed"regexes needdone.via @dcramer.
--
View Session [Sentry]