Skip to content

fix(goal): prevent premature goal continuation with async sessions#1694

Open
1688mengdie wants to merge 2 commits into
GCWing:mainfrom
1688mengdie:pr/fix-goal-continuation-race
Open

fix(goal): prevent premature goal continuation with async sessions#1694
1688mengdie wants to merge 2 commits into
GCWing:mainfrom
1688mengdie:pr/fix-goal-continuation-race

Conversation

@1688mengdie

Copy link
Copy Markdown

概述

修复 Goal 模式自动续接(continuation)在异步 SessionMessage 场景下的过早触发问题。

根因

Commander 派发 SessionMessage 后 turn 结束。Goal 检查在 turn 完成后立即触发——此时异步 SessionMessage 回复还在路上。单条件检查(仅 queues)不足以判断系统是否真正空闲。

修复

  • Goal 续接改为双条件判断:队列空 + 同工作区无活跃 Session(active_turns.is_empty())
  • 新增 ActiveDialogTurnStore::is_empty() 方法

影响

Ultra Mode 多 Agent 编排的核心稳定性修复。防止 Goal 在子 Agent 未完成时误触发下一轮。

验证

  • cargo check --workspace 通过

Ref: #1674

BitFun Research added 2 commits July 23, 2026 04:05
8 preset team configurations (standard/quick/parallel/single/review/audit/plan/custom).
Enables one-click multi-agent legion deployment from UI.

@wsp1911
Ref: GCWing#1674
Add dual-condition check before goal auto-continuation:
- Skip when queued messages exist (queues.has_items)
- Skip when any session has an active turn (!active_turns.is_empty)

Goal checks now only fire when all sessions are idle and the queue
is drained — preventing premature continuation when async
SessionMessage replies are still in flight.

Add ActiveDialogTurnStore::is_empty() convenience method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant