From 90eae50dd34763beb32e820fbbab0c0bbef72c8c Mon Sep 17 00:00:00 2001 From: Linghong Date: Sat, 5 Sep 2026 12:29:18 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=96=E5=88=92V2=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=BB=93=E6=9E=9C=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 展示后端返回的错误回合结果 在缺少会话错误摘要时回填运行时错误 --- apps/ai-game-creator-shell/src/App.tsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index 5b1c90a4a..fe7993de3 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -621,7 +621,21 @@ export function App({ planningSessionToPlanGddState(result.session, result.currentArtifact), ); updateProjectSupervisorRuntime(planningSessionToRuntime(result.session)); - const sessionError = result.session.lastError?.summary ?? ''; + const resultError = + result.result?.kind === 'error' + ? (() => { + const payload = result.result.payload; + if ( + payload && + typeof payload === 'object' && + typeof (payload as { summary?: unknown }).summary === 'string' + ) { + return (payload as { summary: string }).summary.trim(); + } + return ''; + })() + : ''; + const sessionError = result.session.lastError?.summary ?? resultError; setProjectSupervisorRuntimeError(sessionError); if (result.conversation) { const conversationMessages = planningMessagesToChatMessages( @@ -632,11 +646,7 @@ export function App({ savedConversationProjectPathRef.current = localProjectPathRef.current; savedConversationCountRef.current = conversationMessages.length; latestMessagesRef.current = conversationMessages; - } else if ( - result.result && - result.result.kind !== 'error' && - clientTurnId - ) { + } else if (result.result && clientTurnId) { const displayText = planningResultDisplayText( result.result, result.currentArtifact,