The best way to control Claude Code, Codex and more from any computer or phone
perf(opencode): stop retaining every message of a loaded OpenCode thread (#17784)
Tristan Knight committed
Oct 11, 2026 at 03:58 UTC
b467be4ea7bb9ba1d1664a77939473e2fda8ec4e
1 file changed
-5
packages/provider-opencode/src/server/adapter.ts
-5
@@ -384,7 +384,6 @@ interface OpenCodeThreadState {
384
appThread: OrchestrationV2AppThread | null;
385
activeTurn: ActiveOpenCodeTurn | null;
386
readonly providerTurns: Map<string, OrchestrationV2ProviderTurn>;
387
- readonly messages: Map<string, OrchestrationV2ConversationMessage>;
387
readonly runtimeRequests: Map<string, OrchestrationV2RuntimeRequest>;
388
readonly messageRoles: Map<string, "user" | "assistant">;
389
readonly userMessageIds: Array<string>;
@@ -1257,7 +1256,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
1256
createdAt: startedAt,
1257
updatedAt: emittedAt,
1258
};
1260
- state.messages.set(String(message.id), message);
1259
yield* emitProviderEvent({
1260
type: "message.updated",
1261
driver: OPENCODE_PROVIDER,
@@ -1428,7 +1426,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
1426
appThread: childThread,
1427
activeTurn: null,
1428
providerTurns: new Map(),
1431
- messages: new Map(),
1429
runtimeRequests: new Map(),
1430
messageRoles: new Map(),
1431
userMessageIds: [],
@@ -2336,7 +2333,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
2333
createdAt: turn.startedAt,
2334
updatedAt: now,
2335
};
2339
- state.messages.set(String(messageId), projected);
2336
yield* emitProviderEvent({
2337
type: "message.updated",
2338
driver: OPENCODE_PROVIDER,
@@ -2834,7 +2830,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
2830
appThread,
2831
activeTurn: null,
2832
providerTurns: new Map(),
2837
- messages: new Map(),
2833
runtimeRequests: new Map(),
2834
messageRoles: new Map(),
2835
userMessageIds: [],