Repository navigation
Show completed thinking in thread history - #3066
SawyerHood merged 4 commits into
Conversation
Render completed, non-empty reasoning as expandable `Thought for <duration>` entries through the existing generic operation timeline row. Preserve persisted timing, event ordering, turn and parent scope, and completed or interrupted status. Keep active reasoning in the existing `Thinking…` disclosure, and reject late deltas after finalization so one reasoning lifecycle produces at most one completed entry. Refs get-bb#1248
|
@slopcop review |
|
🚨 SLOP COP 🚨 · I’m reviewing this pull request now. I’ll check security, code quality and architecture (including duplication), performance, and the user-facing behavior before posting a consolidated review. |
acp-cursor/resume rows 2->4, acp-cursor/stop-interrupt rows 3->5. Events unchanged; the show-completed-thinking change retains completed reasoning as operation rows.
|
CI diagnosis for the
Root cause: this PR intentionally retains completed reasoning as timeline operation rows ( Fix: I regenerated
|
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Plain-English summary: this change keeps provider-visible thinking after a response finishes. It adds an expandable Thought for <duration> entry inside the existing Worked for… history row, while leaving in-progress thinking in the current live disclosure.
I found two behavior issues and one required fixture update:
- A turn that ends with
status: "failed"labels its unfinished reasoning ascompleted. I reproduced this on the exact PR head: the parent turn came back aserror, but its childThought for 4srow came back ascompleted. That should be interrupted/error-aligned rather than successful. - Completed reasoning is copied into a generic system-row
detail, so it bypasses the timeline's existing 32,000-character truncation and 4,000-character preview paths for work output. I inserted a valid 50,000-character reasoning completion and the turn-summary-details API returned all 50,000 characters. This needs a bounded preview/lazy-detail path or equivalent truncation for reasoning details. - The full package gate is currently red because the intended new rows changed two provider-parity counts without updating the pins:
acp-cursor/resumeis now 4 rows (pinned 2), andacp-cursor/stop-interruptis now 5 rows (pinned 3). I reproduced the same@bb/provider-parityfailure locally;packages/provider-bridge-protocol/recordings/row-counts.jsonneeds the intentional count updates.
Security review found no HTML/Markdown injection path: the reasoning remains text-rendered, and the PR does not newly persist provider data. It does intentionally make interrupted, unfinished reasoning durable history; that matches the PR description, but it is worth confirming as product policy because it broadens how long transient reasoning is exposed.
Architecture/duplication scan: reusing the generic operation renderer avoids a duplicate UI component, and I did not find a stale parallel reasoning implementation. The tradeoff is that generic system rows do not participate in work-output limits; a semantic reasoning discriminator or a shared bounded-detail policy would close that gap cleanly.
Verification on 652619a01557499c5697f18f8e4f329147fd31ef:
@bb/thread-viewtypecheck passed.- All 374
@bb/thread-viewtests passed. @bb/provider-parityfailed with the two stale row-count pins above, matching GitHub CI.- Exact-head dev server + Doobie passed the user path: expand
Worked for 5s→ seeThought for 3s→ expand it → see the completed reasoning detail.
I’m leaving this as a comment review, per policy—not approving or requesting changes.
- Finalize open reasoning lifecycles as interrupted when their turn ends failed, not completed. - Cap completed reasoning detail at 32k chars with a truncation marker so reasoning rows share the inline-output budget instead of bypassing the timeline truncation paths.
|
Update: all three CI/SlopCop items are now fixed directly on this branch (pushed
Verified: full Note: I opened IlyaM#1 earlier as a workaround before realizing maintainer push works — it's now closed as superseded.
|
## Human comments ## What was wrong The shared timeline window closure treated every scoped item that crossed a page boundary as belonging to the newer sequence window. For a completed thinking item whose start was in an older user turn but whose completion arrived after the next prompt began, standard turn pagination therefore separated the lifecycle: the newest page rendered the completion beneath the wrong prompt as “Thought for 0ms,” and loading the older page left the originating turn without its thought. This followed [6e83eb2](6e83eb2) from #3066. A thought that never receives `item/completed` could also disappear from both pages when its original turn moved into older history. ## What changed - Expose the completion sequence in the existing item-span query. - Give the shared whole-item closure explicit origin-versus-later page ownership. - Keep an unfinished thought on its origin page until it receives a newer-page event; then keep the active lifecycle on the newer page without duplication. - Assign completed items to their originating user segment while preserving existing later-page ownership for byte and details windows. - Constrain span lookups to item events and distribute their thread/type constraints into each scoped lookup, allowing SQLite to use the existing `(thread_id, turn_id, type, item_id, sequence)` index. - Guard that multi-turn query plan and the unfinished and late-completed latest/older/details behavior with focused regressions. There are no database schema or migration, host-daemon wire, CLI, documentation, UI-component, pagination-limit, or mobile changes. ## How you verified - The focused regression fails before the fixes: late completion appears on the newest page, while a never-completed thought disappears from both pages. - `pnpm exec turbo run test --filter=@bb/server -- test/services/threads/timeline-in-turn-window.test.ts` — 28/28 passed after rebasing onto current local `origin/main`. - `pnpm exec turbo run test --filter=@bb/db` — 448/448 passed. - `pnpm exec turbo run typecheck --filter=@bb/server` and `pnpm exec turbo run typecheck --filter=@bb/db` — passed. - The committed multi-turn `EXPLAIN QUERY PLAN` regression proves the span lookup uses `events_thread_turn_type_item_sequence_idx`; no new index is created. - DevBrowser verified the real app history boundary: after loading the older page, the original turn expands through “Worked for 5s” to the interrupted “Thought for 2s,” its text, and “Stopped manually,” with no thought under the next prompt. > AGENT GENERATED
Human comments
What was wrong
#1248 requests expandable
Thought for <duration>sections while retaining the existing streamingthinking presentation.
bb already displayed provider-visible reasoning through the active
Thinking…disclosure, but discarded that text from the timeline projectionwhen the reasoning lifecycle completed. Completed threads therefore retained
the surrounding work and assistant response, but not the reasoning shown while
the turn was running.
What changed
Completed, non-empty reasoning lifecycles now produce expandable
Thought for <duration>entries in thread history through the existing genericsystem-operation timeline machinery.
formatter.
completed or interrupted status.
receive an explicit completion event.
update the saved thought while preserving its interrupted status and stop time.
Thinking…disclosure.Completed thoughts can appear inside the existing
Worked for…disclosure.No new public timeline-row kind or reasoning-specific UI component was added.
There are no database, persisted-event, server/host-daemon wire, CLI,
Plugin SDK, configuration, or documentation contract changes.
HOST_DAEMON_PROTOCOL_VERSIONremains unchanged.How you verified
persisted lifecycle start times, interrupted reasoning, turn-finalization
fallback, nested/root lifecycle isolation, late-delta rejection, completed
CLI rendering, and deterministic replay.
confirmed that active reasoning appears only through
Thinking…, completedreasoning appears once as
Thought for <duration>, and completed entriessurvive rebuilding the idle timeline.
Pi sessions.
@bb/thread-view: 377 tests passed; server timeline integration tests: 54passed; provider parity: 56 passed. Server and thread-view typechecks passed.
passes with the fix. Doobie verified the saved interrupted thought expands
after reload in the development app.
git diff --checkpassed.Fixes #1248