修复首次会话等待与上游饱和重试
This commit is contained in:
@@ -1355,7 +1355,12 @@ export function OpencodeChatPanel({ variant = 'main', navigationDraft, onOpenDev
|
||||
}, [authenticationFailureKey, logout]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!selectedSessionId || sessionMessages.length > 0 || selectedSessionRunning) return;
|
||||
if (
|
||||
!selectedSessionId
|
||||
|| sessionMessages.length > 0
|
||||
|| Object.prototype.hasOwnProperty.call(sessionMessagesBySessionId, selectedSessionId)
|
||||
|| selectedSessionRunning
|
||||
) return;
|
||||
if (!activeProject || status.state !== 'running') return;
|
||||
void loadSessionMessages(selectedSessionId).catch(() => undefined);
|
||||
}, [
|
||||
@@ -1364,6 +1369,7 @@ export function OpencodeChatPanel({ variant = 'main', navigationDraft, onOpenDev
|
||||
selectedSessionId,
|
||||
selectedSessionRunning,
|
||||
sessionMessages.length,
|
||||
sessionMessagesBySessionId,
|
||||
status.state,
|
||||
]);
|
||||
|
||||
@@ -1718,7 +1724,7 @@ export function OpencodeChatPanel({ variant = 'main', navigationDraft, onOpenDev
|
||||
const createdSessionId = getSessionId(session);
|
||||
if (!createdSessionId) throw new Error('运行时未返回会话 ID');
|
||||
await linkProjectSession(activeProject.id, createdSessionId, submissionAgent.id);
|
||||
await selectSession(createdSessionId);
|
||||
await selectSession(createdSessionId, { loadMessages: false });
|
||||
submissionSession = {
|
||||
id: createdSessionId,
|
||||
generation: submissionSession.generation + 1,
|
||||
|
||||
Reference in New Issue
Block a user