Skip to content

Commit 1a43f48

Browse files
t3dotggclaude
andauthored
fix(server): Codex /goal no longer tries to create the goal twice (#33260)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 402d062 commit 1a43f48

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8700,7 +8700,7 @@ describe("CodexAdapterV2 post-settle continuation", () => {
87008700
nativeThreadId,
87018701
nativeTurnId: "goal-turn-1",
87028702
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}`,
87048704
}).slice(5),
87058705
5,
87068706
),
@@ -8840,7 +8840,7 @@ describe("CodexAdapterV2 post-settle continuation", () => {
88408840
nativeThreadId,
88418841
nativeTurnId: "goal-turn-limit",
88428842
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}`,
88448844
}).slice(5),
88458845
5,
88468846
),

‎apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6976,15 +6976,16 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
69766976
const activation = { stopped: false };
69776977
goalActivations.set(threadId, activation);
69786978
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.
69806981
yield* startNativeTurn(
69816982
turnInput,
69826983
command.type === "set"
69836984
? yield* toCodexInput({
69846985
...turnInput,
69856986
message: {
69866987
...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}`,
69886989
},
69896990
})
69906991
: [],

0 commit comments

Comments
 (0)