Skip to content

fix(ui): reset transcript when replay starts#171

Merged
onutc merged 1 commit intomainfrom
codex-replay-transcript-reset
Mar 27, 2026
Merged

fix(ui): reset transcript when replay starts#171
onutc merged 1 commit intomainfrom
codex-replay-transcript-reset

Conversation

@onutc
Copy link
Copy Markdown
Member

@onutc onutc commented Mar 27, 2026

Summary

  • treat session/load replay as canonical by clearing stale cached/live transcript state when replay begins
  • sync the replay reset into React state immediately so reconnects do not keep stale local turns visible
  • add transcript session and chat page regressions for late replay arriving after a newer live assistant answer

Testing

  • pnpm test -- src/lib/chat-transcript-session.test.ts src/pages/chat.test.tsx
  • pnpm test -- src/lib/acp-transcript.test.ts src/lib/chat-transcript-session.test.ts src/pages/chat.test.tsx
  • pnpm typecheck

@onutc onutc merged commit 344550f into main Mar 27, 2026
1 check passed
@onutc onutc deleted the codex-replay-transcript-reset branch March 27, 2026 14:50
@gitrank-connector
Copy link
Copy Markdown

👍 GitRank PR Analysis

Score: 20 points

Metric Value
Component Other (1× multiplier)
Severity P2 - Medium (20 base pts)
Final Score 20 × 1 = 20

Eligibility Checks

Check Status
Issue/Bug Fix
Fix Implementation
PR Documented
Tests
Lines Within Limit

Impact Summary

This PR fixes a bug where stale cached or live transcript state would persist when a replay session begins, causing out-of-order or duplicate messages to appear after reconnection. The fix clears the transcript state when replay starts and syncs the reset into React state immediately. The PR includes comprehensive test coverage for both the transcript session logic and the chat page integration, validating the fix handles late replay scenarios correctly.

Analysis Details

Component Classification: This PR affects chat transcript session management and UI state synchronization, which doesn't fit neatly into a specific component category. It's classified as OTHER since it's a cross-cutting concern affecting the chat connection and transcript handling logic.

Severity Justification: This is a P2 (Medium) severity bug fix. It addresses a functional issue where stale transcript state persists during reconnects, causing incorrect message ordering to be displayed to users. While this impacts user experience and data consistency, it has a workaround (page refresh) and doesn't cause service downtime or permanent data loss.

Eligibility Notes: Issue: True - PR clearly fixes a bug in transcript state management. Fix Implementation: True - code changes align with the stated goal of resetting transcript on replay start. PR Linked: True - detailed summary and testing instructions provided. Tests: True - adds 15 lines to transcript session tests and 45 lines to chat page tests. Tests Required: True - this is a bug fix in business logic (chat state management) that requires regression testing to prevent similar issues.


Analyzed by GitRank 🤖

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