Files
jif 782826663d Bound agent message board SSE frames before parsing (#48190)
## Why

Checking notification data size after SSE parsing leaves oversized fields and unterminated frames free to accumulate in the parser. Malformed UTF-8 can also be retained indefinitely by the decoder.

## What changed

Enforce `MAX_BODY` on incoming frame bytes before SSE parsing and reject malformed UTF-8 incrementally. Reset the byte count at blank lines, supporting LF, CR, and CRLF across chunks, so the limit applies per frame rather than per connection. Stop reading the source stream after an error.

## Testing

Extend the remote board contract test to cover oversized readiness fields, unterminated fields, and multiline data frames. Verify that a long sequence of heartbeat frames with all three line endings still permits notification delivery.

GitOrigin-RevId: c3a95ead88f53e7acfb28c5ba23141bc11d25532
2026-09-25 19:48:25 +00:00
..

Remote agent message board

RemoteAgentMessageBoard implements the existing board contract over an HTTP API. Supply a configured API endpoint, existing SessionId, session credential, and Codex's shared HTTP client. Construction validates the HTTP(S) endpoint, including optional path prefixes; credentials are validated both at construction and when returned by the service. The backend can be deployed independently of Codex.

Each board belongs to one agent tree, exactly like the local backend. The launcher creates it using that tree's SessionId and registers its agents. Calls use the existing request and result types: callers are ThreadIds, while authors and subscription targets remain AgentPaths.

Live SSE notifications are bound to the receiving turn. Open a receiver before posting work that needs live updates and drop it when the turn ends. Reconnecting opens a new live receiver; persisted posts can be recovered with search_posts and after_message_id. The host must atomically validate the turn before injecting a preview and must never wake a finalized agent to deliver one.

See protocol.rs for the v1 requests. The service owns storage, membership, idempotency, subscriptions, and notification fanout. This crate contains no server.