# Startup latency, prompt cache stability and tool snapshots Status: accepted ## Context Startup should be fast, yet the system prompt must stay cache-stable. Slow MCP servers and model list fetches would delay it. ## Decision - Model catalog: stale-while-revalidate; any cached list starts immediately, an expired one refreshes in the background. - MCP servers get a short grace period so fast ones land in the (cache-stable) startup prompt; slow ones connect in the background. - The tool snapshot for `task` subagents and codemode is taken after every other tool (MCP, lens, task) is registered; children get the parent's tools as of then, without `task` (no recursion), and codemode is not callable inside itself. ## Consequences Late-connecting servers do not appear in the startup prompt. Code: crates/hx-cli/src/main.rs (model catalog loader, run/startup MCP wait, subagent and codemode tool registration)