Repository navigation
ref(todos): Settle child To-dos from what the parent received - #4040
Conversation
…vocation A completed reply from a child with no Agent invocation is its result, so it closes the child's open To-dos done, as the row path does. Only the first send closes them, so a retry leaves later To-dos open. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
left a comment
There was a problem hiding this comment.
I don't really love that this whole thing is baked into the core of the harness when it's actually completely disconnected from the core and it's connected to a specific tool call
|
Re your review: agreed, it's in the wrong place. Today the result path (
Should I do 1 in this PR, replacing the current change and the row path's close? I'll hold #4040 until you answer. |
The To-dos store now closes a parent's open To-dos of a child agent when it reads them: done when the child completed, dropped when it stopped, and only when that work ended after the To-do's last change. Result delivery and the Agent invocation path no longer write To-dos. Co-Authored-By: David Cramer <[email protected]>
|
4 screenshot changes — 4 changed · 0 added · 0 removed Review screenshots in Frameshift
|
The thread-input harness can now end a run on a model message after its input, so the Turn saves its completed checkpoint as production does. A child with no Agent invocation then reads as completed, and the test shows that its parent's open To-dos close as done. Co-Authored-By: David Cramer <[email protected]>
This comment has been minimized.
This comment has been minimized.
A child's result now stores how its work ended next to its sender. The To-dos store closes a child's open To-do when a completed or stopped result from that child waits in the parent's mailbox and is newer than the To-do's last change. A person's Turn in a Thread and late bookkeeping writes no longer close To-dos, because neither sends a result. Co-Authored-By: David Cramer <[email protected]>
|
Reworked in 7052dd0f4. Only
|
…-on-result Co-Authored-By: David Cramer <[email protected]> # Conflicts: # packages/junior/src/chat/agent-invocations/child-message.ts # packages/junior/src/chat/agent-invocations/result.ts # packages/junior/tests/fixtures/thread-input.ts # packages/junior/tests/integration/agent-invocation-work.test.ts # packages/junior/tests/integration/update-todos.test.ts
…-on-result # Conflicts: # packages/junior/src/chat/agent-invocations/result.ts # packages/junior/src/chat/todos/store.ts # packages/junior/tests/fixtures/thread-input.ts
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 e3edcba. Configure here.
| ] | ||
| : []; | ||
| }); | ||
| } |
There was a problem hiding this comment.
To-do settlement relies on short-lived mailbox state
Medium Severity
readReceivedChildResults only looks at execution.pendingMessages. A child's result counts only if some listTodos call happens while that message is still in the mailbox. If the message is removed first, the To-do stays open for good. For example, completeConversationStop filters out the stopped run's pending messages, and with them any child completed/stopped results waiting there.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e3edcba. Configure here.
There was a problem hiding this comment.
Declining this one. The example doesn't hold: stopConversationWork puts only person input (isPersonInput: web or slack) into the stop request, and completeConversationStop removes only those ids. A child's completed or stopped result is agent input, so a stop never removes it from the mailbox.
The general concern is the same as the earlier thread (#4040 (comment)). Every parent Turn reads its To-dos in loadPromptTurnContext before it acks its input, so it settles them while the result is still pending. A result that the parent never takes in leaves its To-dos open on purpose, because the parent never received it.
Main now stores a child result's status as metadata.event.status, so the To-dos store reads it there and the separate metadata.result copy goes. Co-Authored-By: David Cramer <[email protected]>


Only the To-dos feature (
chat/todos/) changes To-dos. Result delivery, stops, the agent loop, and the Agent invocation path no longer write them. Before, those core paths closed a child's To-dos themselves, which tied them to one tool's state.A To-do assigned to a child agent closes as
donewhen a reply or completed result from that child reached the parent after the To-do last changed, and asdroppedon astoppedresult.The To-dos store reads each child result's stored status (
metadata.event.status) to telldonefromdropped. No new state and no loop hooks.via @dcramer.
--
View Session [Sentry]