Skip to content

Avoid duplicate steers in expanded turn details - #2378

Merged
ymichael merged 1 commit into
mainfrom
bb/investigate-duplicate-steer-messages-thr_gbzmcetwsc
Aug 25, 2026
Merged

Avoid duplicate steers in expanded turn details#2378
ymichael merged 1 commit into
mainfrom
bb/investigate-duplicate-steer-messages-thr_gbzmcetwsc

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

What was wrong

When a long-running work item began before a human steer and completed after it, the collapsed turn summary's source range necessarily overlapped the steer. Lazy summary hydration does not include the later turn/completed event, so it fell back to an ungrouped projection that returned the accepted steer even though the root timeline already rendered the same row.

What changed

Filter accepted human steer rows from the lazy ungrouped turn-detail fallback, matching the existing eager-child behavior and leaving agent- and system-initiated in-turn input untouched. Added an integration regression that seeds a command spanning an accepted steer and verifies the steer appears once at the root and not in the expanded details. There are no wire, protocol, CLI, or documentation changes.

How you verified

  • Added a regression that failed before the fix and passes after it.
  • pnpm exec turbo run test --filter=@bb/server -- --run test/services/threads/timeline-in-turn-window.test.ts (25 passed)
  • pnpm exec turbo run test --filter=@bb/thread-view --force (368 passed)
  • pnpm exec turbo run typecheck --filter=@bb/thread-view --filter=@bb/server
  • pnpm exec turbo run test --filter=@bb/server --force (2,017 passed)
  • git diff --check

Fixes # — no linked issue.

AGENT GENERATED

@ymichael
ymichael merged commit e577d54 into main Aug 25, 2026
15 checks passed
@ymichael
ymichael deleted the bb/investigate-duplicate-steer-messages-thr_gbzmcetwsc branch August 25, 2026 04:21
ymichael added a commit that referenced this pull request Aug 25, 2026
## What was wrong

The lazy expanded-details projection filtered only accepted human
steers. Rejected human steers are also root-owned, so a rejected steer
spanning a completed work item appeared once in the root timeline and
again inside the expanded summary.

## What changed

Renamed the shared predicate around the ownership invariant and removed
its accepted-status restriction while retaining the human-initiator and
steer-kind checks. The persisted-event regression now covers accepted
and rejected outcomes and proves each appears once at the root and never
in expanded details. No server/daemon wire contract changed;
`HOST_DAEMON_PROTOCOL_VERSION` remains 166.

## How you verified

- Red: `pnpm exec turbo run test --filter=@bb/server --force -- --run
test/services/threads/timeline-in-turn-window.test.ts` failed only the
new rejected case (25 passed, 1 failed) because details contained the
rejected steer.
- Green: the same focused command passed 26/26 tests.
- `pnpm exec turbo run test --filter=@bb/thread-view --force` passed
368/368 tests.
- `pnpm exec turbo run typecheck --filter=@bb/thread-view
--filter=@bb/server` passed all 5 Turbo tasks.
- Changed-file formatting and `git diff --check` passed.

Fixes #2378

> AGENT GENERATED
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.

1 participant