fix(workhub): preserve follow-up messages during streamed replies #5397
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
M4n5ter
<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
AI use
Tool(s) and scope: OpenAI Codex — diagnosis, implementation, and regression tests.
Checklist
Does this PR entail a change in behavior?
</details>
<details>
<summary>中文</summary>
改动说明
修复 WorkHub 在回复过程中漏显后续消息的问题。Agent 忙碌时直接按回车,消息会进入 follow-up 队列;下一轮接收消息后,原实现只删除队列项,没有把用户消息交给对话展示,因此要等历史记录刷新后才能看到。
现在通过一次状态更新,将队列中最新的文字和附件交给对应轮次展示,历史记录到达后再按消息 ID 去重。编辑过的消息、重新连接后恢复的队列都使用同一条路径;重复接收通知不会产生重复气泡,撤回的消息也不会留在对话里。
归档历史启动测试按 Host 返回的后台任务忙碌原因判断等待条件,不再把 Host 原始 session ID 与桌面层的复合 ID 当作同一个值。
验证
AI 使用
工具及范围:OpenAI Codex,用于问题定位、修复和回归测试。
检查清单
是否改变行为?
</details>