authorgravatar for admin@snappeh.comTristan Knight <admin@snappeh.com> 2026-10-11 03:58:55+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-10 23:58:55-03:00
logb467be4ea7bb9ba1d1664a77939473e2fda8ec4e
tree97227dc2b2a658c253a36d3fb079ed0631246533
parenta2f4c7fb7cd8dfa76a0d274e7938e1f368fed48c
signature Signed by PGP key B5690EEEBB952194

perf(opencode): stop retaining every message of a loaded OpenCode thread (#17784)


1 files changed, 0 insertions(+), 5 deletions(-)

packages/provider-opencode/src/server/adapter.ts-5
...@@ -384,7 +384,6 @@ interface OpenCodeThreadState {...@@ -384,7 +384,6 @@ interface OpenCodeThreadState {
384 appThread: OrchestrationV2AppThread | null;384 appThread: OrchestrationV2AppThread | null;
385 activeTurn: ActiveOpenCodeTurn | null;385 activeTurn: ActiveOpenCodeTurn | null;
386 readonly providerTurns: Map<string, OrchestrationV2ProviderTurn>;386 readonly providerTurns: Map<string, OrchestrationV2ProviderTurn>;
387 readonly messages: Map<string, OrchestrationV2ConversationMessage>;
388 readonly runtimeRequests: Map<string, OrchestrationV2RuntimeRequest>;387 readonly runtimeRequests: Map<string, OrchestrationV2RuntimeRequest>;
389 readonly messageRoles: Map<string, "user" | "assistant">;388 readonly messageRoles: Map<string, "user" | "assistant">;
390 readonly userMessageIds: Array<string>;389 readonly userMessageIds: Array<string>;
...@@ -1257,7 +1256,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function...@@ -1257,7 +1256,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
1257 createdAt: startedAt,1256 createdAt: startedAt,
1258 updatedAt: emittedAt,1257 updatedAt: emittedAt,
1259 };1258 };
1260 state.messages.set(String(message.id), message);
1261 yield* emitProviderEvent({1259 yield* emitProviderEvent({
1262 type: "message.updated",1260 type: "message.updated",
1263 driver: OPENCODE_PROVIDER,1261 driver: OPENCODE_PROVIDER,
...@@ -1428,7 +1426,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function...@@ -1428,7 +1426,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
1428 appThread: childThread,1426 appThread: childThread,
1429 activeTurn: null,1427 activeTurn: null,
1430 providerTurns: new Map(),1428 providerTurns: new Map(),
1431 messages: new Map(),
1432 runtimeRequests: new Map(),1429 runtimeRequests: new Map(),
1433 messageRoles: new Map(),1430 messageRoles: new Map(),
1434 userMessageIds: [],1431 userMessageIds: [],
...@@ -2336,7 +2333,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function...@@ -2336,7 +2333,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
2336 createdAt: turn.startedAt,2333 createdAt: turn.startedAt,
2337 updatedAt: now,2334 updatedAt: now,
2338 };2335 };
2339 state.messages.set(String(messageId), projected);
2340 yield* emitProviderEvent({2336 yield* emitProviderEvent({
2341 type: "message.updated",2337 type: "message.updated",
2342 driver: OPENCODE_PROVIDER,2338 driver: OPENCODE_PROVIDER,
...@@ -2834,7 +2830,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function...@@ -2834,7 +2830,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
2834 appThread,2830 appThread,
2835 activeTurn: null,2831 activeTurn: null,
2836 providerTurns: new Map(),2832 providerTurns: new Map(),
2837 messages: new Map(),
2838 runtimeRequests: new Map(),2833 runtimeRequests: new Map(),
2839 messageRoles: new Map(),2834 messageRoles: new Map(),
2840 userMessageIds: [],2835 userMessageIds: [],