Files
ruflo/plugins/ruflo-core/scripts/fixtures/hook-cli-slow.cjs
T
randRuFlo b98935f34f fix(core,cli): record failed tool outcomes, run hooks from the project root, keep telemetry off the tool path
- #4127: PostToolUseFailure registered for Bash and Write|Edit|MultiEdit and forwarded with -s false and the real exit code (builds on #4170 by @rudycelekli; payload shape verified against Claude Code 2.1.289)
- #4176: the hook shim starts the CLI from CLAUDE_PROJECT_DIR; the CLI only adopts a proven config in a directory that carries ruflo init's markers, not a bare .claude/ that Claude Code created
- #4128: the shim starts the CLI detached and returns at once (about 25 ms instead of 0.2-4 s per hook), bounded to 4 concurrent telemetry CLIs per project, Stop never dropped, RUFLO_HOOK_SYNC=1 for the old path
- ruflo-core 0.2.9

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-14 05:28:12 -04:00

12 lines
558 B
JavaScript

// Test fixture: a "CLI" that is slow like a cold ruflo start and records what it
// received (argv, cwd, stdin) so a test can prove the hook shim returned first
// and still delivered everything (#4128, #4176).
const fs = require('fs');
const out = process.env.HOOK_SLOW_OUT;
const delay = Number(process.env.HOOK_SLOW_MS || 1500);
let stdin = '';
try { stdin = fs.readFileSync(0, 'utf8'); } catch { /* no stdin */ }
setTimeout(() => {
if (out) fs.writeFileSync(out, JSON.stringify({ argv: process.argv.slice(2), cwd: process.cwd(), stdin }));
}, delay);