#!/usr/bin/env node // Slow Hermes fixture for bounded-queue acceptance tests. Normal prompts // answer immediately; prompts containing HOLD block until a release file // appears inside the agent workdir (the value after `--in`), so tests can // saturate the queue deterministically without touching shared /tmp state. import { existsSync } from 'node:fs'; import { appendFileSync } from 'node:fs'; const args = process.argv.slice(2); const promptIndex = args.indexOf('-q'); const prompt = promptIndex >= 0 ? args[promptIndex + 1] : ''; const workdirIndex = args.indexOf('--in'); const workdir = workdirIndex >= 0 ? args[workdirIndex + 1] : '/tmp'; appendFileSync(`${workdir}/fixture-pids.log`, `${process.pid}\n`); process.stdout.write('session_id: slow_fixture_2026\n'); if (/HOLD/.test(prompt)) { const releaseFile = `${workdir}/hermes-release`; while (!existsSync(releaseFile)) await new Promise(resolve => setTimeout(resolve, 20)); } process.stdout.write('Hermes fixture answered the bounded request.\n');