Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

Merge pull request #2156 from makecindy/cindy/auto-ix28jr

DavidShenXD958266fdf0b9
diff --cc packages/maker-core/src/agents/codex/index.ts
index 903b1ca70f,00907cfd9b..340e8c5fa6
--- a/packages/maker-core/src/agents/codex/index.ts
+++ b/packages/maker-core/src/agents/codex/index.ts
@@@ -8601,33 -8437,19 +8602,41 @@@ export class CodexAgent extends BaseAge
log,
onCompactBoundary: handleCompactBoundary,
});
- emitReplayedSubagentUpdateOnCompleted?.();
+ // A late V1 spawn completion is the spawn tool closing, not necessarily
+ // the child closing. Reassert a running compact state, or an explicit
+ // failed/stopped tracker state; a completed replay would only duplicate
+ // the translator's own frame.
+ const shouldReplayLateSubagentState =
+ collabItemHasRunningAgentState(params.item)
+ || replayedSubagentUpdateOnCompleted?.status === 'failed'
+ || replayedSubagentUpdateOnCompleted?.status === 'stopped';
+ if (!isLateCollabTerminal || shouldReplayLateSubagentState) {
+ if (replayedSubagentUpdateOnCompleted) {
+ emitSubagentCardUpdate(
+ replayedSubagentUpdateOnCompleted,
+ isLateCollabTerminal
+ ? {
+ turnScope: 'background',
+ backgroundTurnStartedAt:
+ turnOriginByTurnId.get(params.turnId)?.startedAtMs ?? 0,
+ }
+ : {},
+ );
+ }
+ }
// item 完成后, 若 turn 仍在跑, 先回到 'Generating...' 兜底 — 下一条 item 起来会再覆盖。
// turn/completed 在 turn 结束时会 push 'Done' 终态, 不需要在这里特判。
- if (isTurnInFlight) pushStatus('Generating...');
+ // 迟到的旧 turn 收口只允许发 background 结果,不能给当前 turn 注入前台状态。
+ if (isTurnInFlight && !isLateCollabTerminal) pushStatus('Generating...');
},
+ agentMessageDelta: (params) => {
+ if (enqueueIfBufferedTurn(params.turnId, () => handlers.agentMessageDelta?.(params), {
+ modelWork: true,
+ })) return;
+ if (shouldIgnoreStaleTurnEvent(params.turnId)) return;
+ producedOutputTurnIds.add(params.turnId);
+ translateAgentMessageDelta(params, eventQueue, { rt: translatorRt, log });
+ },
turnPlanUpdated: (params) => {
if (enqueueIfBufferedTurn(params.turnId, () => handlers.turnPlanUpdated?.(params))) return;
if (shouldIgnoreStaleTurnEvent(params.turnId)) return;