Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions apps/code/src/renderer/features/sessions/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ export class SessionService {
private updatePromptStateFromEvents(
taskRunId: string,
events: AcpMessage[],
{ isLive = false }: { isLive?: boolean } = {},
): void {
for (const acpMsg of events) {
const msg = acpMsg.message;
Expand Down Expand Up @@ -1179,6 +1180,17 @@ export class SessionService {
promptStartedAt: null,
currentPromptId: null,
});
if (isLive) {
// Queued messages will start a new turn — suppress the "done" notification in that case.
if (session.messageQueue.length === 0) {
notifyPromptComplete(
session.taskTitle,
"end_turn",
session.taskId,
);
}
taskViewedApi.markActivity(session.taskId);
}
}
}
// Lifecycle handshake from the agent — flip status to "connected"
Expand Down Expand Up @@ -1264,7 +1276,7 @@ export class SessionService {
} else {
sessionStoreSetters.appendEvents(taskRunId, [acpMsg]);
}
this.updatePromptStateFromEvents(taskRunId, [acpMsg]);
this.updatePromptStateFromEvents(taskRunId, [acpMsg], { isLive: true });

const msg = acpMsg.message;

Expand Down Expand Up @@ -3511,7 +3523,9 @@ export class SessionService {
sessionStoreSetters.clearTailOptimisticItems(taskRunId);
}
sessionStoreSetters.appendEvents(taskRunId, newEvents, expectedCount);
this.updatePromptStateFromEvents(taskRunId, newEvents);
this.updatePromptStateFromEvents(taskRunId, newEvents, {
isLive: true,
});
} else {
this.reconcileCloudLogGap({
taskId: update.taskId,
Expand Down
Loading