#7251 · Provider notices escape the running turn during timeline projection
Base: 55135d1e5045d6c5d3c24f5a4d5556ed3e11cb00, fetched from trusted get-bb/bb origin/main.
Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro.
1. TL;DR
A provider notice received before an assistant answer can appear after that answer in the timeline. The notice is not delayed in transport: its event sequence is earlier, but the projection treats thread-scoped notices as standalone entries. The row planner expands the whole earlier-starting turn, including its answer, before emitting the notice. The same ordering failure occurs in collapsed and flat output, with general, configuration and deprecation notices. Two clean checkouts reproduced the data-ordering failure without a model, desktop app, network request, custom theme or user database.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| A thread-level warning during a turn follows an answer emitted later. | Verified | Six failing cases: three warning categories × two display modes; received sequences [80, 40], expected [40, 80]. |
| Changing display mode does not fix chronology. | Verified | Both collapse and flat fail identically. |
| Before-turn, after-turn and turn-scoped warnings do not show this inversion. | Verified | 24 controls pass, including notices received after the answer but before turn completion. |
| The reported macOS incident and theme dimming arose from this defect. | Unverified | No private logs, macOS app, user theme or original turn were accessed. This report proves the shared projection result, not a fresh desktop/provider end-to-end incident. |
3. Environment
- Linux x86_64; Node v22.19.0; pnpm 9.15.0.
- Trusted base commit:
55135d1e5045d6c5d3c24f5a4d5556ed3e11cb00. - Separate source and verification checkouts; frozen dependency installs, no added dependency.
- No server, provider process, TCP port or product data directory used.
- Full repository build passed (73 tasks). The initial cold build hit an SDK build-order race; building the SDK through Turbo and retrying the unchanged full build succeeded.
4. Minimal reproduction
- Clone the trusted public repository and check out the recorded base:
git clone https://github.com/get-bb/bb.git bb-7251 cd bb-7251 git checkout 55135d1e5045d6c5d3c24f5a4d5556ed3e11cb00 pnpm install --frozen-lockfile --prefer-offline
- Save the inline agent-authored regression test as
packages/thread-view/test/provider-warning-chronology.test.ts. This fixture was derived from the trusted repository test factory and projection API, not from an issue script. - Run:
pnpm exec turbo run test --filter=@bb/thread-view -- test/provider-warning-chronology.test.ts
Exit code 1 is the expected reproduction result on the recorded base. The matrix covers warning positions before a turn, before an answer, after an answer and after completion, plus a turn-scoped control.
Expected and actual output excerpts:
AssertionError: expected [ 80, 40 ] to deeply equal [ 40, 80 ]
- Expected
+ Received
[
- 40,
80,
+ 40,
]
Tests 6 failed | 24 passed (30)
Sequence 40 is the notice; sequence 80 is the assistant answer. The assertion reads the actual timeline row order, descending through collapsed children. The shared fixture also validates source ownership and lazy turn-details ownership. This is an offline projection reproduction, not a screenshot or visual desktop verification.
Full reproducible regression test
import { threadScope, turnScope } from "@bb/domain";
import { describe, expect, it } from "vitest";
import {
createTimelineEventFactory,
flattenTimelineRows,
renderTimelineFixture,
} from "./timeline-test-harness.js";
const warningCases = [
{ location: "before the turn", seq: 10, scope: threadScope() },
{ location: "during the turn", seq: 40, scope: threadScope() },
{ location: "after the answer", seq: 90, scope: threadScope() },
{ location: "after the turn", seq: 110, scope: threadScope() },
{ location: "inside turn scope", seq: 40, scope: turnScope("turn-1") },
];
describe.each(["collapse", "flat"] as const)(
"%s provider warning chronology",
(completedTurnDisplay) => {
describe.each(["general", "config", "deprecation"] as const)(
"%s warnings",
(category) => {
it.each(warningCases)(
"preserves sequence order for a warning $location",
({ seq, scope }) => {
const event = createTimelineEventFactory({
threadId: "thread-1",
turnId: "turn-1",
});
const warning = event.providerWarning({
seq,
category,
summary: "Provider notice",
});
const rendered = renderTimelineFixture({
completedTurnDisplay,
events: [
event.turnStarted({ seq: 20 }),
{ ...warning, scope },
event.assistantCompleted({ seq: 80, text: "Answer ready" }),
event.turnCompleted({ seq: 100 }),
].sort((left, right) => left.seq - right.seq),
projectionOptions: {
threadStatus: "idle",
turnMessageDetail: "full",
},
});
const messageRows = flattenTimelineRows(rendered.rows).filter(
(row) => row.kind === "system" || row.kind === "conversation",
);
expect(messageRows.map((row) => row.sourceSeqStart)).toEqual(
seq < 80 ? [seq, 80] : [80, seq],
);
},
);
},
);
},
);
5. Root cause
Warning parsing maps provider notices to operation messages with type warning or deprecation, preserving thread scope. In the grouping eligibility check, only permission, plugin-form and user-question lifecycle messages can be associated with the turn running at their sequence. Warnings are excluded.
The thread-scope branch therefore puts the notice in a standalone projection entry. Entry sorting places the earlier-starting turn first. Finally, the row planner expands that whole turn before the standalone notice:
return projection.entries.flatMap((entry) =>
entry.kind === "projected-message"
? [messagePlan(entry.message)]
: planTurn(entry.turn, completedTurnDisplay, rowIdPrefix),
);
This explains why changing display mode cannot solve the problem. Sorting the final rows globally would be a weaker fix because summary rows span turns and must retain their existing grouping and lazy-details semantics.
6. Proposed fix
Extend the existing running-turn association to operation messages whose type is warning or deprecation. Keep their stored event scope unchanged. Reuse the existing sequence-based running-turn selection, so notices outside a turn remain standalone and notices after an answer remain after it. This is a local projection fix in the thread-view subsystem; no protocol, schema, stored data, dependencies or packaging changes are needed.
The local patch passes all 30 chronology cases, all 540 thread-view tests, thread-view typechecking, and 55 existing server timeline tests covering caching, window pagination, completed-turn display and lazy details. The test was added and observed failing before production code changed. The fix changes two files in one subsystem: 64 additions plus four deletions, 68 total changed text lines, with no binary changes. See the exact patch and verification logs below.
Exact local fix (68 changed text lines)
diff --git a/packages/thread-view/src/group-event-projection-turns.ts b/packages/thread-view/src/group-event-projection-turns.ts
index d7485c878b..557f85ec76 100644
--- a/packages/thread-view/src/group-event-projection-turns.ts
+++ b/packages/thread-view/src/group-event-projection-turns.ts
@@ -161,10 +161,10 @@ function addProjectionTurnMessage(
});
}
-function isInteractionLifecycleMessage(
- message: EventProjectionMessage,
-): boolean {
+function canGroupThreadMessageInTurn(message: EventProjectionMessage): boolean {
switch (message.kind) {
+ case "operation":
+ return message.opType === "warning" || message.opType === "deprecation";
case "permission-grant-lifecycle":
case "plugin-form-lifecycle":
case "user-question-lifecycle":
@@ -341,7 +341,7 @@ export function groupEventProjectionTurns(
for (const message of args.messages) {
if (message.scope.kind === "thread") {
- const runningTurn = isInteractionLifecycleMessage(message)
+ const runningTurn = canGroupThreadMessageInTurn(message)
? findTurnRunningAtSequence(turnsById, message.sourceSeqStart)
: null;
if (runningTurn !== null) {
diff --git a/packages/thread-view/test/provider-warning-chronology.test.ts b/packages/thread-view/test/provider-warning-chronology.test.ts
new file mode 100644
index 0000000000..dafb9d84ab
--- /dev/null
+++ b/packages/thread-view/test/provider-warning-chronology.test.ts
@@ -0,0 +1,60 @@
+import { threadScope, turnScope } from "@bb/domain";
+import { describe, expect, it } from "vitest";
+import {
+ createTimelineEventFactory,
+ flattenTimelineRows,
+ renderTimelineFixture,
+} from "./timeline-test-harness.js";
+
+const warningCases = [
+ { location: "before the turn", seq: 10, scope: threadScope() },
+ { location: "during the turn", seq: 40, scope: threadScope() },
+ { location: "after the answer", seq: 90, scope: threadScope() },
+ { location: "after the turn", seq: 110, scope: threadScope() },
+ { location: "inside turn scope", seq: 40, scope: turnScope("turn-1") },
+];
+
+describe.each(["collapse", "flat"] as const)(
+ "%s provider warning chronology",
+ (completedTurnDisplay) => {
+ describe.each(["general", "config", "deprecation"] as const)(
+ "%s warnings",
+ (category) => {
+ it.each(warningCases)(
+ "preserves sequence order for a warning $location",
+ ({ seq, scope }) => {
+ const event = createTimelineEventFactory({
+ threadId: "thread-1",
+ turnId: "turn-1",
+ });
+ const warning = event.providerWarning({
+ seq,
+ category,
+ summary: "Provider notice",
+ });
+ const rendered = renderTimelineFixture({
+ completedTurnDisplay,
+ events: [
+ event.turnStarted({ seq: 20 }),
+ { ...warning, scope },
+ event.assistantCompleted({ seq: 80, text: "Answer ready" }),
+ event.turnCompleted({ seq: 100 }),
+ ].sort((left, right) => left.seq - right.seq),
+ projectionOptions: {
+ threadStatus: "idle",
+ turnMessageDetail: "full",
+ },
+ });
+ const messageRows = flattenTimelineRows(rendered.rows).filter(
+ (row) => row.kind === "system" || row.kind === "conversation",
+ );
+
+ expect(messageRows.map((row) => row.sourceSeqStart)).toEqual(
+ seq < 80 ? [seq, 80] : [80, seq],
+ );
+ },
+ );
+ },
+ );
+ },
+);
7. Verification
The same agent repeated the reproduction in a second clean checkout at 55135d1e5045d6c5d3c24f5a4d5556ed3e11cb00. The verification checkout was created with git clone --shared --no-checkout and detached at the base; only the new test was copied in. A separate frozen install preceded the same Turbo test command. Both executions returned exit code 1, with exactly six chronology failures and 24 passing controls. These are two direct runs by one agent, not independent verification.
- First trusted-base run: six failures and 24 controls passing.
- Second clean trusted-base run: same six failures and 24 controls passing.
- Fixed full thread-view suite and typecheck: 33 files, 540 tests passed.
Existing server timeline suite: four files, 55 tests passed. Command:
pnpm exec turbo run test --filter=@bb/server -- test/services/threads/timeline-in-turn-window.test.ts test/services/threads/timeline-cache.test.ts test/public/public-thread-timeline-completed-turn-display.test.ts test/public/public-thread-timeline-turn-details.test.ts
No correction to the root cause or verdict was necessary after the second run. A missing explicit test option was supplied after the initial typecheck; this changed no fixture events or assertions.
Verbatim successful test-summary excerpts:
Thread-view:
Test Files 33 passed (33)
Tests 540 passed (540)
Server timeline:
Test Files 4 passed (4)
Tests 55 passed (55)
Raw evidence is retained locally and is not published, in accordance with the reports repository privacy and artifact policy. The complete test and patch are inline above.
8. Related issues and pull requests
No linked pull request was present in issue timeline metadata, and an open-PR search for this issue number returned no match before the fix. A small sample of recently classified thread issues was reviewed for classification conventions; no related issue is claimed here.
9. Appendix and limits
Reproduction commands: frozen install, the focused Turbo command above, pnpm exec turbo run build; fix validation: pnpm exec oxfmt packages/thread-view/src/group-event-projection-turns.ts packages/thread-view/test/provider-warning-chronology.test.ts, pnpm exec turbo run test typecheck lint --filter=@bb/thread-view (this package declares no lint task), and git diff --check.
The issue body and links were treated as untrusted claims. No linked external content was fetched or executed, and no instructions or scripts from the issue were followed. No original user runtime data or credentials were read. The report does not estimate incidence or claim macOS, theme, live-provider or desktop verification.