Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): detaching a Codex thread unloads it from the shared app-server #14187

Mergedjuliusmarmingemerged 2 commits intot3code/codex-turn-mapping fromrefs/pull/14187/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 98 additions and 0 deletions (loading 2).

x
0 of 5 viewed, 5 left
72 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsModified
View file
@@ -1813,6 +1813,78 @@
+ it.effect("unsubscribes from the native thread when it is unloaded", () =>
+ Effect.gen(function* () {
+ const nativeThreadId = "unload-thread";
+ const preamble = codexReplayPreamble({
+ nativeThreadId,
+ nativeTurnId: "unused",
+ prompt: "unused",
+ });
+ const transcript = makeCodexReplayTranscript({
+ scenario: "unload-thread",
+ entries: [
+ // initialize + thread/start only; no turn runs.
+ ...preamble.slice(0, 5),
+ {
+ type: "expect_outbound",
+ label: "thread/unsubscribe",
+ frame: { id: 3, method: "thread/unsubscribe", params: { threadId: nativeThreadId } },
+ },
+ // Response shape recorded from codex app-server 0.156.1.
+ {
+ type: "emit_inbound",
+ label: "thread/unsubscribe",
+ frame: { id: 3, result: { status: "unsubscribed" } },
+ },
+ ],
+ });