Unify TUI runtime commands with gateway and harden gateway restart

This commit is contained in:
William Valentin
2026-02-24 13:14:53 -08:00
parent db2f697741
commit 37be391a40
24 changed files with 1253 additions and 120 deletions
+1
View File
@@ -100,6 +100,7 @@ ChannelAdapter -> ChannelRegistry
| |
| +----> Runtime backend mode overrides
| (/runtime status|activate pi|deactivate pi|use config)
| (TUI `/runtime` is forwarded via gateway/daemon command path)
| |
| v
| SessionManager
@@ -12,6 +12,7 @@ If you only want the protocol surface, see `docs/api/PROTOCOL.md`.
- Sessions persist in SQLite via `SessionManager` even if clients disconnect.
- Once dequeued, message routing may execute the native orchestrator path or an optional external backend path (`claude_code`, `opencode`, `codex`, `gemini`, `pi_embedded`) depending on agent/backend config.
- Runtime backend mode can be overridden manually via `/runtime` command fast-path (`status`, `activate pi`, `deactivate pi`, `use config`) and is persisted in preferences (`/backend` remains a compatibility alias).
- `flynn tui` now attaches to this same gateway command path for `/runtime ...` and auto-starts/attaches daemon+gateway when needed.
- Backend routing outcomes are auditable via `backend.route` / `backend.success` / `backend.fallback`, which enables offline canary evaluation without changing gateway protocol methods.
## Component Map
@@ -24,6 +25,7 @@ flowchart LR
end
subgraph GW[Gateway Process]
TUI[TUI client\n(runtime command forwarding)]
WS[WebSocket connection\n(connectionId)]
GS[GatewayServer]
LQ[LaneQueue\nper-session FIFO]
@@ -37,6 +39,7 @@ flowchart LR
AO[AgentOrchestrator / External Backends]
end
TUI --> WS
WS --> GS
QP --> GS
BM --> GS