Skip to content

check-inbox hook has no timeout and swallows decode errors #206

Description

@d0ugal

Bug

Two issues in `internal/cli/check_inbox.go`:

  1. 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.

  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmessagingInter-agent messaging systemsize: SLocalized: a flag/field + handler, or a contained bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions