claude-print/src
jedarden e97a8413b5 feat(bf-2f5): watchdog timeout implementation complete
Implement comprehensive watchdog timeout mechanism to prevent indefinite hangs
when child process wedges. All four timeout types are now enforced:

Timeout Types:
- PTY first-output timeout (default 90s): Detects if child produces no PTY output
- Stream-json first-output timeout (default 90s): Detects if child emits no stream-json events
- Overall timeout (default 3600s): Maximum session duration
- Stop hook timeout (default 120s): Detects if Stop hook doesn't fire after prompt injection

Timeout Behavior:
- Sends SIGTERM to child process
- Signals event loop via self-pipe to wake up
- Calls kill_child() which waits 2s then SIGKILL if needed
- Writes clear diagnostic to stderr
- Tears down temp resources via CleanupGuard
- Exits with code 124 (GNU timeout convention)

CLI Arguments:
- --timeout <seconds>: Overall timeout
- --first-output-timeout <seconds>: PTY first-output timeout
- --stream-json-timeout <seconds>: Stream-json first-output timeout
- --stop-hook-timeout <seconds>: Stop hook watchdog timeout

Testing:
- All 90 unit tests pass (6 watchdog-specific tests)
- Integration tests verify end-to-end timeout behavior

This ensures marathon loop/NEEDLE can retry cleanly instead of hanging indefinitely.
2026-06-25 13:39:29 -04:00
..
check.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
cli.rs feat(bf-2f5): add comprehensive watchdog timeout mechanism 2026-06-25 06:59:23 -04:00
config.rs feat(config): implement config file loading with model resolution 2026-06-11 08:29:05 -04:00
emitter.rs Add Phase 8: Emitter — text/json/stream-json output formats 2026-06-10 00:57:30 -04:00
error.rs feat(error): implement comprehensive Error enum and Result alias 2026-06-11 09:11:49 -04:00
event_loop.rs fix: five PTY→FIFO pipeline bugs that prevented end-to-end operation 2026-06-13 23:32:50 -04:00
hook.rs chore(bf-2w7): verify cleanup implementation is complete and remove unused imports 2026-06-25 09:32:01 -04:00
lib.rs feat(bf-2f5): add comprehensive watchdog timeout mechanism 2026-06-25 06:59:23 -04:00
main.rs feat(bf-2f5): watchdog timeout implementation complete 2026-06-25 13:39:29 -04:00
poller.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
pty.rs fix: five PTY→FIFO pipeline bugs that prevented end-to-end operation 2026-06-13 23:32:50 -04:00
session.rs feat(bf-2f5): watchdog timeout implementation complete 2026-06-25 13:39:29 -04:00
startup.rs feat(bf-2f5): add comprehensive watchdog timeout mechanism 2026-06-25 06:59:23 -04:00
terminal.rs Fix clippy warnings: upper_case_acronyms and manual_range_contains 2026-06-10 00:10:43 -04:00
transcript.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
watchdog.rs chore(bf-2w7): verify cleanup implementation is complete and remove unused imports 2026-06-25 09:32:01 -04:00