GeezerVison is showing github.com — fix(server): Codex /goal no longer tries to create the goal twice (#3… · Pipyakas/t3code@1a43f48
File treeExpand file treeCollapse file tree Open diff view settings apps/server/src/orchestration-v2/Adapters
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -8700,7 +8700,7 @@ describe("CodexAdapterV2 post-settle continuation", () => { | 8700 | 8700 | nativeThreadId, | 8701 | 8701 | nativeTurnId: "goal-turn-1", | 8702 | 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 | 8704 | }).slice(5), | 8705 | 8705 | 5, | 8706 | 8706 | ), | @@ -8840,7 +8840,7 @@ describe("CodexAdapterV2 post-settle continuation", () => { | 8840 | 8840 | nativeThreadId, | 8841 | 8841 | nativeTurnId: "goal-turn-limit", | 8842 | 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 | 8844 | }).slice(5), | 8845 | 8845 | 5, | 8846 | 8846 | ), | |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6976,15 +6976,16 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* ( | 6976 | 6976 | const activation = { stopped: false }; | 6977 | 6977 | goalActivations.set(threadId, activation); | 6978 | 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. | 6980 | 6981 | yield* startNativeTurn( | 6981 | 6982 | turnInput, | 6982 | 6983 | command.type === "set" | 6983 | 6984 | ? yield* toCodexInput({ | 6984 | 6985 | ...turnInput, | 6985 | 6986 | message: { | 6986 | 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}`, | 6988 | 6989 | }, | 6989 | 6990 | }) | 6990 | 6991 | : [], | |
|