Session gateway: every session addressable through the endpoint registry; delete `omo daemon attach`
Summary
Make every live OmO session on a machine addressable from every other one through the engine's endpoint registry (a "session gateway"), and delete omo daemon attach, whose only job is to print the opt-in env for the experimental interactive shared-host join that the engine is removing (code-yeongyu/senpi#2328).
Motivation: interactive sessions that joined one shared host all ran on that host's single event loop, so one session's heavy tool call (for example an eval cell) stalled every other attached session for 10-20 s (see code-yeongyu/senpi#2211, up to 19 s measured).
Today the cross-session thread tools see only sessions that live on a multi-session host (the legacy socket and the p-*/i-* shards); a standalone terminal session - the common case - cannot be listed, read or messaged. Cross-session messages are journaled in the SENDER's working directory, so they die with the sender, and there is no connector-neutral way to bind a session to an external chat thread.
Tracking cluster: engine side code-yeongyu/senpi#2328, Desktop side code-yeongyu/omo-desktop-app#1272.
Reproduction
- Start two standalone OmO terminal sessions (the default launch; no shared host).
- In session A call
thread_list: session B is not listed (only host-resident sessions are), and listed rows show a UUID asnameand 1970 timestamps. thread_sendto a session known on disk with no live host returnsnot_resumable.omo daemon attach --jsonprintsOMO_ENABLE_SHARED_HOST=1, i.e. it still advertises the join being removed.
Expected (ideal state)
- IS-3
omo daemonkeepsrun/status/stop/handoff(+--all/gc);attachis gone (an unknown subcommand);omo daemon adopt <session>parks a host-resident session and resumes it in the local TUI;docs/reference/omo-daemon.mdand the CHANGELOG carry no shared-host opt-in. - IS-4 From any OmO session (TUI, Desktop thread, task child)
thread_listshows every live OmO session on the machine - shard/host sessions AND standalone POSIX OmO TUI sessions - withkind,surface, a realnameand realcreated_at/updated_at;thread_send/thread_readreach a standalone TUI session through its own control endpoint, with the TUI still running in its own process. Excluded by design: stdio single-session hosts and Windows TUIs (POSIX gateway; win32 keeps contract tests). - IS-5 A session can be attached to an external thread (connector-neutral:
platform,account_id,chat_id,thread_id) and detached/rebound with idempotent, revisioned operations; inbound platform messages enter throughomo thread send --binding; milestones/reports/questions/completion go to a durable outbox any connector drains; a relayed question can only be answered through the binding that emitted it. - IS-6 Cross-session messages are durable (SQLite journal + receipts survive the SENDER's exit), ordered per target, loop-safe (causal-root cycle refusal, hop <= 4, per-pair token bucket, per-turn fan-out cap), workspace-scoped by default, never interrupt what the receiving user is typing (draft present => queued; an explicit steer never edits the draft), and never claim exactly-once after a lost ACK (
idempotency_uncertain, no blind resend). - IS-7 One registry: every endpoint (TUI,
p-*,i-*, legacy) is anendpoint.jsonrecord enumerated by the engine'slistHostEndpoints/host status --all;omo daemon status, the thread tools, the Desktop and the CLI read that one list. No second registry, no resident router process, no flag.
Actual
omo daemon attachexists and emits the shared-host opt-in env.- Thread tools address only host-resident sessions; mailbox and receipts live under the sender's
<cwd>/.omo/thread-tools/;expected_turn_idis not honored end to end; no binding store, relay API or outbox; noomo threadCLI.
Evidence (origin/dev)
packages/omo-native/bin/lib/daemon.js:31-39(attachsubcommand + usage),:80-84,:93-95(attachEnvsetsOMO_ENABLE_SHARED_HOST: "1"),:232-237(attach passthrough).packages/omo-native/test/daemon.test.ts:151-163,:248-285(attach cases).docs/reference/omo-daemon.md:8,17-18,28,225(attach and the opt-in env documented).script/qa/dependency-audit/runtime.ts:63sets the shared-host env flags.packages/omo-senpi/src/extension/thread-policy.test.tsstill exists although its implementation was deleted (#8588).CHANGELOG.md:540and:3326mentionomo daemon attach/ the opt-in (historical entries stay; the release note for the removal goes under Removed).- Thread tools state dir:
packages/omo-senpi/src/components/thread/live-surface.ts:263(<cwd>/.omo/thread-tools),tools.ts:51(mailbox under it),tools.ts:199(delivery call site).
Root cause
The thread tools were built on the assumption that peer sessions live on a shared host; once the interactive join was made opt-in (and now removed), the sessions users actually run are invisible to them. Delivery state was scoped to the sender process rather than to a machine-level store, and omo daemon attach was the CLI face of the removed join.
Scope + acceptance criteria
- Delete
omo daemon attach(code, tests, docs, QA env flags, the leftoverthread-policy.test.ts);attachanswers as an unknown subcommand; addomo daemon adopt <session>. - Gateway library in the thread component: SQLite store for journal/receipts/bindings/outbox outside the sender's cwd; delivery engine with the IS-6 guards; bindings + outbox (IS-5).
- Thread tools enumerate every endpoint kind through the engine's registry with real metadata (IS-4, IS-7);
omo daemon statusknows thetuikind. -
omo threadCLI (sessions, bindings, send, read) for scripts and connectors. - Docs (
thread/AGENTS.md,docs/reference/omo-daemon.md),changes.md, CHANGELOG. - Edits to
daemon.jsand the thread component land after the per-session host sharding PRs are ondev; adopt the engine release carrying code-yeongyu/senpi#2328 first.
Related
- code-yeongyu/senpi#2328 - engine tracking issue (removal +
endpoint_kind: "tui"). - code-yeongyu/omo-desktop-app#1272 - Desktop tracking issue.
- #7459 - obsoleted by this removal (the shared interactive host hides TUI cache hit, cost, goal and resumed state).
- #9003 (closed) - related: per-session RPC host sharding; this work builds on its registry and
status --all. - #8585 (closed) / #8588 - related: thread tools registered unconditionally; left the orphaned
thread-policy.test.ts. - #9061 - related-but-separate: stalls of the host for task children; the task host stays.
- #8560 (closed) - related: CHANGELOG line about
omo daemon attachstaying spawn-based. - code-yeongyu/senpi#2211 (closed) - related: measured host-loop stalls (the motivation).
Source: code-yeongyu/oh-my-openagent