Repository navigation
fix(agents): List a child's last result from its newest finished Turn - #4173
Conversation
listAgents shows last_result completed and blocked again. They come from the newest subagent_ended marker that the parent stores for each child, read in the listing query. A failed last Turn still lists failed. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Isn't there a standard way to get the status of a conversation that we should be reading? |
The child's own Turn lifecycle Events, the newest turn_completed or turn_failed, give its last result in place of the parent's markers. A person's Turn in a Thread now counts too.
|
Yes. I switched the PR to them in 9f812c4df. The child's newest |
|
1 screenshot change — 1 changed · 0 added · 0 removed Review screenshots in Frameshift
|
…result # Conflicts: # packages/junior/src/chat/agent-invocations/list.ts # packages/junior/tests/integration/agent-invocation-work.test.ts # packages/junior/tests/integration/child-conversation-loop.test.ts
dcramer
left a comment
There was a problem hiding this comment.
Make sure this is aligned with the way we get results for any conversation in the system. And we're not doing something that's a one-off here for this specific thing
This comment has been minimized.
This comment has been minimized.
A cancelled Turn is a stop, not a result, so the last-outcome read skips it. Only conversationTurnFailedSql decides failed.
…result # Conflicts: # packages/junior/src/chat/conversations/sql/status.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 9454bff. Configure here.
The listing's outcome read now maps turn_failed to failed and skips cancelled Turns, so a stopped or retried Turn after a failure still lists failed. It is the only source of last_result.
…result Co-Authored-By: David Cramer <[email protected]>
listAgents had its own completed/blocked/failed mapping of Turn outcomes. It now uses TURN_OUTCOME_STATUSES, the map that readTurnUpdate uses for every Conversation's agent update, and lists done, blocked, or failed like <agent-result>. Co-Authored-By: David Cramer <[email protected]>
|
Is the failing eval related |
|
No, neither failing eval comes from this change.
|

listAgentslostlast_resultdoneandblockedwhen the legacy Agent invocation rows went away (#4043). Onlyfailedcame back, in #4057.It now uses main's
readTurnUpdatemapping.turn-update.tsexportsTURN_OUTCOME_STATUSES, which bothreadTurnUpdateandlistChildAgentsuse. Solast_resultuses the same words as<agent-result status>:done,blocked, orfailed(it wascompletedbefore).The listing reads the child's own Turn lifecycle Events: the newest
turn_completedorturn_failedthat is not a stop.turn_failedgivesfailed. A cancelled Turn is skipped, so a stop or a retry keeps the result from before it.conversationTurnFailedSqlstill decides the child'sfailedstatus. A person's Turn in a Thread counts like any other Turn. The read is a subquery in the existing listing query, so it adds no statement.via @dcramer.
--
View Session [Sentry]