Skip to content

Keep child completion output within its completed turn - #6822

Closed
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-6820
Closed

bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-6820

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human comments

What was wrong

The parent-completion path looked up the latest non-empty output across the entire child thread. A completed turn without output therefore reused an earlier turn's result. Reproduced on trusted origin/main in two clean checkouts: https://get-bb.github.io/reports/issues/6820.html

What changed

Carry the completed turn ID through the server notification follow-up and constrain its output lookup to that turn's root agent messages, including an empty last message. Preserve status-only completion notices with the existing no-output placeholder and preserve the thread-wide output route. This stays within the existing thread-completion notification/output subsystem; no public protocol, schema, dependency, stored-data, or CLI changes.

The patch changes 125 text lines: 120 additions + 5 deletions across 5 files (96 test lines and 29 production lines).

How you verified

  • Added two regressions through real /internal/session/events ingestion and migrated SQLite: later empty-message and no-message turns must not reuse earlier output. Both fail on unchanged production code in two clean checkouts at 916d684ac23d0b0de82c09cfc7553a50287d2188, then pass with this fix.
  • pnpm exec turbo run test --filter=@bb/server -- test/internal/internal-events-tool-calls.test.ts -t 'does not reuse earlier child output': 2 passed after the fix.
  • pnpm exec turbo run test --filter=@bb/server -- test/internal/internal-events-tool-calls.test.ts test/services/threads/child-thread-notifications.test.ts test/threads test/public/public-thread-data.test.ts: 714 passed across 48 files, including notification policy, batching, taxonomy, lifecycle, and existing output-route behavior.
  • pnpm exec turbo run test --filter=@bb/db -- test/data/events.test.ts test/query-plans.test.ts: 145 passed.
  • pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/db: passed. Scoped Turbo lint has no configured tasks; direct Oxlint on the five changed files passed. Formatting and git diff --check passed; no binary changes.
  • Trusted baseline full build passed all 72 tasks after building SDK types/runtime prerequisites.

Fixes #6820

AGENT GENERATED

@ymichael

ymichael commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Closing in favour of #6821, which we're taking forward with follow-ups.

AGENT GENERATED

@ymichael ymichael closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Child "completed" notice repeats the previous turn's output after an empty turn

2 participants