Skip to content

Commit 8eb20ea

Browse files
fix(memory): omit checkout instructions from Codex fact extraction
1 parent 458271b commit 8eb20ea

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎apps/server/src/textGeneration/CodexTextGeneration.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,23 @@ it.layer(layerCodexTextGenerationTest)("CodexTextGeneration", (it) => {
372372
),
373373
);
374374

375+
it.effect("keeps checkout instructions out of automatic memory extraction", () =>
376+
withFakeCodexEnv(
377+
{
378+
output: JSON.stringify({ candidates: [] }),
379+
requireArg: "--config project_doc_max_bytes=0",
380+
requiredCwd: process.cwd(),
381+
},
382+
(textGeneration) =>
383+
textGeneration.generateKnowledgeCandidates({
384+
cwd: process.cwd(),
385+
modelSelection: createModelSelection(ProviderInstanceId.make("codex"), "gpt-6-luna"),
386+
runOutcome: "completed",
387+
messages: [{ ref: "M1", role: "user", text: "Use the shared test runner." }],
388+
}),
389+
),
390+
);
391+
375392
it.effect("preserves custom PR instructions while allowing checkout inspection", () =>
376393
withFakeCodexEnv(
377394
{

‎apps/server/src/textGeneration/CodexTextGeneration.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ export const makeCodexTextGeneration = Effect.fn("makeCodexTextGeneration")(func
304304
...execLaunchArgs,
305305
// A user's MCP server could act on the text-generation prompt.
306306
...CODEX_NO_PLUGIN_ARGS,
307+
// Memory candidates cite the supplied exchange; checkout instructions add unrelated input.
308+
...(operation === "generateKnowledgeCandidates"
309+
? ["--config", "project_doc_max_bytes=0"]
310+
: []),
307311
...(mcpServersOff ? ["--config", mcpServersOff] : []),
308312
"--ephemeral",
309313
"--skip-git-repo-check",

0 commit comments

Comments
 (0)