Documentation
¶
Overview ¶
Command fakeagent is a deterministic stand-in for a real raw-mode coding agent (Claude Code / Codex / Cline) for amux end-to-end tests.
Unlike the inert "sleep 1000" stub, it puts its terminal into raw mode and records every byte it receives on stdin to the file named by $FAKEAGENT_LOG. Raw mode is the whole point: it disables the line discipline's CR->NL translation, so a literal carriage return (0x0D) survives intact instead of being mapped to NL. That makes amux's real input path observable and lets a test prove the historically-escaped send/Enter/timing bugs cannot regress:
- bug #2 named-"Enter" vs hex 0D: a regression to the named key never reaches the agent as 0x0D, so the recording differs.
- bug #3 Enter lost when sent <50ms after text: the recording is missing bytes or the trailing CR.
- bug #4 input sent before the agent is ready: the readiness banner gates the test, and --startup-delay simulates a slow agent.
It prints "FAKEAGENT READY" once raw mode is active so callers can wait for readiness before sending input, then echoes nothing (a real raw-mode TUI does not line-echo) and stays alive until stdin closes.