From c668964d2ffd50fbcc138916f8c2e7a228c12195 Mon Sep 17 00:00:00 2001
From: suzmii
Date: Wed, 2 Sep 2026 17:50:17 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Direct=20=E6=B5=81?=
=?UTF-8?q?=E5=BC=8F=E5=9B=9E=E5=A4=8D=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 | 37 +++++++++++++------
.../ProjectSupervisorView.tsx | 21 +++++------
apps/ai-game-creator-shell/src/styles.css | 6 +++
.../appSurface/project-development.suite.ts | 14 +++++--
.../shared-memory/decision-log.md | 4 +-
5 files changed, 54 insertions(+), 28 deletions(-)
diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx
index 2c63e38cd..264e9692f 100644
--- a/apps/ai-game-creator-shell/src/App.tsx
+++ b/apps/ai-game-creator-shell/src/App.tsx
@@ -335,11 +335,7 @@ function directCodexProcessDetail({
return '正在记录失败原因';
}
if (status === 'streaming') {
- const text = accumulatedText?.trim();
- if (text) {
- return `正在生成回复:${text}`;
- }
- return directCodexActivityDetail(activity, status);
+ return '正在生成回复';
}
if (status === 'finalizing') {
return directCodexActivityDetail(activity, status);
@@ -351,6 +347,24 @@ function directCodexProcessDetail({
return directCodexActivityDetail(activity, status);
}
+function directCodexTransientReplyText({
+ accumulatedText,
+ status,
+}: {
+ accumulatedText?: string | null;
+ status: string;
+}) {
+ if (
+ status !== 'streaming' &&
+ status !== 'finalizing' &&
+ status !== 'completed'
+ ) {
+ return null;
+ }
+ const text = accumulatedText?.trim();
+ return text || null;
+}
+
function directCodexConversationMessageId(
turnId: string,
role: ChatMessage['role'],
@@ -1305,15 +1319,18 @@ export function App({
setDirectCodexStatus(payload.status);
setDirectCodexProgress(processDetail);
setDirectCodexProgressUpdatedAt(updatedAt);
- setDirectCodexTransientReply(processDetail);
+ setDirectCodexTransientReply('');
setDirectCodexTransientReplyUpdatedAt(null);
return;
}
setDirectCodexStatus(payload.status);
setDirectCodexProgress(processDetail);
setDirectCodexProgressUpdatedAt(updatedAt);
- setDirectCodexTransientReply(processDetail);
- setDirectCodexTransientReplyUpdatedAt(updatedAt);
+ const transientReply = directCodexTransientReplyText(payload);
+ if (transientReply !== null) {
+ setDirectCodexTransientReply(transientReply);
+ setDirectCodexTransientReplyUpdatedAt(updatedAt);
+ }
},
)
.then((unlisten) => {
@@ -1358,7 +1375,6 @@ export function App({
const progressDetail = ensureDirectProcessPrefix(event.payload.message);
setDirectCodexStatus('running');
setDirectCodexProgress(progressDetail);
- setDirectCodexTransientReply(progressDetail);
setDirectCodexProgressUpdatedAt(Date.now());
return;
}
@@ -5537,7 +5553,7 @@ export function App({
setDirectCodexStatus('accepted');
setDirectCodexProcessKey(`${directProjectPath}\u0000${clientTurnId}`);
setDirectCodexProgress('正在等待陶泥儿开始');
- setDirectCodexTransientReply('正在等待陶泥儿开始');
+ setDirectCodexTransientReply('');
setDirectCodexProgressUpdatedAt(Date.now());
setDirectCodexTransientReplyUpdatedAt(null);
setProjectSupervisorRuntimeError('');
@@ -5609,7 +5625,6 @@ export function App({
);
setDirectCodexStatus('finalizing');
setDirectCodexProgress('正在同步项目文件');
- setDirectCodexTransientReply('正在同步项目文件');
setDirectCodexProgressUpdatedAt(Date.now());
await refreshDirectProjectManifest(directProjectPath);
}
diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx
index 566f18df7..98537ada9 100644
--- a/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx
+++ b/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx
@@ -186,7 +186,7 @@ export function ProjectSupervisorView({
))}
{directCodex &&
- (runtimePanelProps.controlBusy || Boolean(transientReply)) ? (
+ (runtimePanelProps.controlBusy || Boolean(directProcessDetail)) ? (
- {(directCodex ? directProcessDetail : transientReply) ? (
+ {directProcessDetail ? (
- {directCodex ? directProcessDetail : transientReply}
+ {directProcessDetail}
- {(directCodex
- ? directProcessDetail
- : transientReply
- ).includes('\n') ||
- (directCodex ? directProcessDetail : transientReply).length >
- 96 ? (
+ {directProcessDetail.includes('\n') ||
+ directProcessDetail.length > 96 ? (