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.
This commit is contained in:
garrytan committed 2026-09-29 06:37:56 +00:00
1 parent 0489bc9fe8
commit 689ef3094b
1 file changed
+2 -1
+2 -1
View File
@@ -31,10 +31,11 @@ process.stdin.on('data',()=>{
native('assistant',[{type:'text',text}],new Date(Date.now()+5).toISOString()); native('assistant',[{type:'text',text}],new Date(Date.now()+5).toISOString());
process.stdout.write('●'+text.replace(/ /g,'')+'\nCrunched ·done\n❯ '); process.stdout.write('●'+text.replace(/ /g,'')+'\nCrunched ·done\n❯ ');
});process.stdin.resume(); });process.stdin.resume();
process.stdout.write('PTY_READY:history\x1b[2J\x1b[H');
`); `);
fs.chmodSync(fake,0o755); fs.chmodSync(fake,0o755);
fs.writeFileSync(worker,`import fs from 'node:fs';\nimport {runPlanSkillCounting} from ${JSON.stringify(runner)};\n`+ 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`); `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 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); const timer=setTimeout(()=>child.kill('SIGKILL'),35000);