Skip to content

Preserve agent messages around timeline steers - #897

Merged
SawyerHood merged 1 commit into
mainfrom
agent/preserve-agent-messages-around-steers
Jul 30, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
agent/preserve-agent-messages-around-steers

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Jul 30, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

  • preserve the last assistant or error message for each human-boundary segment of a completed provider turn
  • keep that terminal message visible between the collapsed work summary and the following user steer
  • add regression coverage for accepted in-turn steers and external human new-turn boundaries

Why

Completed-turn grouping only preserved the globally final assistant message for a provider turn. When a human steer split a long provider turn into multiple visible exchanges, the preceding segment's last agent message remained inside the collapsed work summary and disappeared from the conversation flow.

This restores the intended visible order:

  1. user message
  2. collapsed work summary
  3. last agent message
  4. next user message

History tracing shows this behavior was introduced by a0c5475ab (June 23, "Split completed turn summaries at user boundaries"), not by the July timeline pagination optimizations.

Cross-version DOM audit

Three isolated builds were run against identical thread-only databases:

The corpus contains 19 selected threads and 45,418 events, spanning 10 to 10,207 events and including Codex/Claude threads, parent/child threads, giant completed turns, and multi-page histories. The databases contain no hosts, environments, project sources, daemon sessions, app settings, or Connect configuration.

After loading every older page, canonicalized top-level timeline row DOM was exact for all 19/19 threads between the pre-optimization and post-optimization builds. Canonicalization removed only transient inline transition measurements and generated Radix IDs; row order, IDs, structure, classes, attributes, and rendered text remained strict.

This PR changed 11/19 sampled threads by restoring 102 assistant rows at human boundaries. No conversation row was removed. Two now-empty collapsed summary rows disappeared because their only content became the visible assistant row; the remaining in-place text changes were collapsed-duration labels recalculated without the extracted terminal message.

Validation

  • full @bb/thread-view test suite: 345 tests passed
  • pnpm exec turbo run typecheck --filter=@bb/thread-view
  • rendered the originally reported production thread from an isolated thread-only import and confirmed the corrected DOM order in the browser
  • cross-version DOM audit described above: 19/19 optimization comparisons exact
  • git diff --check

@SawyerHood
SawyerHood force-pushed the agent/preserve-agent-messages-around-steers branch from 1f38991 to b8ef167 Compare July 30, 2026 00:44
@SawyerHood
SawyerHood marked this pull request as ready for review July 30, 2026 00:44
@SawyerHood
SawyerHood merged commit 45c8495 into main Jul 30, 2026
10 checks passed
@SawyerHood
SawyerHood deleted the agent/preserve-agent-messages-around-steers branch July 30, 2026 00:50
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