Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): rewound Codex threads import their history from before the rewind #30652

MergedMarcoDotIO(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/30652/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 175 additions and 6 deletions.

x
0 of 2 viewed, 2 left
85 additions and 0 deletionsapps/server/src/project/AgentSessionScanner.test.tsModified
View file
@@ -1337,6 +1337,91 @@
+ it.effect("imports a rewound Codex thread with the history its new rollout inherits", () =>
+ Effect.gen(function* () {
+ const path = yield* Path.Path;
+ const nowMs = Date.parse("2026-08-24T12:00:00.000Z");
+ yield* TestClock.setTime(nowMs);
+ const claudeHomePath = yield* makeTempDir("t3code-claude-home-");
+ const codexHomePath = yield* makeTempDir("t3code-codex-home-");
+ const workspace = yield* makeTempDir("t3code-workspace-");
+ const threadId = "019a0000-0000-7000-8000-000000000001";
+ const rolloutId = "019a0000-0000-7000-8000-000000000002";
+ const sessionsDir = path.join(codexHomePath, "sessions", "2026", "08", "24");
+ const prompt = (message: string) =>
+ encodeTranscriptRecord({ type: "event_msg", payload: { type: "user_message", message } });
+ const reply = (text: string) =>
+ encodeTranscriptRecord({
+ type: "response_item",
+ payload: {
+ type: "message",
+ role: "assistant",
+ content: [{ type: "output_text", text }],
+ },
+ });
+ const keptHistory = [
+ encodeTranscriptRecord({
+ type: "session_meta",
+ payload: { id: threadId, cwd: workspace, history_mode: "paginated" },