Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): OpenCode 2 stops writing unchanged session status updates #16775

MergedAbdullah1738(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/16775/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 67 additions and 0 deletions.

x
0 of 2 viewed, 2 left
64 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/OpenCode2AdapterV2.test.tsModified
View file
@@ -3922,6 +3922,70 @@
}).pipe(Effect.scoped, Effect.provide(IdAllocator.layer)),
+ it.effect("reports the shared session's status only when it changes", () =>
+ Effect.gen(function* () {
+ const OTHER = "ses_f148ca2deffeOtherSession000";
+ const promptInto = (
+ session: string,
+ recorded: string,
+ ): ReadonlyArray<ProviderReplayEntry> => [
+ out("session.prompt", { sessionID: session, id: recorded, text: "<any>" }),
+ replyData("session.prompt", {
+ id: recorded,
+ sessionID: session,
+ time: { created: 1790656601410 },
+ type: "user",
+ payload: { text: "hi" },
+ delivery: "steer",
+ }),
+ ];
+ const { runtime, thread } = yield* resumed([
+ out("session.get", { sessionID: OTHER }),
+ replyData("session.get", sessionInfo({ id: OTHER })),
+ out("permission.list", { sessionID: OTHER }),
+ replyData("permission.list", []),
+ out("session.form.list", { sessionID: OTHER }),
+ replyData("session.form.list", []),
+ ...promptInto(SESSION, "msg_recorded_turn_a"),
+ out("session.instructions.entry.put", { sessionID: OTHER, key: "t3-code", value: "<any>" }),