MCP: cache config in McpManager, add exponential backoff to McpClient reconnect
McpManager:
- Cache loaded configs in self._configs (loaded once at load_all)
- resolve_group() and get_instructions() read from cache instead of disk
- reload_all() busts the cache before re-reading
- Fallback to disk when cache is empty (tests / first call without load_all)

McpClient:
- Exponential backoff on reconnect: base 1s, max 30s, ±20% jitter
- Backoff resets on successful connect, doubles on failure
- _ensure_connected() blocks reconnect if within backoff window
- Prevents thundering herd against a flapping MCP server

392 passed, 1 skipped

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5ef365c commit b46faabe8cd7b73455b2f9b95f9fffacc148ef16
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 18 May
Showing 2 changed files
View
navi/mcp/client.py
View
navi/mcp/manager.py