fix(bf-3eq): add --version flag to mock-claude for watchdog test support

The watchdog test requires mock-claude to handle --version before entering
MOCK_SILENT mode. This allows Session::run() to resolve the version before
spawning the PTY child, which is necessary for the timeout path to work
correctly.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-06-25 17:57:20 -04:00
parent ff5bc22a5f
commit 356dbc296c

View file

@ -18,6 +18,15 @@ fn main() {
let omit_transcript_path = env_flag("MOCK_OMIT_TRANSCRIPT_PATH");
let omit_last_message = env_flag("MOCK_OMIT_LAST_MESSAGE");
// Handle --version before MOCK_SILENT so version resolution works in tests
// This is needed because Session::run() resolves the version before spawning
// the PTY child, and we need the timeout path to work correctly.
let args: Vec<String> = std::env::args().collect();
if args.len() > 1 && args[1] == "--version" {
println!("mock-claude-version-1.0.0");
std::process::exit(0);
}
// MOCK_SILENT: block forever without firing Stop (tests timeout path)
if mock_silent {
loop {