Keep agent MCP transport across daemon restarts

This commit is contained in:
Meta Vens 2026-07-19 21:05:05 +01:00
commit bb74fc849f
8 changed files with 119 additions and 5 deletions

View file

@ -458,3 +458,4 @@
{"ts":"2026-07-16T16:01:14Z","type":"repair","status":"ok","note":"Agent Discord archive access failed because Codex launched a Starfire-local MCP process whose QDRANT_URL was loopback after the archive moved to Yggdrasil. Repo and global Codex MCP config now execute the stdio MCP server inside Ygg's worker container over SSH; Qdrant remains private. A real MCP client advertised 20 tools and search_history returned two archive hits."}
{"ts":"2026-07-19T14:58:00Z","type":"repair","status":"ok","note":"A raw SSH docker-exec MCP stream made every open agent task inherit the lifetime of Yggdrasil's replaceable worker container; an Idunn promotion therefore left tasks at Transport closed even after the new worker was healthy. Codex now attaches to a stable local stdio relay which opens one fresh remote MCP session per request. A real relay smoke advertised 20 tools, listed 52 indexed repositories, and returned a VoidBot source hit; direct history and source retrieval against Ygg also passed."}
{"ts":"2026-07-19T14:25:00Z","type":"architecture","status":"ok","note":"The per-call SSH MCP relay was identified as a transport compensator and deleted. The resident Yggdrasil worker now owns a loopback streamable-HTTP MCP organ injected with its existing archive repositories, source ingester, and retrieval service. The canonical workstation tunnel owns the sole Starfire crossing at 127.0.0.1:17875; Codex uses the URL and tool calls start no processes or alternate retrieval authorities."}
{"ts":"2026-07-19T20:10:00Z","type":"repair","status":"ok","note":"Direct Codex streamable-HTTP registration still closed permanently after a brief Idunn worker deployment or SSH-tunnel gap; stateless server sessions did not imply client transport recovery. Codex now attaches to a task-local stdio continuity bridge with no retrieval authority. Each tool call uses a lightweight HTTP client to the resident daemon, and the bridge lowers endpoint failure to a tool error. A single outer MCP client succeeded before a forced endpoint outage, received isError during the outage, and succeeded again after the same endpoint returned."}

View file

@ -225,7 +225,7 @@ accepted_design:
- Eve v2 live state has one owner path. CultLib dev supplies typed live-publication handles, authenticated retained provider sessions, reconnect evidence, and application receipts (`ebd8c78c`, `d4934233`, `8965f3c0`). Eve resolves component `stateBindings` and owns subscription teardown/rebind without receipt DOM writes (`85b0139`, `522df00`). Hermodr ingests provider sessions and emits ordered snapshot/update/stale/reconnected events without polling (`5cb819e`, `561e320`). VoidBot publishes accepted heat as typed control state and binds both visible heat components to it (`060da23`, `3d86b93`). Live-fire proved initial, provider-driven, and browser-command updates converge through that one path.
- `voidbot.swarm_operator_view.v1` is the live authority for swarm summary, queue, selected Face detail/channels, operations, pressure, pending mentions, recent events, and route state. Eve binds those values as text/list props; the composition renderer no longer computes those browser-visible facts from its generation snapshot. The static HTML artifact may still lower a snapshot for debugging, but it cannot own live browser state.
- The production Eve browser nerve is Starfire Chrome -> `http://10.77.0.1:8798` -> Hermodr on Yggdrasil -> Odin discovery and provider-owned VoidBot RUDP on Yggdrasil. Hermodr's browser listener is WireGuard-only, its authenticated retained-publication ingress is host-loopback `127.0.0.1:17874`, and VoidBot remains the state/command owner at `127.0.0.1:17873`. Starfire owns no Hermodr, Odin, or VoidBot deployment body.
- The resident Yggdrasil worker owns the streamable-HTTP MCP organ at loopback `127.0.0.1:17875/mcp` and injects its existing archive repositories, vector stores, and retrieval service into the MCP context. Codex reaches it at the same Starfire loopback port through the canonical Yggdrasil SSH tunnel. No agent tool call starts a process or opens a separate retrieval authority. Qdrant remains Yggdrasil-loopback-private; `scripts/smoke-voidbot-resident-mcp-http.mjs` proves the network MCP contract and real indexed-source retrieval.
- The resident Yggdrasil worker owns the streamable-HTTP MCP organ at loopback `127.0.0.1:17875/mcp` and injects its existing archive repositories, vector stores, and retrieval service into the MCP context. The canonical Yggdrasil SSH tunnel maps the same port to Starfire. Codex attaches to one task-local stdio bridge whose only authority is transport continuity: each tool request uses a fresh lightweight HTTP client to the resident daemon, daemon/tunnel outages become tool errors, and the outer Codex transport remains usable afterward. The bridge starts no SSH, Docker, or remote process and owns no retrieval state. `scripts/smoke-voidbot-mcp-bridge-recovery.mjs` proves success, outage-as-tool-error, and recovery on one unchanged outer client.
- Long-running work should expose durable logs or status files instead of relying on one attached session and hope.
- Persistent project memory must stay ruthlessly distilled; git history and artifacts carry routine proof.