Bug
Two issues in `internal/cli/check_inbox.go`:
-
No timeout: The frame-reading loop has no deadline. If the daemon streams frames slowly or the connection hangs, this hook blocks the agent's SessionStart indefinitely.
-
Swallowed decode error (line 50): `msg, _ := protocol.DecodeControl(frame.Payload)` — a malformed frame produces a zero-value Envelope with `Type: ""`. The switch falls through without matching, and the loop continues waiting for a `msg_done` that was already garbled.
Suggestion: Add a context timeout (e.g. 5 seconds) for the entire operation, and break/log on decode errors.
Found by: Claude (review tribunal)
Bug
Two issues in `internal/cli/check_inbox.go`:
No timeout: The frame-reading loop has no deadline. If the daemon streams frames slowly or the connection hangs, this hook blocks the agent's SessionStart indefinitely.
Swallowed decode error (line 50): `msg, _ := protocol.DecodeControl(frame.Payload)` — a malformed frame produces a zero-value Envelope with `Type: ""`. The switch falls through without matching, and the loop continues waiting for a `msg_done` that was already garbled.
Suggestion: Add a context timeout (e.g. 5 seconds) for the entire operation, and break/log on decode errors.
Found by: Claude (review tribunal)