writeMCPConfigFile writes to disk via node:fs, but the capability system's readFile (capability/fs.ts) caches file contents in an in-memory Map. When /mcp reauth writes a new credential ID to the config file and then #reloadMCP calls discoverAndConnect, the builtin provider's readFile hits the stale cache and returns the old config — causing the connection to use the old (deleted) credential ID and fail with HTTP 401 missing_token. Fix: call invalidateFsCache(filePath) after the atomic rename in writeMCPConfigFile so subsequent loadCapability reads see fresh content.
@oh-my-pi/pi-coding-agent
Core implementation package for the omp coding agent in the oh-my-pi monorepo.
For installation, setup, provider configuration, model roles, slash commands, and full CLI reference, see:
Package-specific references: