Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server,web): show Claude thinking blocks in thread timelines #6429

Closedryanhmasten(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/6429/headopened View on GitHub

What Changed

Claude threads now show thinking blocks. ClaudeAdapter tracks each thinking content block per content-block index, accumulates its streamed deltas, and emits a full reasoning item lifecycle — including the settled-snapshot path, so a block that arrives whole without deltas still lands. Ingestion merges the stream into one persisted reasoning activity per item (reasoning:<threadId>:<itemId>), settled when the item completes, so a long think is one activity row rather than a hundred. The web timeline streams it live as a Thinking block and settles it into the turn's work log as a Thought entry; the mobile work log picks up the same activity.

Why

The model reports that it is thinking — and Codex reasoning already renders — but a Claude thread went straight from the prompt to the answer with no trace of the thought in between, even on Ultrathink. The gap was on both sides of the pipeline: ClaudeAdapter never created an item for a thinking content block (content_block_start only handled text and tool blocks), and ingestion only persisted assistant_text deltas, so the reasoning_text deltas the adapter did emit were dropped on the floor.

Server tests cover the adapter's delta and snapshot paths and the ingestion merge; web and mobile tests cover the timeline row and work-log mapping. Validated in the running app with the same Ultrathink prompt on both builds.

UI Changes

Before — the expanded work log holds only tool calls, no trace of the thought:

before: work log with no thinking

After — the thought streams live during the turn and its full text sits in the work log:

after: thought block with the model's reasoning

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Made with Grok 4.6 and Claude Code.


Note

Medium Risk Cross-cutting orchestration changes (adapter, ingestion, projection merge, client reducer) affect thread activity semantics; mistakes could cause duplicate rows, stuck streaming state, or live/reload drift, but scope is timeline/activity projection rather than auth or data loss.

Overview Claude thinking is now a first-class thread activity end-to-end. The adapter tracks thinking blocks (stream deltas, completions, snapshot backfill, reused block indices, and subagent content_block_stop guards), defaults thinking-display=summarized, and ingestion turns reasoning_text into stable reasoning:<threadId>:<itemId> rows while ignoring reasoning_summary_text.

Shared contracts add mergeOrchestrationThreadActivity (append deltas, settle streaming) and isOrphanReasoningActivity (drop empty settles). The in-memory projector, SQLite projection (getByActivityId + merge on upsert), and client threadReducer all apply the same logic so live and persisted timelines stay aligned.

Web and mobile map reasoning work-log entries as non-tool rows with agent icon, hide the generic “work log” header when reasoning is present, and web adds a dedicated Thinking / Thought row with streaming and collapse. Docs note summarized thinking and --thinking-display override.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9fdb85d12e35ff0a11461d5395a14f6c8c05f119. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Show Claude thinking blocks in thread timelines

  • The Claude adapter (ClaudeAdapter.ts) now emits content.delta events for reasoning text and item.completed for reasoning items, grouping streaming deltas into a single stable activity per thinking block.
  • A new mergeOrchestrationThreadActivity util collapses reasoning deltas across events; isOrphanReasoningActivity drops reasoning settles that arrive without prior context, preventing phantom entries.
  • Server projection, client-side thread reducer, and in-memory read model all apply the same merge/drop logic so reasoning activities are consistent across transports.
  • Web and mobile UIs render reasoning entries with a dedicated "Thinking"/"Thought" label, agent icon, streaming indicator, and collapsible long-text view; the "Work Log" group label is suppressed when reasoning rows are present.
  • Claude sessions now default to thinking-display=summarized (overridable via --thinking-display launch arg); reasoning_summary_text deltas are explicitly ignored to avoid mixing streams.
Macroscope summarized 9fdb85d.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 5bfa64eb-d638-42bf-acf3-c0a4c2be6d44

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/00c331aeba69d42fa23bd00df75edc565147fbfe/apps/server/src/provider/Layers/ClaudeAdapter.ts#L2818

      Subagent content_block_stop events can complete and delete a parent reasoning block, splitting the parent's thought into multiple items or causing later parent deltas to create a new item. This branch does not check parent_tool_use_id before looking up reasoningBlocks; ignore subagent stops (the existing tool-stop path has no completion work) before resolving parent block indices.

      No longer relevant as of f29883f1ad229d397dd014a664e1cbb7049f254b

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces a new user-facing feature (displaying Claude's thinking blocks in timelines) with substantial cross-cutting changes across server, web, mobile, contracts, and persistence layers. New capabilities with complex streaming state management and UI components warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 653d807c6eeb88a0178da99658e46beb0e79fc88. Configure [here](https://www.cursor.com/dashboard/bugbot).
    6. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

      This adds Claude thinking block storage and timeline display across server, contracts, client runtime, web, and mobile. We are not taking this new cross-client timeline behavior forward through the current backlog.

      If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

    7. ryanhmasten(GitHub profile, opens in a new tab)commented

      @t3dotgg So you don't plan on adding thinking display?

Sign in to join this conversation.