@devries-cameron20 / t3code-1 / commits / 1a43f4870d
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): Codex /goal no longer tries to create the goal twice (#33260)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Nov 9, 2026 at 02:16 UTC 1a43f4870d4d27e6514b7485a8742027e2f48b34
2 files changed +5 -4
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
+2 -2
@@ -8700,7 +8700,7 @@ describe("CodexAdapterV2 post-settle continuation", () => {
8700 nativeThreadId,
8701 nativeTurnId: "goal-turn-1",
8702 prompt: objective,
8703 - sentPrompt: `Start working toward this goal: ${objective}`,
8703 + sentPrompt: `This thread's goal is already set. Do not call create_goal. Start working on it now: ${objective}`,
8704 }).slice(5),
8705 5,
8706 ),
@@ -8840,7 +8840,7 @@ describe("CodexAdapterV2 post-settle continuation", () => {
8840 nativeThreadId,
8841 nativeTurnId: "goal-turn-limit",
8842 prompt: atLimit,
8843 - sentPrompt: `Start working toward this goal: ${atLimit}`,
8843 + sentPrompt: `This thread's goal is already set. Do not call create_goal. Start working on it now: ${atLimit}`,
8844 }).slice(5),
8845 5,
8846 ),
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
+3 -2
@@ -6976,7 +6976,8 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
6976 const activation = { stopped: false };
6977 goalActivations.set(threadId, activation);
6978 yield* Effect.gen(function* () {
6979 - // A bare objective reads like a statement, so the model echoes it back.
6979 + // A bare objective gets echoed back, and "start this goal" gets a
6980 + // create_goal call that Codex rejects because the goal already exists.
6981 yield* startNativeTurn(
6982 turnInput,
6983 command.type === "set"
@@ -6984,7 +6985,7 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
6985 ...turnInput,
6986 message: {
6987 ...turnInput.message,
6987 - text: `Start working toward this goal: ${command.objective}`,
6988 + text: `This thread's goal is already set. Do not call create_goal. Start working on it now: ${command.objective}`,
6989 },
6990 })
6991 : [],