mcp: advertise cached tools at spawn + reconcile cache on connect (#206 Phase 2)
Wire the schema cache into session MCP registration so MCP tools are visible from the very first turn with zero provider prompt-cache miss in the common (warm-cache) case. - Advertise-early: before spawning the background connect task, `register_mcp_tools` loads the disk schema cache and synchronously registers proxy tools for every configured server that has cached schemas matching its current config. These land in the first locked tool snapshot, so the model sees MCP tools immediately and the connect-on-first-call proxy handles actual invocation. An McpStatus event reflects the advertised counts right away. - Reconcile: after the background connection completes, the live schemas are written back to the cache (per-server, under the current fingerprint) and servers no longer configured are pruned, so the next spawn advertises an up-to-date set. Live registration re-registers proxies idempotently, refreshing any drifted schema. - Cold start / reconfigured servers (no matching cache entry) fall back to the existing post-connect registration plus the one-shot late-register rebuild, which now fires at most once.
J
jeremy committed
a0a335c656286ef332673656c8c810a33dc9e6f5
Parent: 573e9b1