mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 21:39:54 +02:00
Claude's stream-json flow can emit the terminal result event while the child process still waits on open stdin. Closing stdin as soon as the final result arrives lets the CLI exit cleanly instead of idling until the daemon timeout fires. Constraint: Must preserve the existing Claude stream-json protocol and child-process lifecycle Rejected: Increase ping timeout only | masks the hang without fixing process exit Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep Claude stdin handling aligned with the stream-json terminal result semantics; do not defer closure until goroutine teardown Tested: Reproduced self-hosted runtime ping timeout locally; verified ping succeeds after closing stdin on result; cd server && go test ./pkg/agent Not-tested: Full make check; Bedrock/Vertex-specific Claude auth flows