Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Codex /compact binds to its own turn, not a resumed turn that starts first #35372

Openphon-t(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/35372/headopened View on GitHub

Showing 2 changed files with 179 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
179 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsModified
View file
@@ -4832,6 +4832,185 @@
+ const compactionAfterResumedTurnTranscript = (
+ startOutcome: "accepted" | "interrupted" | "hook-stopped",
+ ) => {
+ const nativeThreadId = "compact-thread";
+ const nativeTurnId = "compact-turn";
+ const resumedTurnId = "resumed-turn";
+ const item = { type: "contextCompaction", id: "compact-item" };
+ const startResponse =
+ startOutcome !== "interrupted"
+ ? { type: "emit_inbound" as const, label: "compact", frame: { id: 3, result: {} } }
+ : {
+ type: "emit_inbound" as const,
+ label: "compact",
+ frame: {
+ id: 3,
+ error: { code: -32_000, message: "Context compaction ended with interrupted." },
+ },
+ };
+ return makeCodexReplayTranscript({
+ scenario: `compaction-after-resumed-turn-${startOutcome}`,
+ entries: [
+ ...codexReplayPreamble({ nativeThreadId, nativeTurnId, prompt: "unused" }).slice(0, 5),
+ {
+ type: "expect_outbound",
+ label: "compact",
+ frame: { id: 3, method: "thread/compact/start", params: { threadId: nativeThreadId } },