Repository navigation
Scope thread.idle and thread output to the latest turn's root reply - #6893
Merged
ymichael merged 1 commit intoNov 3, 2026
Merged
Conversation
getLastThreadOutput returned the latest non-empty agent message of the whole thread, including subagent messages and legacy system/manager/user_message events. After a turn with no root reply, the thread.idle lastAssistantText (push "turn finished" text, Workflows agent() results) and GET /threads/:id/output (bb thread output) repeated an earlier turn's text or showed a subagent's text. Both now read the final root agent message of the latest root turn through getTurnFinalOutput, the query child completion notices use since #6821. getLastThreadOutput and getLatestThreadOutputEventRow are deleted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/one-turn-scoped-final-reply-query-thr_n97gzs93hu
branch
November 3, 2026 18:44
gpambrozio
added a commit
to gpambrozio/bb-plugins
that referenced
this pull request
Nov 6, 2026
…ion (bb 0.49) (#98) bb 0.49 (get-bb/bb#6893) gives thread.idle's lastAssistantText and threads.output only the latest turn's reply, so crew autocompact's compaction turn yields nothing and the board dropped a blocked, needs-decision, failed or paused crewmate to Idle. ReportCache now keeps the report it has on a blank text and, with none cached, reads the last root agentMessage from the event log (100-row pages). The charter gets the same fallback for `bb thread output`, words the crew listing for bb 0.47-0.49 (archived threads left out from 0.49), and uses `bb git status <environment-id>` for git state, keeping `bb thread show --work-status` for bb 0.47. Refs #75. Co-authored-by: marvin-ambrozio <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
getLastThreadOutputreturned the latest non-empty agent message anywhere in the thread, including subagent messages and legacysystem/manager/user_messageevents. It fed thethread.idlelastAssistantText(push "turn finished" text, Workflowsagent()results) andGET /threads/:id/output(bb thread output). After a turn with no top-level reply, these repeated an earlier turn's text or showed a subagent's text. #6821 fixed the same drift for child completion notices only.What changed
apps/server/src/services/threads/thread-data.ts:getLatestTurnFinalOutputreturns the final top-level agent message of the latest root turn, through the samegetTurnFinalOutputquery child notices use.getLastThreadOutputis deleted.thread.idle(plugin-service.ts) and the output route (routes/threads/data.ts) use it, so they still agree as the SDK doc comment says.packages/db: deleted the now-unusedgetLatestThreadOutputEventRowand its tests.lastAssistantTextas the latest turn's final reply.No plugin SDK, host-daemon protocol or RPC contract changes. The legacy
system/manager/user_messagesource is dropped, as #6821 did; nothing writes it any more.How you verified
plugin-thread-events.test.tsruns three turns and checks boththread.idleand the output route: a reply after subagent work, a turn with no reply, and a turn with only subagent output. It failed before the fix (the no-reply turn returned "First result.") and passes after.turn/startedbefore their replies, matching real event order.pnpm exec turbo run typecheck lint --filter=@bb/server --filter=@bb/db: passed.pnpm exec turbo run test --filter=@bb/db --filter=@bb/server: all pass exceptinstall-machine-script.test.ts"treats launch-agent readiness as authoritative after bootstrap". That test is intermittent locally: it passes on unchangedorigin/mainand on this branch when run alone, and failed in some runs alongsideheroes.test.tson a loaded machine. This change does not touch the install script or its test.