GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(acp): cap remembered tool call ids per session · pingdotgg/t3code@748aa36

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/provider/acp
    • AcpSessionRuntime.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: apps/server/src/provider/acp/AcpSessionRuntime.ts
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import {
4040
type AcpToolCallState,
4141
} from "./AcpRuntimeModel.ts";
4242

43+
const MAX_SHOWN_TOOL_CALL_IDS = 256;
44+
4345
interface AcpToolCallTrackedState {
4446
readonly state: AcpToolCallState;
4547
readonly lastEmittedDetailLength: number | undefined;
@@ -334,7 +336,7 @@ export const make = (
334336
const eventQueue = yield* Queue.unbounded<AcpSessionRuntimeEvent>();
335337
const modeStateRef = yield* Ref.make<AcpSessionModeState | undefined>(undefined);
336338
const toolCallsRef = yield* Ref.make(new Map<string, AcpToolCallTrackedState>());
337-
// Tool calls already shown. A late update to a finished call is not a new
339+
// Recently shown tool calls. A late update to a finished call is not a new
338340
// boundary in the answer, although its progress state is gone.
339341
const shownToolCallIds = new Set<string>();
340342
const assistantItemRuntimeId = yield* crypto.randomUUIDv4.pipe(
@@ -1239,6 +1241,10 @@ const handleSessionUpdate = ({
12391241
// is already shown, such as a background command finishing, is not.
12401242
if (!shownToolCallIds.has(merged.toolCallId)) {
12411243
shownToolCallIds.add(merged.toolCallId);
1244+
// Only recent calls get late updates; keep a long session bounded.
1245+
if (shownToolCallIds.size > MAX_SHOWN_TOOL_CALL_IDS) {
1246+
shownToolCallIds.delete(shownToolCallIds.values().next().value!);
1247+
}
12421248
yield* closeActiveAssistantSegment({ queue, assistantSegmentRef });
12431249
}
12441250
yield* Queue.offer(queue, {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.