From 3856689b10ce816e794cf80503d7d25627083269 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 6 Apr 2026 22:41:26 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20harden=20codex-review=20E2E=20=E2=80=94?= =?UTF-8?q?=20extract=20SKILL.md=20section,=20bump=20maxTurns=20to=2025?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test was copying the full 55KB/1075-line codex SKILL.md into the fixture, requiring 8 Read calls just to consume it and exhausting the 15-turn budget before reaching the actual codex review command. Now extracts only the review-relevant section (~6KB/148 lines), reducing Read calls from 8 to 1. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/skill-e2e-workflow.test.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/skill-e2e-workflow.test.ts b/test/skill-e2e-workflow.test.ts index 598b65b8..ee08290e 100644 --- a/test/skill-e2e-workflow.test.ts +++ b/test/skill-e2e-workflow.test.ts @@ -467,8 +467,18 @@ describeIfSelected('Codex skill E2E', ['codex-review'], () => { run('git', ['add', 'user_controller.rb']); run('git', ['commit', '-m', 'add vulnerable controller']); - // Copy the codex skill file - fs.copyFileSync(path.join(ROOT, 'codex', 'SKILL.md'), path.join(codexDir, 'codex-SKILL.md')); + // Extract only the review-relevant section from codex SKILL.md (~120 lines vs 1075). + // Full SKILL.md is 55KB / ~14K tokens — takes 8 Read calls to consume, exhausting turns. + const full = fs.readFileSync(path.join(ROOT, 'codex', 'SKILL.md'), 'utf-8'); + const startMarker = '# /codex — Multi-AI Second Opinion'; + const endMarker = '## Plan File Review Report'; + const start = full.indexOf(startMarker); + const end = full.indexOf(endMarker, start); + const reviewSection = full.slice( + start >= 0 ? start : 0, + end > start ? end : undefined, + ); + fs.writeFileSync(path.join(codexDir, 'codex-SKILL.md'), reviewSection); }); afterAll(() => { @@ -485,11 +495,11 @@ describeIfSelected('Codex skill E2E', ['codex-review'], () => { const result = await runSkillTest({ prompt: `You are in a git repo on branch feature/add-vuln with changes against main. -Read codex-SKILL.md for the /codex skill instructions. -Run /codex review to review the current diff against main. +Read codex-SKILL.md for the /codex review instructions (it's short — ~120 lines). +Follow those instructions to run codex review against the diff on this branch. Write the full output (including the GATE verdict) to ${codexDir}/codex-output.md`, workingDirectory: codexDir, - maxTurns: 15, + maxTurns: 25, timeout: 300_000, testName: 'codex-review', runId,