You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mail must wake the agent — in all cases, without the agent needing to check its inbox.
That disqualifies poll_inbox / c2c poll-inbox as a delivery guarantee for any client: they require the model to choose to look. A mechanism only counts as a wake if an external event pushes the message into the agent's attention.
The problem with how we do it today
Every wake path is a separate, per-client, mostly unsupervised process, and each one is its own single point of failure:
Inverse leak — notifier daemons outlive their sessions (one observed polling since Jul 18) because teardown is per-alias and best-effort.
N clients × per-alias daemons means N× the things that can die, each needing its own supervision, teardown, staleness detection, and doctor check.
Proposal — a machine-wide delivery service
One supervised, machine-wide singleton that owns delivery for every local session, with per-client endpoint adapters. Clients (or their managed launchers) register their delivery endpoint with it; the service watches the broker and pushes each message to the right endpoint.
Registration would carry what the adapter needs, e.g.:
Kimi → local REST base URL + session id (discovered from ~/.kimi-code/session_index.jsonl) + bearer
Codex → app-server WebSocket + thread id
agy → agentapi endpoint
OpenCode → deliver-watch/sidecar target
Why this shape:
We already have the pattern in-repo. The relay connector is a machine-wide supervised singleton with a machine lock and self-heal (B200/B235, c2c start relay-connect, ocaml/cli/c2c_relay_managed.ml). Reuse it rather than inventing new infra — one supervised thing to keep alive, restart, and diagnose.
The broker is already the machine-wide rendezvous for sessions and mail; endpoint registration is a natural extension of registration we already do (alias, session_id, client_type, cwd, pid).
Reaping comes for free. A service that knows every registered endpoint can drop watchers for sessions that are gone — which is exactly the inverse-leak fix, instead of a separate reaper.
One doctor surface. Today delivery health is checked per-client (kimi DEAF, codex delivery mode, grok drift); a single service gives one honest "is this session reachable?" answer.
Clients needing wrapping converge. Codex, Kimi and agy all need an external process to reach them; that's the same job three times.
Scope / open questions
Lifecycle: who starts it — c2c install, first c2c start <client>, or on demand? How does it survive a reboot (systemd --user is a portability tradeoff; the relay-connect supervisor pattern is the in-repo alternative).
Registration transport: extend broker registration, or a separate endpoints table?
What "guaranteed" means operationally, and the failure modes that remain (host off, client's own server down, session id unresolvable, agent mid-turn).
Must preserve B098 "bus, never RPC": delivery stays DATA-only; a message may never authorize an action or resolve an approval.
Related
#9 (Kimi notifier arming — the immediate reliability patch), #27 (managed Codex silently deaf), #31 (degraded signal overwritten), #12 (pre-startup backlog visibility). A design pass covering per-client wake-path inventory + this singleton is in progress.
The requirement
Mail must wake the agent — in all cases, without the agent needing to check its inbox.
That disqualifies
poll_inbox/c2c poll-inboxas a delivery guarantee for any client: they require the model to choose to look. A mechanism only counts as a wake if an external event pushes the message into the agent's attention.The problem with how we do it today
Every wake path is a separate, per-client, mostly unsupervised process, and each one is its own single point of failure:
POST /api/v1/sessions/{id}/prompts)C2c_kimi_notifierfork+setsid daemon — unsupervisedthread/inject_items+ gated auto-turnc2c monitorConsequences we have actually hit:
Proposal — a machine-wide delivery service
One supervised, machine-wide singleton that owns delivery for every local session, with per-client endpoint adapters. Clients (or their managed launchers) register their delivery endpoint with it; the service watches the broker and pushes each message to the right endpoint.
Registration would carry what the adapter needs, e.g.:
~/.kimi-code/session_index.jsonl) + bearerWhy this shape:
c2c start relay-connect,ocaml/cli/c2c_relay_managed.ml). Reuse it rather than inventing new infra — one supervised thing to keep alive, restart, and diagnose.kimi DEAF,codex delivery mode,grok drift); a single service gives one honest "is this session reachable?" answer.Scope / open questions
c2c install, firstc2c start <client>, or on demand? How does it survive a reboot (systemd--useris a portability tradeoff; the relay-connect supervisor pattern is the in-repo alternative).C2c_kimi_notifierpidfile/sidfile lifecycle (see kimi notifier strands pre-startup inbox backlog (silent for senders) #9 — the alias-keyed state vs session-id-keyed inbox asymmetry is load-bearing there).Related
#9 (Kimi notifier arming — the immediate reliability patch), #27 (managed Codex silently deaf), #31 (degraded signal overwritten), #12 (pre-startup backlog visibility). A design pass covering per-client wake-path inventory + this singleton is in progress.