Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#9143·oh-my-openagent

Session gateway: every session addressable through the endpoint registry; delete `omo daemon attach`

Author: code-yeongyuCreated Sep 29, 2026Updated Sep 29, 2026

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

  1. Start two standalone OmO terminal sessions (the default launch; no shared host).
  2. In session A call thread_list: session B is not listed (only host-resident sessions are), and listed rows show a UUID as name and 1970 timestamps.
  3. thread_send to a session known on disk with no live host returns not_resumable.
  4. omo daemon attach --json prints OMO_ENABLE_SHARED_HOST=1, i.e. it still advertises the join being removed.

Expected (ideal state)

  • IS-3 omo daemon keeps run/status/stop/handoff (+ --all/gc); attach is gone (an unknown subcommand); omo daemon adopt <session> parks a host-resident session and resumes it in the local TUI; docs/reference/omo-daemon.md and the CHANGELOG carry no shared-host opt-in.
  • IS-4 From any OmO session (TUI, Desktop thread, task child) thread_list shows every live OmO session on the machine - shard/host sessions AND standalone POSIX OmO TUI sessions - with kind, surface, a real name and real created_at/updated_at; thread_send/thread_read reach 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 through omo 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 an endpoint.json record enumerated by the engine's listHostEndpoints / 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 attach exists 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_id is not honored end to end; no binding store, relay API or outbox; no omo thread CLI.

Evidence (origin/dev)

  • packages/omo-native/bin/lib/daemon.js:31-39 (attach subcommand + usage), :80-84, :93-95 (attachEnv sets OMO_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:63 sets the shared-host env flags.
  • packages/omo-senpi/src/extension/thread-policy.test.ts still exists although its implementation was deleted (#8588).
  • CHANGELOG.md:540 and :3326 mention omo 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 leftover thread-policy.test.ts); attach answers as an unknown subcommand; add omo 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 status knows the tui kind.
  • omo thread CLI (sessions, bindings, send, read) for scripts and connectors.
  • Docs (thread/AGENTS.md, docs/reference/omo-daemon.md), changes.md, CHANGELOG.
  • Edits to daemon.js and the thread component land after the per-session host sharding PRs are on dev; 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 attach staying spawn-based.
  • code-yeongyu/senpi#2211 (closed) - related: measured host-loop stalls (the motivation).

Source: code-yeongyu/oh-my-openagent

View original on GitHubView discussion on GitHub