← Back to Pull requests

fix(workhub): preserve follow-up messages during streamed replies #5397

Closed
unknown closed this pull request without merging on Sep 16, 2026 12:40 UTC
View on GitHub
unknown unknown commented on Sep 16, 2026 11:42 UTC
Author

<details open>
<summary>English</summary>

Summary

Fix WorkHub follow-up messages disappearing while their answer streams. Pressing Enter during an active Turn queues a follow-up; when the Host admits it into the next Turn, the queue entry was removed without restoring its user message to the conversation until transcript publication.

Transfer the latest queued content and its attachments into the admitted Turn in one state update. Transcript publication retires that temporary row by message ID. Edited and restored queue entries follow the same path; repeated admissions cannot duplicate published messages, and withdrawn messages are removed.

The archived-history startup E2E recognizes the Host’s derived-effect busy reason without assuming its raw session ID matches the renderer’s host-qualified key.

Verification

  • Archive/reload E2E: 2 tests passed; the actual CI busy-error payload is rejected by the old matcher and accepted by the corrected matcher. Unrelated errors still propagate.

  • WorkHub send visibility: 22 tests passed. The three regression cases fail against the previous controller.

  • Runtime Host session observer suite passed, including admission ordering.

  • Desktop build with dependencies, renderer build, and typecheck passed.

  • Repository lint, format, and renderer architecture checks passed.

  • Full Desktop Electron E2E: 37 tests passed with 3 isolated workers. The controller regressions separately exercise delayed transcript publication.
  • ✔ WorkHub defaults to follow-up and moves each message into its admitted successor Turn
    ✔ restored follow-ups transfer edited Host content once, regardless of transcript arrival order
    ✔ withdrawing a queued follow-up never transfers it into the conversation
    ℹ tests 22
    ℹ pass 22
    ℹ fail 0
    

    AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: OpenAI Codex — diagnosis, implementation, and regression tests.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • </details>

    <details>
    <summary>中文</summary>

    改动说明

    修复 WorkHub 在回复过程中漏显后续消息的问题。Agent 忙碌时直接按回车,消息会进入 follow-up 队列;下一轮接收消息后,原实现只删除队列项,没有把用户消息交给对话展示,因此要等历史记录刷新后才能看到。

    现在通过一次状态更新,将队列中最新的文字和附件交给对应轮次展示,历史记录到达后再按消息 ID 去重。编辑过的消息、重新连接后恢复的队列都使用同一条路径;重复接收通知不会产生重复气泡,撤回的消息也不会留在对话里。

    归档历史启动测试按 Host 返回的后台任务忙碌原因判断等待条件,不再把 Host 原始 session ID 与桌面层的复合 ID 当作同一个值。

    验证

  • 归档与重载 E2E 2 项通过;使用 CI 的实际忙碌错误验证,旧判断会误抛异常,修正后可正确识别,其他错误仍会抛出。

  • WorkHub 发送与显示测试 22 项通过;三个回归用例在旧版控制器上均会失败。

  • Runtime Host 会话观察器测试通过,包含接收通知与队列更新的顺序验证。

  • Desktop 及依赖构建、renderer 构建、类型检查通过。

  • 仓库 lint、格式和 renderer 架构检查通过。

  • Desktop Electron E2E 全量 37 项通过,使用 3 个独立 worker。控制器回归测试另行覆盖延迟发布历史记录时的消息可见性。
  • ✔ WorkHub defaults to follow-up and moves each message into its admitted successor Turn
    ✔ restored follow-ups transfer edited Host content once, regardless of transcript arrival order
    ✔ withdrawing a queued follow-up never transfers it into the conversation
    ℹ tests 22
    ℹ pass 22
    ℹ fail 0
    

    AI 使用

  • 未使用生成式工具完成实质性工作

  • 使用了生成式工具完成实质性工作
  • 工具及范围:OpenAI Codex,用于问题定位、修复和回归测试。

    检查清单

  • 测试覆盖本次改动,且在未修复时失败

  • 本地 lint、格式、类型检查及受影响的测试均通过
  • 是否改变行为?

  • 是,见上方改动说明

  • 否
  • </details>

    Diff: 422 lines (+316 / -106) across 5 files Reviewer: M4n5ter Review duration: 58m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 422 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.362
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5397"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45% (MEDIUM) · Higher = larger blast radius
    45%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.8% · Safe to merge
    17.8%
    Repository