Skip to content

T-CPJI-host-send-deliver-a-message-into-an-already-open-session

State: closed/done · Impact: high · Complexity: medium

Today’s host contract only opens sessions (session()) or terminals (terminal()); nothing can deliver a message into a session that is already running. This is the gap the Router (M-27ZR) needs closed before it can route PR feedback into a live session instead of always opening a new one.

  1. Add a send part to the host contract (lib/services/host/contract.ts) per simple-dispatch-interfaces.html’s Host section: send(target, message) into a live terminal.
  2. Implement it for hosts that can support it first (orca via its session/paste API, tmux via send-keys), leaving hosts with no live-input surface (bare terminal) to report the part as absent via requirePart.
  3. Add a per-harness nativeSend fallback distinct from the host-level send (Router step 2 in simple-dispatch-interfaces.html), so the Router can try harness-level native delivery when the host has no send part.
  4. Add tests exercising send against a fixture session.
AreaNote
solutions/ontological/lib/services/host/contract.tsNew send part
solutions/ontological/lib/services/host/hosts/orca.tssend implementation
solutions/ontological/lib/services/host/hosts/tmux.tssend implementation (pairs with T-5UT9)
solutions/ontological/lib/services/host/engines.tsPer-harness nativeSend
  • AC-1 (refined — “smoke test” replaced per this campaign’s no-real-process testing rule): Host.send delivers a string against a fake CommandRunner for both orca (orca terminal send) and tmux (send-keys), asserting the exact argv sent, for a fixture session — no real orca/tmux process is started. Verified: hosts.test.ts’s orca/tmux send describe blocks.
  • AC-2: A host without a send part is reported via requirePart, not a silent no-op. Verified: hosts.test.ts’s terminal/cmux requirePart(host, 'send') test.
  • AC-3: A harness-level nativeSend is callable independently of host send, unit-tested against a fake runner. Verified: harnessNativeSend tests (codex real argv + non-zero-exit; claude/cursor/pi all null).
  • AC-4 (added): the Router’s existing live route (dispatch/router.ts’s attemptLive) is rewired to call Host.send instead of its own hardcoded spawnLive('orca') + bespoke orca terminal send argv — proven by a router.test.ts case showing the live route now also succeeds for a tmux-hosted session, which the old orca-only implementation could never reach. Verified: router.test.ts’s tmux-hosted live test, run against the real makeTmuxHost.
  • the Router’s fallback chain deciding when to call send vs. resume vs. open (T-BT9H)
  • status hooks (T-UU2N)
  • T-GG0N

T-GG0N


← Back to Tasks