修复策划V2错误结果展示
展示后端返回的错误回合结果 在缺少会话错误摘要时回填运行时错误
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user