Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(chat): prevent duplicate statuses and timeline ID collisions #10602

Closeddominic-r(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/10602/headopened View on GitHub

A single status could render twice, as a work-group heading and an event row. Activity IDs could also collide with message IDs, hiding an async answer or leaving an empty timeline slot.

Render single inactive statuses directly and give work/activity rows distinct timeline IDs on web, desktop, and mobile. Keep expanded subagent rows visible when their agents settle by comparing expansion state with the underlying work-entry ID.

This complements the Q&A presentation shipped in #11014, which superseded #10417. It preserves that presentation and covers standalone statuses and ID collisions, including older answer records that cannot be folded into a Q&A row. It does not change stored messages or provider payloads and does not claim to fix the question-attribution issue in #10786.

Validation at f02caf35c:

  • All 295 tests in the web timeline, web session-logic, and mobile feed suites pass using the installed Vitest runner. The vp test wrapper fails before running tests.
  • The existing subagent test reproduced an expanded row disappearing after settlement with the new IDs and passes with the corrected comparison.
  • Web and mobile typechecks, formatting, and diff checks pass. Targeted lint reports warnings in unchanged renderer code.

The images below show the original fix before the merge with current main. Browser verification was not repeated after that merge; mobile was not simulator-tested.

BeforeAfter
Duplicate status heading and event rowOne status row with the submitted answer preserved

Model: GPT-6. Harness: Codex.

Note

Fix single status event rendering to avoid duplicate headings in chat timeline

  • Mobile: appendToolGroupRows in threadActivity.ts now emits a single inactive non-tool activity directly as one activity-group row and returns before the tool-group summary path.
  • Web: deriveMessagesTimelineRows in MessagesTimeline.logic.ts now treats any single visible work entry (not just tool-like ones) as a plain work row. The unused summaryToolIcon field is removed from WorkGroupToggleTimelineRow and its fallback lookup in MessagesTimeline.tsx is dropped.
  • Both mobile and web gain parameterized tests covering a resolved user-input event in collapsed and expanded states.
  • Risk: WorkGroupToggleTimelineRow.summaryToolIcon is removed; any out-of-tree consumers of this type field will need to update. Grouped-toggle summaries now always call summarizeToolGroup directly.
Macroscope summarized 4d832a5.

Summary by CodeRabbit

  • Bug Fixes
    • Resolved user-input activities now appear exactly once in mobile and web timelines, with the original message preserved.
    • Single non-tool activities no longer appear as work toggles when inactive.
    • Spawned work rows remain visible outside expandable turn sections.
    • Work-group summaries and icons now display consistently across activity types.
    • Timeline rows use distinct identifiers, preventing activity and work entries from being confused with other content.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

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

      Approvability

      Verdict: Approved at 39fae55

      Macroscope's review found this PR approvable — This is a bounded chat-rendering bug fix that namespaces timeline IDs and removes duplicate singleton status rows across web and mobile, with targeted regression tests. It changes no stored data, schema, deployment behavior, product defaults, or security-sensitive code.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review Change StackReview Change Stack

      Important

      Review skipped

      We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

      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

      Note

      Reviews paused

      It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

      Use the following commands to manage reviews:

      • @coderabbitai resume to resume automatic reviews.
      • @coderabbitai review to trigger a single review.

      Use the checkboxes below for quick actions:

      • ▶️ Resume reviews
      • 🔍 Trigger review

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: 3097705e-861d-4552-b6c3-4e3958eaf7ba

      📥 Commits

      Reviewing files that changed from the base of the PR and between e39cb9dc6a5d1b2b18da609b39cc9f85be915c2a and 17909343b9514daaa091e5e6dbdb828b330f6590.

      📒 Files selected for processing (5)
      • apps/mobile/src/lib/threadActivity.ts
      • apps/web/src/components/chat/MessagesTimeline.logic.test.ts
      • apps/web/src/components/chat/MessagesTimeline.logic.ts
      • apps/web/src/components/chat/MessagesTimeline.tsx
      • apps/web/src/session-logic.ts

      Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      Resolved user-input activities now render once as individual activity rows in mobile and web timelines. Activity-group and work-entry identifiers use distinct prefixes. Work-group summaries and icon fallback logic were updated.

      Changes

      Activity row rendering

      Layer / File(s)Summary
      Timeline entry ID namespacing
      apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts, apps/web/src/session-logic.ts, apps/web/src/session-logic.test.ts
      Activity-group IDs use the activity: prefix. Work timeline entry IDs use the work: prefix. Tests use the updated identifiers.
      Mobile activity row derivation and coverage
      apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts
      Inactive single non-tool activities render as activity-group rows without a work-toggle. Tests cover collapsed and expanded states.
      Web timeline row derivation and coverage
      apps/web/src/components/chat/MessagesTimeline.logic.ts, apps/web/src/components/chat/MessagesTimeline.tsx, apps/web/src/components/chat/MessagesTimeline.logic.test.ts
      Single grouped entries use their own labels when applicable. Work-toggle summaries use summarizeToolGroup. Icon fallback uses the tool surface or summary kind. Tests cover resolved activities and namespaced spawn rows.

      Priority: ➖ Normal

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix

      Suggested reviewers: t3dotgg, juliusmarminge

      Merge Risk: ⚪ Minimal · up to 17909

      The timeline rendering changes have no identified merge-blocking risk.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 7 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely identifies both primary fixes: duplicate status rendering and timeline ID collisions.
      Description check✅ PassedThe description explains what changed, why it changed, scope, validation results, risks, and UI changes with before-and-after screenshots. It does not use the template headings or checklist format, bu…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Comment `@coderabbitai help` to get the list of available commands.
    4. dominic-r(GitHub profile, opens in a new tab) changed the title

    5. The browser check exposed an ID collision between async answer messages and their status activities. Fixed in e01b00997 by giving activity entries distinct timeline IDs before folding and rendering on web and mobile. The answer now stays visible with the turn collapsed or expanded, and the expanded timeline has one submitted-status row with no empty slot. Before/after images are in the description. All 290 focused tests and both client typechecks pass.

      The generic docstring-coverage suggestion is left unapplied. AGENTS.md asks for comments that explain non-obvious constraints, rather than descriptions of straightforward rendering code. The regression tests cover the behavior and the new ID collision case.

    6. Sorry, I'm unable to act on this request because you do not have permissions within this repository.

    7. Visual QA on 4d832a52 using the real web MessagesTimeline plus the PR fixtures (User input submitted / multi-tool group / live task.progress). No product code was changed.

      Expanded single-status no longer duplicates: one work row, speech-bubble icon + “User input submitted”. The hammer heading + second event row from the before shot is gone.

      Before (from the PR):

      Before: duplicate User input submitted heading and event row

      After — single resolved user-input, collapsed:

      After: single User input submitted status, collapsed

      After — single resolved user-input, expanded (still one label):

      After: single User input submitted status, expanded

      After — multi-event work group, collapsed:

      After: collapsed multi-event work group

      After — multi-event work group, expanded (heading + event rows kept):

      After: expanded multi-event work group

      After — active / in-progress task group (existing live behavior):

      After: active task group

      Checks: MessagesTimeline.logic.test.ts + threadActivity.test.ts — 204 passed / 204. Mobile native screenshot not taken (no device); the mobile suite covers the same single-status collapsed/expanded cases.

    8. dominic-r(GitHub profile, opens in a new tab) changed the title

    9. juliusmarminge added labelsmacroscope-review

    10. dominic-r(GitHub profile, opens in a new tab)commented

      @juliusmarminge conflicts fixed.

      Conflict fix by Opus 5.5 (Claude Code), on behalf of Dominic.

    11. Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition.

      The patch conflicts with the rewrite in apps/mobile/src/lib/threadActivity.ts, apps/web/src/components/chat/MessagesTimeline.logic.ts, apps/web/src/components/chat/MessagesTimeline.tsx and 1 other files. Even where the conflict is small enough to rebase, we are asking for fresh PRs against the new base so we can review and verify the behavior in V2.

      Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved.

    12. juliusmarminge closed this

    13. Checked against current main after #2829. Both issues are resolved in V2, so this doesn't need a follow-up PR:

      • Duplicate status row: user_input_request items are now tool rows, so a single answered question renders once.
      • ID collisions: timeline work rows use turn-item: IDs, separate from message IDs, and async answers are folded into the question row.

      Checked by Opus 5.5 (Claude Code), on behalf of Dominic.

Sign in to join this conversation.