From 254f3fcc5d3356473e898031f62fa9569be68322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 18 Sep 2026 00:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E7=B4=A7=20DirectProject=20=E5=9B=9E?= =?UTF-8?q?=E5=90=88=E5=AE=8C=E6=88=90=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅由 turn.completed 结束订阅恢复的运行态 调整终止回归测试以覆盖真实生命周期事件 --- apps/ai-game-creator-shell/src/App.tsx | 4 ---- .../tests/appSurface/chat-composer.suite.ts | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index 13624b2be..e0c04bc0b 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -6697,12 +6697,8 @@ export function App({ } } finally { if (localProjectPathRef.current === directProjectPath) { - setDirectThreadChat((state) => - state.turnRunning ? { ...state, turnRunning: false } : state, - ); setChatAgentBusy(false); setDirectCodexTurnCancelling(false); - directTurnRunningRef.current = false; chatAgentBusyRef.current = false; // 本地 invoke 正常收尾仍可直接推进队列;恢复场景则由 turn.completed effect 推进。 dispatchNextQueuedChatTurn(); diff --git a/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts b/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts index e58872d54..d299cdd55 100644 --- a/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts +++ b/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts @@ -574,6 +574,10 @@ export function registerChatComposerControlTests() { // app-server 的中断原因回到前端:不是失败,UI 必须回到可用态。 act(() => { pending[0]?.reject(new Error('Codex app-server turn 已中断')); + harness.emitDirectThreadEvents({ + type: 'turn.completed', + status: 'interrupted', + }); }); await waitFor(() => { const send = within(surface).getByRole('button', { name: '发送' });