From 689ef3094b9e1bee924effb3707dd86b94b38720 Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 29 Sep 2026 06:37:56 +0000 Subject: [PATCH] test: start the plan-count history PTY on its readiness marker (H) The fake CLI prints a startup marker and the runner waits for it instead of the fixed 8 s startup sleep (8.6 s -> 0.9 s locally). eng-semantic-terminal's sleeping registration cases went with C; plan-count-timeout keeps the fixed wait because it asserts deadline behavior. --- test/plan-count-history.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/plan-count-history.test.ts b/test/plan-count-history.test.ts index 6c1931572..ee096cd2f 100644 --- a/test/plan-count-history.test.ts +++ b/test/plan-count-history.test.ts @@ -31,10 +31,11 @@ process.stdin.on('data',()=>{ native('assistant',[{type:'text',text}],new Date(Date.now()+5).toISOString()); process.stdout.write('●'+text.replace(/ /g,'')+'\nCrunched ·done\n❯ '); });process.stdin.resume(); +process.stdout.write('PTY_READY:history\x1b[2J\x1b[H'); `); fs.chmodSync(fake,0o755); fs.writeFileSync(worker,`import fs from 'node:fs';\nimport {runPlanSkillCounting} from ${JSON.stringify(runner)};\n`+ - `const result=await runPlanSkillCounting({skillName:'plan-devex-review',slashCommand:'/plan-devex-review',followUpPrompt:'# History fixture',expectedPlanPath:${JSON.stringify(report)},isLastStep0AUQ:()=>false,isReviewAUQ:(fp,prior)=>{fs.appendFileSync(${JSON.stringify(seen)},JSON.stringify({current:fp.nativeCall.toolUseId,prior:prior?.map(c=>c.toolUseId)??null})+'\\n');return true;},reviewCountCeiling:8,timeoutMs:33000,env:{PROBE_PLAN:${JSON.stringify(report)}}});\n`+ + `const result=await runPlanSkillCounting({skillName:'plan-devex-review',slashCommand:'/plan-devex-review',followUpPrompt:'# History fixture',startupReadyMarker:'PTY_READY:history',expectedPlanPath:${JSON.stringify(report)},isLastStep0AUQ:()=>false,isReviewAUQ:(fp,prior)=>{fs.appendFileSync(${JSON.stringify(seen)},JSON.stringify({current:fp.nativeCall.toolUseId,prior:prior?.map(c=>c.toolUseId)??null})+'\\n');return true;},reviewCountCeiling:8,timeoutMs:33000,env:{PROBE_PLAN:${JSON.stringify(report)}}});\n`+ `fs.writeFileSync(${JSON.stringify(resultFile)},JSON.stringify(result));\n`); const child=Bun.spawn([process.execPath,worker],{env:{...process.env,EVALS_HERMETIC:'1',EVALS_RUN_ID:'',BROWSE_TERMINAL_BINARY:fake},stdout:'pipe',stderr:'pipe'}); const timer=setTimeout(()=>child.kill('SIGKILL'),35000);