Skip to content

Add an experiment that puts the NEW divider before a finished turn's final assistant message - #6327

Merged
ymichael merged 1 commit into
mainfrom
bb/refine-turn-divider-visibility-thr_eftt6umurz
Oct 26, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/refine-turn-divider-visibility-thr_eftt6umurz

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

When finished turns are flat (Claude Code's default), the unread NEW divider went above the first row after the read point. For a turn that ran while the reader was away, that row is the turn's first tool call. Opening the thread landed on "Listed files in ." and the reader had to scroll through every tool call and note to reach the answer. With collapsed turns the same rule put NEW above the "Worked for …" row. That's harmless there, but it isn't where reading resumes either.

What changed

New experiment unreadDividerAtAnswer (Settings → Experiments → NEW divider before final assistant message, or bb settings experiment unreadDividerAtAnswer true). It is off by default and stays off for early adopters.

  • ThreadTimelineUnreadDividerPlacement gains anchor: "first-unread-row" | "turn-answer". useThreadDetailThread sets it from the experiment, and useThreadUnreadDividerState keeps it in the opening snapshot, so the landing logic from Timeline: one attach rule, and one landing decision for unread threads #6253 is unchanged.
  • With turn-answer, findUnreadDividerIndex starts from the same first unread row and moves forward to the first row where reading resumes:
    • the final assistant message of a settled turn (the last assistant row with that turn id);
    • an error that ended the turn;
    • a message that starts a new turn, such as an agent report (steers excluded);
    • any row of a turn with no reply.
    • Setup system rows such as "Provisioned thread" are skipped. The running turn (when scopeActive) keeps the old placement, so NEW never jumps onto a streaming reply. If nothing qualifies, it falls back to the first unread row. NEW still never sits on the reader's own message.
  • With first-unread-row (experiment off), placement is unchanged.
  • Docs: docs/configuration.md (Experiments) and bb guide customization.
  • Client and settings only. No wire change and no HOST_DAEMON_PROTOCOL_VERSION bump. The experiment key is added to @bb/domain, so the existing experiments route and CLI accept it.

How you verified

  • New unit cases in ThreadTimelineRows.unread-divider.test.ts (turn-answer anchor):
    • final answer of a flat turn and of a collapsed turn;
    • setup rows skipped;
    • an agent message that starts a turn;
    • an error that ended the turn;
    • a turn with no reply;
    • a running turn;
    • a partly seen work group;
    • the reader's own message.
  • main's existing cases still run against the first-unread-row anchor.
  • pnpm exec turbo run typecheck lint --filter='...[origin/main]': 146/146 tasks.
  • turbo run test --filter=@bb/app: 6,332 tests. --filter=@bb/domain: 259. apps/server test/system: 237, including the experiment defaults, PUT and early-adopter tests.
  • Real app on pnpm start:worktree:
    • Threads were real Claude Code and Codex turns spawned with the dev bb CLI.
    • Compared against an origin/main app build served on the same server and data, with the same read point. Each thread was opened from the sidebar at 1280×800, and the row after NEW was read from the DOM.
Build Experiment Thread Row after NEW
origin/main n/a Claude Code (flat) Listed files in . (first tool call)
branch off Claude Code (flat) Listed files in .
branch on Claude Code (flat) Final assistant message (step note + summary)
origin/main n/a Codex (collapsed) Worked for 24s
branch off Codex (collapsed) Worked for 24s
branch on Codex (collapsed) The numbered answer
  • Regression checks on the branch with the experiment on:
    • a thread marked unread (bb thread unread) and a read thread both open with no NEW, as on main;
    • the Settings switch flips the server value both ways;
    • turning on the early-adopter setting leaves the experiment off;
    • the CLI rejects maybe and a misspelled key.
  • Not changed here: a turn that finishes while its thread is open can still show NEW afterwards. main does the same, and the branch only moves that divider to the reply.

AGENT GENERATED

🤖 Generated with Claude Code

…final assistant message

With finished turns flat, NEW sat above the first tool call of the turn
that ran while the reader was away, so opening the thread replayed the
whole turn before the answer. The unreadDividerAtAnswer experiment moves
NEW to the settled turn's final assistant message, or the error that
ended it. Off, placement is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymichael
ymichael merged commit b7bd02b into main Oct 26, 2026
94 of 95 checks passed
@ymichael
ymichael deleted the bb/refine-turn-divider-visibility-thr_eftt6umurz branch October 26, 2026 18:23
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