Repository navigation
docs(rfd): add durable & resumable HTTP/WS transport RFD - #2208
Open
alexhancock wants to merge 1 commit into
Open
alexhancock wants to merge 1 commit into
alexhancock wants to merge 1 commit into
Conversation
alexhancock
force-pushed
the
rfd-durable-resumable-http-transport
branch
from
September 23, 2026 15:48
dd813c7 to
fc269b3
Compare
alexhancock
force-pushed
the
rfd-durable-resumable-http-transport
branch
from
October 13, 2026 19:23
fc269b3 to
c077bd6
Compare
4 tasks done
CSRessel
added a commit
to tilework-tech/nori-cli
that referenced
this pull request
Nov 23, 2026
…ansport (#717) ## Summary 🤖 Generated with [Nori](https://noriagentic.com/) **Stack** (review and merge in this order): #712 → #713 → #714 → #715 → #716 → **#717** → #718 → #719 → #720 → #721 (draft). Base: `feat/exec-oneshot-attach`. Makes multi-session the only mode, removes the TUI's legacy single-controller remote surface, and serves the host's multi-session ACP v1 face over the ACP remote transport at `/acp`. - **`[features] multi_session` is removed; multi-session is always on.** That means: - `/new`, `/agent` and `/resume` start beside the current session, which keeps running in the background. - `/sessions` and `/delegate` are always offered. - The session-move hotkeys are always active and always listed. - `[tui] max_sessions` always applies. - Delegation is always available to sessions the session manager runs. - `nori attach` no longer needs the flag. A stale `multi_session` key in `config.toml` is ignored (`[features]` does not deny unknown keys; verified with a real config). - **Removed: the TUI's legacy single-controller remote surface.** The unauthenticated `/acp` the interactive TUI served (`acp-host` `connection.rs`, `wire.rs`, `hosted_agent.rs`, `bind`/`bind_many*`), `--remote` / `--remote-allow-nonloopback`, `/remote-control`, the harness `HarnessRemoteHost`, the `nori.remoteControl` initialize-marker recognizer, and request-scoped cancel. The TUI opens no listener. - **New: `nori host` serves ACP over the remote transport.** One background host accepts any number of clients at once (up to `[host] max_clients`, default 16) over WebSocket `/acp` (the RFD path; `/sessions` stays as an alias), `nori attach`, and stdio — all reaching the same sessions. - Same bearer token as `host.json`; `401` before the upgrade. Loopback bind only; cross a network boundary with a TLS-terminating front (`wss://`). `host.json`/`state.json` now publish `ws://127.0.0.1:<port>/acp`. - Every upgrade carries `Acp-Connection-Id`; binary frames are ignored; JSON-array batches get `-32600` with `id: null`; a non-upgrade request gets `426`. - Past the limit: `503` with a message naming the limit and `[host] max_clients`. A full host still answers `nori host` with "already running", and `nori host stop` falls back to SIGTERM. - A client disconnecting never ends sessions; reconnect = new `initialize` + `session/load` (history, then live) or `session/resume` (live only). Pending permission requests are asked again of the controller. - **stdio joins the shared host:** `nori host --stdio` / `nori exec --acp` (without `--agent`, `-c`, `--add-dir` or bypass) relay to the home's running host when its `initialize` reply gives the client control (or the client asked to `observe`); otherwise they fall back to a private in-process host as before (also on a stale `host.json`). Replies to already-forwarded requests are still copied after stdin EOF. - **Fix (exposed by always-on session tagging):** cloud `/close` now shows the "Session closed (released)." confirmation on the picker screen that replaces the session. - **Fix (in #715, rebased in):** the host publishes `host.json` before `state.json`. **Unchanged:** managed mode (`[host] managed = true`): it serves `/sessions` + `/managed`, publishes `/sessions`, has no client limit, no `/acp`, and `nori host --stdio --launch` is untouched. ## ACP remote transport RFDs - Accepted (Draft stage, merged via [agent-client-protocol#721](agentclientprotocol/agent-client-protocol#721)): https://agentclientprotocol.com/rfds/streamable-http-websocket-transport - Open, reconnect/resume and resiliency: agentclientprotocol/agent-client-protocol#2208 ("Durable & resumable HTTP/WS transport") - Related stable v1: `session/resume` https://agentclientprotocol.com/protocol/v1/session-setup#resuming-sessions , `session/list` https://agentclientprotocol.com/protocol/v1/session-list | RFD requirement | Here | |---|---| | Single `/acp` endpoint | ✅ `/acp`; `/sessions` alias | | WebSocket upgrade, `101` + `Acp-Connection-Id` | ✅ | | `initialize` first | ✅ (`-32001`, close) | | One JSON-RPC message per text frame; binary ignored | ✅ | | No batches (`-32600`, `id: null`) | ✅ | | Streamable HTTP profile (POST/SSE/DELETE, `Acp-Session-Id`, HTTP/2) | ⏸ deferred — RFD lets servers be WebSocket-only and requires clients to support WebSocket | | Auth layered on top | ✅ `Authorization: Bearer` (host.json token); no query/subprotocol token | | Sessions survive disconnect; reconnect via `session/load` | ✅ (+ standard `session/resume`) | | In-flight messages not replayed (v1) | ✅ same | | Cookies (sticky routing) | n/a — one process | | Limits / TLS / Origin / bind | not in RFD → `max_clients` 503; loopback-only + TLS front | | Open RFD #2208: cursors (`_meta["acp/cursor"]`, SSE `id:`), `Last-Event-ID` / `stream/resume`, `transport.resumable`, keepalive, `state_update`/`acp/turnState`, grace period | ⏸ deferred to the durable-sessions design; no new `_nori` method or `_meta` key | **RFD conflict:** its WebSocket section says the server cleans up a connection's sessions on disconnect; its v1 durability section says sessions survive. The host follows the latter (also the host contract's "host outlives every client"). ## Extension names (checked against `docs/acp-extensions.md`) | Name | Change | |---|---| | `nori.remoteControl` (legacy TUI `/acp` `initialize` `_meta`) | removed with that surface | | No `_nori/*` method or `nori/*` `_meta` key added or changed | — | `Acp-Connection-Id` is the RFD's header, not a Nori extension. `x-nori-host-instance` is unchanged. ## Decisions for clifford - Streamable HTTP is not implemented (see table). Worth it only if a client must cross a proxy that blocks WebSocket. - `nori host --stdio` now joins the running host by default (same rule as one-shot `nori exec`), instead of always being private. Monorepo contract §4.2 is updated in the companion docs PR. - Controller is still host-wide: an editor over stdio and an attached TUI contend for one controller; a stdio client that cannot get control gets a private host. - Single-session-only TUI behavior is gone (unchanged from the earlier version of this PR): "Preparing <agent>…" line, the new-session usage summary, `/agent` killing the previous agent. ## Test Plan - [x] New black-box `cli/tests/host_lifecycle/remote_transport.rs`: `/acp` and `/sessions` reach the same sessions and discovery publishes `/acp`; unique `Acp-Connection-Id`; 401 on missing/wrong token on both paths; binary ignored + batch refused; client limit 503 (auth first, freed slot reused); a full host reports running and stops; a session stays live after its creator disconnects; resume after reconnect does not replay. - [x] `cli/tests/host_stdio.rs`: stdio joins the running host and its session outlives it; stdio gets its own host while another client controls; piped requests all answered after EOF; stale `host.json` falls back. - [x] `cargo test --no-fail-fast -p nori-cli -p nori-acp-host -p nori-config`, `-p nori-harness --test managed_remote`, `-p nori-tui attach`, `-p tui-pty-e2e --test host_attach` pass locally. - [x] Nightly fmt and clippy on touched crates. Originating chat: https://demo.norisessions.com/chat/01a205b3-9091-7031-8379-bb0e358460fe Originating chat: https://demo.norisessions.com/chat/01a20674-5488-77cd-8f80-863b9c69ac74 --------- Co-authored-by: Nori <contact@tilework.tech>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A followup from the original Streamable HTTP/WS Transport spec, this RFD adds durability and semantics for reconnection/resumption of activity over a remote transport.
We specifically noted we would specify these things here: https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/streamable-http-websocket-transport.mdx#durability-and-reliability-expectations and this is the RFD that does so.