fix: resolve 3 community-reported bugs (#2915, #2917, #2918)

- background_output: snapshot read cursor before consuming, restore on
  /undo message removal so re-reads return data (fixes #2915)
- MCP loader: preserve oauth field in transformMcpServer, add scope/
  projectPath filtering so local-scoped MCPs only load in matching
  directories (fixes #2917)
- runtime-fallback: add 'reached your usage limit' to retryable error
  patterns so quota exhaustion triggers model fallback (fixes #2918)

Verified: bun test (4606 pass / 0 fail), tsc --noEmit clean
This commit is contained in:
YeonGyu-Kim
2026-03-29 04:53:36 +09:00
parent 9fc56ab544
commit b2497f1327
16 changed files with 575 additions and 6 deletions
@@ -10,6 +10,7 @@ import type {
} from "./types"
import { transformMcpServer } from "./transformer"
import { log } from "../../shared/logger"
import { shouldLoadMcpServer } from "./scope-filter"
interface McpConfigPath {
path: string
@@ -75,6 +76,7 @@ export async function loadMcpConfigs(
const loadedServers: LoadedMcpServer[] = []
const paths = getMcpConfigPaths()
const disabledSet = new Set(disabledMcps)
const cwd = process.cwd()
for (const { path, scope } of paths) {
const config = await loadMcpConfigFile(path)
@@ -86,6 +88,15 @@ export async function loadMcpConfigs(
continue
}
if (!shouldLoadMcpServer(serverConfig, cwd)) {
log(`Skipping MCP server "${name}" because local scope does not match cwd`, {
path,
projectPath: serverConfig.projectPath,
cwd,
})
continue
}
if (serverConfig.disabled) {
log(`Disabling MCP server "${name}"`, { path })
delete servers[name]