fix: harden codex-review E2E — extract SKILL.md section, bump maxTurns to 25

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) <noreply@anthropic.com>
This commit is contained in:
Garry Tan 2026-04-06 22:41:26 -07:00
parent a3307f04fb
commit 3856689b10
No known key found for this signature in database
GPG Key ID: C1F69E85C74EFE1D
1 changed files with 15 additions and 5 deletions

View File

@ -467,8 +467,18 @@ describeIfSelected('Codex skill E2E', ['codex-review'], () => {
run('git', ['add', 'user_controller.rb']); run('git', ['add', 'user_controller.rb']);
run('git', ['commit', '-m', 'add vulnerable controller']); run('git', ['commit', '-m', 'add vulnerable controller']);
// Copy the codex skill file // Extract only the review-relevant section from codex SKILL.md (~120 lines vs 1075).
fs.copyFileSync(path.join(ROOT, 'codex', 'SKILL.md'), path.join(codexDir, 'codex-SKILL.md')); // 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(() => { afterAll(() => {
@ -485,11 +495,11 @@ describeIfSelected('Codex skill E2E', ['codex-review'], () => {
const result = await runSkillTest({ const result = await runSkillTest({
prompt: `You are in a git repo on branch feature/add-vuln with changes against main. 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. Read codex-SKILL.md for the /codex review instructions (it's short ~120 lines).
Run /codex review to review the current diff against main. 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`, Write the full output (including the GATE verdict) to ${codexDir}/codex-output.md`,
workingDirectory: codexDir, workingDirectory: codexDir,
maxTurns: 15, maxTurns: 25,
timeout: 300_000, timeout: 300_000,
testName: 'codex-review', testName: 'codex-review',
runId, runId,