The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 11:30 UTC
perf(server): stop retaining unused OpenCode tool history (#9684)
Theo Browne committed
Sep 4, 2026 at 07:19 UTC
f2e3764c257a7e27c8171d7dd1e38d4383074206
1 file changed
-28
apps/server/src/provider/Layers/OpenCodeAdapter.ts
-28
@@ -338,7 +338,6 @@ interface OpenCodeSessionContext {
338
readonly partById: Map<string, Part>;
339
readonly emittedTextByPartId: Map<string, string>;
340
readonly completedAssistantPartIds: Set<string>;
341
- readonly turns: Array<OpenCodeTurnSnapshot>;
341
activeTurnId: TurnId | undefined;
342
activeAgent: string | undefined;
343
activeVariant: string | undefined;
@@ -476,31 +475,6 @@ function mapPermissionDecision(reply: "once" | "always" | "reject"): string {
475
}
476
}
477
479
-function resolveTurnSnapshot(
480
- context: OpenCodeSessionContext,
481
- turnId: TurnId,
482
-): OpenCodeTurnSnapshot {
483
- const existing = context.turns.find((turn) => turn.id === turnId);
484
- if (existing) {
485
- return existing;
486
- }
487
-
488
- const created: OpenCodeTurnSnapshot = { id: turnId, items: [] };
489
- context.turns.push(created);
490
- return created;
491
-}
492
-
493
-function appendTurnItem(
494
- context: OpenCodeSessionContext,
495
- turnId: TurnId | undefined,
496
- item: unknown,
497
-): void {
498
- if (!turnId) {
499
- return;
500
- }
501
- resolveTurnSnapshot(context, turnId).items.push(item);
502
-}
503
-
478
const ensureSessionContext = Effect.fn("ensureSessionContext")(function* (
479
sessions: ReadonlyMap<ThreadId, OpenCodeSessionContext>,
480
threadId: ThreadId,
@@ -2365,7 +2339,6 @@ export function makeOpenCodeAdapter(
2339
: "item.updated",
2340
payload,
2341
};
2368
- appendTurnItem(context, turnId, part);
2342
yield* emit(runtimeEvent);
2343
}
2344
break;
@@ -2853,7 +2826,6 @@ export function makeOpenCodeAdapter(
2826
emittedTextByPartId: new Map(),
2827
messageRoleById: new Map(),
2828
completedAssistantPartIds: new Set(),
2856
- turns: [],
2829
activeTurnId: undefined,
2830
activeAgent: undefined,
2831
activeVariant: undefined,