test: settle the post-response composer before seeding; give the TPA recorder adapter its infra helper

submitPlanSeed accepted a stale empty composer when the transcript recorded
end_turn before the CLI repainted (late-repaint-typed-current fails 5/5 on the
old helper, passes 5/5 now). The TPA recording fixture extracted recordE2E
without isPreTurnInfraFailure, so every failed case threw before recording.
This commit is contained in:
garrytan committed 2026-09-29 20:43:00 +00:00
1 parent 80c92c86ed
commit 3fc05932b7
4 files changed
+20 -9

No files matched your search

+5 -4
View File
@@ -24,10 +24,11 @@ const recoveryResponses = JSON.parse(readFile(path.join(root, 'test/fixtures/thi
const writeFile = fs.writeFileSync.bind(fs);
const remove = fs.rmSync.bind(fs);
const source = readFile(path.join(root, 'test/helpers/e2e-helpers.ts'), 'utf8');
const start = source.indexOf('export function recordE2E(');
const end = source.indexOf('/**', start);
if (start < 0 || end < 0) throw new Error('recordE2E source boundary missing');
const recordSource = new Bun.Transpiler({ loader: 'ts' }).transformSync(source.slice(start, end).replace('export function', 'function'));
const start = source.indexOf('const INFRA_EXIT_REASONS');
const recordStart = source.indexOf('export function recordE2E(');
const end = source.indexOf('/**', recordStart);
if (start < 0 || recordStart < start || end < 0) throw new Error('recordE2E source boundary missing');
const recordSource = new Bun.Transpiler({ loader: 'ts' }).transformSync(source.slice(start, end).replaceAll('export function', 'function'));
const recordE2E = new Function(recordSource + '\\nreturn recordE2E;')();
const cases = new Map();
const records = [];