fix(sessions): preserve live transcript and settle reader activity - #6591
fix(sessions): preserve live transcript and settle reader activity#6591mmabrouk wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🤖 The AI agent says: Independent review of this fix against the merged milestone-3 code found no blocking issue. Focused regression tests cover sender hydration, pending transcript adoption, reconnect snapshots, obsolete retry timers, natural terminal events, and same-session resume. Live sender/observer verification is still pending. @coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change maps runner completion records to durable terminal events, preserves source message identifiers, and reworks live-preview retirement, hydration, liveness, and remote-stop presentation across web and mobile clients. ChangesSession execution flow
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: ⚪ Minimal · up to This change improves shared-session streaming handoff, completion status, reconnect behavior, and remote Stop presentation. Focused regression coverage is reported passing, with no current merge-blocking risk identified. Sequence Diagram(s)sequenceDiagram
participant Reader
participant useSessionLivePreview
participant LivePreview
participant DurableTranscript
Reader->>useSessionLivePreview: Receive terminal event or reconnect
useSessionLivePreview->>LivePreview: Mark execution terminal
useSessionLivePreview->>DurableTranscript: Fetch bounded transcript
DurableTranscript-->>useSessionLivePreview: Return transcript and covered entities
useSessionLivePreview->>LivePreview: Retire covered entities
useSessionLivePreview-->>Reader: Expose settled preview state
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Team
Run ID: cd38c858-9f22-4b44-86ba-1e2da73300b2
📒 Files selected for processing (21)
api/oss/src/core/sessions/records/events.pyapi/oss/tests/pytest/unit/sessions/test_durable_events.pyapi/oss/tests/pytest/unit/sessions/test_records_worker_batching.pyservices/runner/src/sessions/persist.tsservices/runner/tests/unit/session-persist.test.tsweb/mobile/src/features/chat/LiveConversation.tsxweb/mobile/tests/unit/turnStatus.test.tsweb/oss/src/components/AgentChatSlice/AgentConversation.tsxweb/oss/src/components/AgentChatSlice/components/AgentComposerDock.tsxweb/oss/src/components/AgentChatSlice/hooks/useAgentChatSession.test.tsweb/oss/src/components/AgentChatSlice/hooks/useAgentChatSession.tsweb/oss/src/components/AgentChatSlice/state/liveness.test.tsweb/oss/src/components/AgentChatSlice/state/liveness.tsweb/packages/agenta-chat/src/components/RunningElsewhereStrip.tsxweb/packages/agenta-chat/src/components/index.tsweb/packages/agenta-chat/src/hooks/useAgentConversation.tsweb/packages/agenta-chat/src/hooks/useSessionLivePreview.tsweb/packages/agenta-chat/src/model/livePreview.tsweb/packages/agenta-chat/tests/unit/hooks/useSessionLivePreview.test.tsxweb/packages/agenta-chat/tests/unit/model/livePreview.test.tsweb/packages/agenta-entities/src/session/state/livePreview.ts
💤 Files with no reviewable changes (3)
- web/packages/agenta-chat/src/components/index.ts
- web/packages/agenta-chat/src/components/RunningElsewhereStrip.tsx
- web/oss/src/components/AgentChatSlice/components/AgentComposerDock.tsx
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
|
✅ Action performedReview finished.
|
Railway Preview Environment
|
Context
With shared session delivery enabled, the sending tab could show only activity dots while another tab displayed tool results. Streamed text could also disappear when a durable record arrived, and observers could remain busy after the run finished.
Changes
Allow the shared sender to adopt saved content while its accepted run is active. Keep temporary text visible until the corresponding saved output has been adopted, preserving unrelated streaming content and its frame cursor. Preserve the message identifier when the runner saves a completed streamed message.
Project the runner's existing
donerecord into the terminal event the reader understands, and refresh stale running status after completion. Cancel obsolete reconnect timers when a fresh connection starts. Show normal activity during a reconnect while preserving the remote Stop action.How to review
Start with the runner persistence identifier and API terminal projection, then the shared preview reducer and reader hook. The desktop hydration guard and desktop/mobile presentation consume those changes.
Tests
What to QA
With shared delivery enabled, open the same session in two clients. Run a turn with streamed text and a failing tool: both clients should retain the text and display the tool error as saved records arrive. Both should stop showing activity when the turn completes.
Disconnect the reader, return to the tab, and wait beyond the previous five-second retry. The healthy connection should remain open. Then run another turn, approve a paused tool, and exercise Stop; content and controls should continue working without a reload.