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 {
384384 appThread: OrchestrationV2AppThread | null;
385385 activeTurn: ActiveOpenCodeTurn | null;
386386 readonly providerTurns: Map<string, OrchestrationV2ProviderTurn>;
387 readonly messages: Map<string, OrchestrationV2ConversationMessage>;
388387 readonly runtimeRequests: Map<string, OrchestrationV2RuntimeRequest>;
389388 readonly messageRoles: Map<string, "user" | "assistant">;
390389 readonly userMessageIds: Array<string>;
......@@ -1257,7 +1256,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
12571256 createdAt: startedAt,
12581257 updatedAt: emittedAt,
12591258 };
1260 state.messages.set(String(message.id), message);
12611259 yield* emitProviderEvent({
12621260 type: "message.updated",
12631261 driver: OPENCODE_PROVIDER,
......@@ -1428,7 +1426,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
14281426 appThread: childThread,
14291427 activeTurn: null,
14301428 providerTurns: new Map(),
1431 messages: new Map(),
14321429 runtimeRequests: new Map(),
14331430 messageRoles: new Map(),
14341431 userMessageIds: [],
......@@ -2336,7 +2333,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
23362333 createdAt: turn.startedAt,
23372334 updatedAt: now,
23382335 };
2339 state.messages.set(String(messageId), projected);
23402336 yield* emitProviderEvent({
23412337 type: "message.updated",
23422338 driver: OPENCODE_PROVIDER,
......@@ -2834,7 +2830,6 @@ export const makeOpenCodeAdapterV2 = Effect.fn("makeOpenCodeAdapterV2")(function
28342830 appThread,
28352831 activeTurn: null,
28362832 providerTurns: new Map(),
2837 messages: new Map(),
28382833 runtimeRequests: new Map(),
28392834 messageRoles: new Map(),
28402835 userMessageIds: [],