fix(session): recover transcript streams and virtualize activity feed (ZER-673) - #45
Closed
ZeroPointSix wants to merge 7 commits into
Closed
fix(session): recover transcript streams and virtualize activity feed (ZER-673)#45ZeroPointSix wants to merge 7 commits into
ZeroPointSix wants to merge 7 commits into
Conversation
added 5 commits
August 12, 2026 09:02
Owner
Author
Context fact cardTarget
Verified facts
Relevant code and tests
CI/CD and validation entrypoints
Assumptions not allowed
Risks / blockers
Proposed change scope
|
ZeroPointSix
commented
Aug 13, 2026
ZeroPointSix
left a comment
Owner
Author
There was a problem hiding this comment.
审查结论:当前不建议合并
整体方案方向正确:transcript snapshot + tail + live SSE 的恢复顺序、shared stream cursor、stable entry_id upsert,以及 react-virtuoso 长列表虚拟化都覆盖了 ZER-673 的主要目标;CI、Admin Web、普通 Docker Smoke Test 也已通过。
但当前有两个代码 blocker,外加一个合并门禁 blocker:
-
[高]
SessionEventBus存在锁顺序反转,可能并发死锁。publish()先通过stream.publish_session()获取SessionStreamHistorymutex,释放后再获取 lifecycleSessionEventHistorymutex;更关键的是 publish 路径与 transcript/cursor 路径建立了 stream→history 的顺序。subscribe_after()/replay_after()当前先持有 lifecyclehistorymutex,再调用self.stream.next_sequence()获取 stream history mutex,即 history→stream。- 在并发 lifecycle publish 与 replay/subscribe 时形成 ABBA 锁顺序,存在请求/SSE 建连卡死风险。现有
session_event::tests都是串行功能测试,没有并发锁顺序覆盖。 - 建议不要在持有 lifecycle history 锁时调用
stream.next_sequence();先获取 next sequence 后再锁 lifecycle history,或统一所有路径的锁顺序,并补并发回归测试(带 timeout)。
-
[中] session A→B 路由切换时会保留旧 transcript,可能短暂展示错误会话内容。
useSessionTranscript()只有sessionId为空时才清entries;非空 A 切到非空 B 时,effect 开始恢复 B,但旧的entriesRef/current entries保持到 B 的 transcript snapshot 返回。SessionDetailPage的 session metadata 与 transcript 是独立请求;如果 B 的 metadata 先完成,页面会渲染 B 的标题/元数据,同时活动流仍是 A 的内容,直到 transcript 请求完成。若 B transcript 请求失败,旧内容还可能一直留在 recovery banner 下。- 建议 sessionId 变化后、发起 snapshot 前立即清空 entries/latency,并增加 A→B 切换与 snapshot failure 的 hook/component 测试。
-
[门禁]
Review Contract当前失败。- run #185 明确报缺少
## Review Contract、### Goal、### Non-goals、### Accepted Residual Risks、### Acceptance Criteria、### Follow-ups。 - PR 描述目前只有 Summary / Verification,因此即使代码问题修复,也还不能满足仓库合并门禁。
- run #185 明确报缺少
CI 状态
CI#120: successAdmin Web#62: successDocker Smoke Test#136: successReview Contract#185: failureDocker Smoke Test (Unified)#143: in progress
验收缺口
- 需要补统一 stream 的并发 publish + subscribe/replay 无死锁测试。
- 需要补 session A→B 切换时旧 transcript 不可见、B snapshot 失败也不会保留 A 内容的测试。
- Review Contract 需补齐后重新过门禁。
- 最终合并前还需要等待 Unified Docker Smoke 完成并确认绿色。
因此当前结论是:先修上述两个代码 blocker + Review Contract,再复审;暂不合并。
Owner
Author
Execution summaryProblem
Root cause / verified facts
Solution
Files reviewed
Validation
CI/CD
Remaining risks / follow-ups
当前结论:不建议合并。 Review |
ZeroPointSix
pushed a commit
that referenced
this pull request
Aug 13, 2026
Combine transcript recovery and virtualized activity feeds with the all-open-PR session validation branch.
10 tasks
10 tasks
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
entry_idvalues upsert streamed text and tool revisions.react-virtuoso, expose end-to-end SSE latency, and surface cursor resets, history gaps, and stream lag as explicit recovery states.Review Contract
Goal
Deliver ZER-673's resilient session transcript recovery and long-session activity feed: snapshots must resume safely into replay/live SSE, and transcript rendering must remain responsive for 1,000+ entries.
Non-goals
This PR does not change agent execution semantics, transcript retention capacity, authentication policy, or the server-side protocol beyond exposing the atomic shared-stream cursor already required by the recovery hand-off. It does not introduce write or mutation controls to the read-only session feed.
Accepted Residual Risks
The activity feed remains dependent on the bounded server replay history. When a cursor reset, history gap, or stream lag is detected, the UI intentionally stops live processing and asks the operator to reload a full snapshot instead of silently reconstructing uncertain state. The current production bundle-size warning is pre-existing/non-blocking and is not addressed here.
Acceptance Criteria
entry_idinstead of appending a duplicate row.cursor_reset, event-history gaps, and stream lag show an explicit recovery action rather than silently omitting history.Follow-ups
Verification
pnpm test— 43 tests passed.pnpm lintpnpm buildcargo test -p openab-core --no-default-features transcript::testscargo test -p openab-core --no-default-features session_event::testscargo test -p openab-gateway --no-default-features session_admin::testsCloses ZER-673.