Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): resume archived Codex sessions #10505

ClosedGigioxx(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/10505/headopened View on GitHub

Showing 2 changed files with 113 additions and 11 deletions.

x
0 of 2 viewed, 2 left
94 additions and 3 deletionsapps/server/src/provider/Layers/CodexSessionRuntime.test.tsModified
View file
@@ -781,6 +781,97 @@
});
​
describe("openCodexThread", () => {
+ it.effect("unarchives an archived session and resumes the same thread", () =>
+ Effect.gen(function* () {
+ const calls: Array<{ method: string; payload: unknown }> = [];
+ const opened = yield* openCodexThread({
+ client: {
+ request: () => Effect.die("An archived session must not start fresh"),
+ raw: {
+ request: (method, payload) =>
+ Effect.suspend(() => {
+ calls.push({ method, payload });
+ if (calls.length === 1) {
+ return Effect.fail(
+ new CodexErrors.CodexAppServerRequestError({
+ code: -32600,
+ errorMessage:
+ "session saved-thread is archived. Run `codex unarchive saved-thread` to unarchive it first.",
+ }),
+ );
+ }
+ return Effect.succeed(makeThreadOpenResponse("saved-thread"));
+ }),
+ },
+ },
+ threadId: ThreadId.make("thread-1"),
+ runtimeMode: "auto",