Skip to content

Commit d1d6265

Browse files
fix(acp): do not split an answer for a running call that aged out
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 748aa36 commit d1d6265

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/server/src/provider/acp/AcpSessionRuntime.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ const handleSessionUpdate = ({
12101210
}
12111211
for (const event of parsed.events) {
12121212
if (event._tag === "ToolCallUpdated") {
1213-
const { merged, decision } = yield* Ref.modify(toolCallsRef, (current) => {
1213+
const { merged, decision, active } = yield* Ref.modify(toolCallsRef, (current) => {
12141214
const tracked = current.get(event.toolCall.toolCallId);
12151215
const previous = tracked?.state;
12161216
const nextToolCall = mergeToolCallState(previous, event.toolCall);
@@ -1232,7 +1232,7 @@ const handleSessionUpdate = ({
12321232
skippedSinceEmit: decision.skippedSinceEmit,
12331233
});
12341234
}
1235-
return [{ merged: nextToolCall, decision }, next] as const;
1235+
return [{ merged: nextToolCall, decision, active: tracked !== undefined }, next] as const;
12361236
});
12371237
if (!decision.emit) {
12381238
continue;
@@ -1245,7 +1245,8 @@ const handleSessionUpdate = ({
12451245
if (shownToolCallIds.size > MAX_SHOWN_TOOL_CALL_IDS) {
12461246
shownToolCallIds.delete(shownToolCallIds.values().next().value!);
12471247
}
1248-
yield* closeActiveAssistantSegment({ queue, assistantSegmentRef });
1248+
// A call still running is already on screen, even if it aged out.
1249+
if (!active) yield* closeActiveAssistantSegment({ queue, assistantSegmentRef });
12491250
}
12501251
yield* Queue.offer(queue, {
12511252
_tag: "ToolCallUpdated",

0 commit comments

Comments
 (0)