Skip to content

fix(summarizer): isolate MCP servers and settings in summarizer subprocess#107

Open
madorb wants to merge 1 commit into
obra:mainfrom
madorb:fix/summarizer-isolate-mcp
Open

fix(summarizer): isolate MCP servers and settings in summarizer subprocess#107
madorb wants to merge 1 commit into
obra:mainfrom
madorb:fix/summarizer-isolate-mcp

Conversation

@madorb
Copy link
Copy Markdown

@madorb madorb commented Jun 2, 2026

What

The background summarizer (summarizer.tsbuildSummarizerQueryOptions) runs each archived conversation through the Claude Agent SDK with resume + the conversation's cwd. The SDK loads all filesystem settings by default, so every summarization boots the user's entire global MCP server set — one MCP fleet spawned per conversation. MCP servers that open a GUI (e.g. Serena's web dashboard) pop a window per conversation; the rest start and tear down silently, churning CPU/RAM. With a backlog of N conversations, a single SessionStart sync fans out to N × (whole MCP fleet).

Same root mechanism as #83 (resume → full Claude Code session subprocess) and the MCP-config analog of #104 (summarizer inheriting global env).

Change

Two options added to the summarizer's query():

  • settingSources: [] — the SDK's documented isolation mode ("Pass [] to disable filesystem settings (SDK isolation mode)"). This is the actual leak: the option is currently omitted, and the SDK docs note that when omitted, all sources are loaded.
  • mcpServers: {} — makes the empty server set explicit.

A summarizer needs no tools or MCP servers. This sits alongside the existing persistSession: false isolation (#83).

Testing

  • npm run build — clean (tsc + esbuild).
  • npm test — 209 passed. One unrelated failure: a beforeEach hook timeout in search-metadata-filters from a cold embedding-model load exceeding the 10s hook limit (not touched by this change; later tests in that same file pass).
  • Added 3 assertions to test/summarizer-options.test.ts covering settingSources: [] and mcpServers: {} on both fresh and resumed option builds.

Notes

  • Rebuilt dist/ for the changed module (dist/summarizer.js, dist/summarizer.d.ts), per CLAUDE.md.
  • Left the unrelated dist/version.* / dist/mcp-server.js version-string drift (committed 1.4.1 vs package.json 1.4.2) untouched to keep this PR focused on the fix.

Fixes #106

…ocess

The background summarizer runs each archived conversation through the
Claude Agent SDK with resume + the conversation's cwd. The SDK loads all
filesystem settings by default, so each summarization booted the user's
entire global MCP fleet — one set of MCP server subprocesses per
conversation. Servers that open a GUI (e.g. Serena's web dashboard) pop a
window per conversation; the rest start and tear down silently, churning
CPU/RAM. With a backlog of N conversations, one SessionStart sync fans
out to N x (whole MCP fleet).

Pass settingSources: [] (the SDK's documented isolation mode) and
mcpServers: {} so the summarizer subprocess loads no filesystem settings
or MCP servers. A summarizer needs neither.

Fixes obra#106

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Summarizer SDK subprocesses inherit the full global MCP server set — one MCP fleet spawned per conversation (GUI windows + resource churn)

1 participant