fix(maf): recover clarification checkpoints stuck in running

Re-enter clarification recovery even when manager_dispatch is already completed, and expand V2 runner tests for group_chat seat filtering and recover().

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
董宏凯andCursor committed 2026-08-05 22:54:07 +08:00
1 parent f9a5b5bc1e
commit a786cdcad0
5 files changed
+245 -56

No files matched your search

@@ -358,6 +358,15 @@ class ManagerDispatchExecutor(Executor):
@handler(input=Any, output=dict)
async def handle(self, message: Any, ctx: WorkflowContext) -> None:
# V2 clarification checkpoints must always re-enter the clarification
# recovery branch, even when manager_dispatch is already marked
# completed — otherwise a recovered clarification run would stay
# "running" instead of landing in waiting_input.
if self._state.dispatch_contract_enabled and self._state.intent_type == "clarification":
self._state.stage = "planning"
await _resolve_manager_dispatch(self, ctx)
return
if self._state.is_completed(self._node_id):
await ctx.send_message({
"decision": self._dispatch_decision(),
@@ -278,7 +278,14 @@ class WorkflowRunner:
async def _run_manager_dispatch(self, state: RoundtableState) -> None:
"""Freeze the V2 manager decision before constructing seat topology."""
if state.is_completed("manager_dispatch"):
# A completed dispatch is replayed without another model call — except
# for clarification checkpoints, which must always re-enter the
# clarification recovery branch so a recovered run lands in
# waiting_input instead of staying "running" forever.
if (
state.is_completed("manager_dispatch")
and state.intent_type != "clarification"
):
return
workflow = build_manager_dispatch_workflow(
manager_dispatch=ManagerDispatchExecutor(self._adapter, state),