makecindy / makecindy/cindy

bug(orca): 长 Lead Session 中 Reviewer 完成回报持续积压,无法及时消费

Open
#4,454 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

## 现象

在一个持续运行较久的 Orca Lead Session 中,并行 Reviewer 已陆续完成并产生回报,但这些回报没有及时被 Lead 消费,而是在会话消息区持续堆积。界面显示仍有几十条待处理消息;用户需要等待很久,才能看到 Reviewer 结果被集中处理。

截图中可见 Reviewer 完成通知连续排列,并显示“还有 34 条”。

## 期望行为

Reviewer 完成回报应在 Lead 到达安全消费边界后及时送达并处理;多个 Reviewer 并发完成时,应具备批量合并或汇总机制,避免每条回报长期单独排队。

## 实际行为

- Reviewer 已完成,但结果长时间停留在 Session 队列。
- 多条 Reviewer 回报持续累积,等待时间不断增长。
- 当前 Lead 长 turn 结束后,结果疑似集中进入,造成明显延迟。
- 暂未观察到明确的丢失或永久死锁证据。

## 影响

长时间运行、多 Reviewer 并行的协作会话中,Lead 不能及时利用已完成的审查结果;队列可增长到几十条,用户难以判断哪些结果已经完成、哪些仍在执行。

## 相关 Issue

- #2675:active Lead 运行期间无法及时接收已完成 Worker 结果。
- #2042:协同消息卡在队列且删除后无法继续。
- #3153:Worker 完成回报延迟,Lead 需要手动继续。
- PR #3228 已修复 Worker `done` 确认在 terminal 边界的收尾竞态,但其正文明确不包含 Lead dispatcher 队列 drain。

## 建议排查方向

1. 记录每条 Orca 回报的 `clientId`、排队时间、Lead turn 状态和实际消费时间。
2. 检查 Lead 长 turn 结束后队列是否自动 drain,以及是否被 continuation 或 recovery 抢占。
3. 对同一批 Reviewer 回报增加批量汇总/合并策略。
4. 增加“长 Lead turn + 多 Reviewer 并发完成”的回归测试。
5. 在 UI 中显示最老待处理回报的等待时间和当前队列数量。

## 环境

- 区域:CN
- 界面语言:zh-CN
- 复现来源:长时间运行的多 Reviewer Orca 协作 Session

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Orca Lead dispatcher queue, Lead turn lifecycle, continuation or recovery handling, and the existing completion paths referenced in issues #2675, #2042, #3153, and PR #3228. Add the requested instrumentation and a regression test for a long Lead turn with concurrent Reviewer completions. Done means completed reports are consumed promptly, batching behavior is defined, and queue waiting is observable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, backend-api-design, distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.