Repository navigation
Commit 374d3ed
fix(claude): pingdotgg#155 — isolate in-app agents from ambient MCP so harness tools reach them
Root cause (evidence-grade, captured from the real `claude` CLI invocation): the
per-turn ClaudeAdapter query loaded settingSources [user,project,local] with no
strictMcpConfig and no explicit mcpServers base, so the SDK ALSO merged the
operator's ambient MCP config — filesystem (~/.claude.json + project .mcp.json)
AND connected claude.ai servers (Gmail/Drive/Strava/...) — alongside the injected
devgame /mcp entry. Those ambient servers surfaced to in-app agents (a privacy
leak) AND crowded out the harness's own generate_3d / preview tools, so no harness
tool reached the agent (pingdotgg#155). The capability probe already isolates itself this
way (ClaudeProvider.buildClaudeCapabilitiesProbeQueryOptions); commit aa5ec80
(pingdotgg#4015) wired that isolation only to the probe, never to the real per-turn path.
Fix — mirror the probe's isolation on the real per-turn query:
- strictMcpConfig: true + env ENABLE_CLAUDEAI_MCP_SERVERS=false, UNCONDITIONAL for
every in-app Claude turn (privacy must not depend on whether devgame is injected).
- keep mcpServers:{devgame} additive when a harness session exists; add
alwaysLoad:true so its tools land in the turn-1 prompt instead of being deferred
behind tool-search.
- settingSources unchanged, so workspace commands / CLAUDE.md still work.
This is also a real privacy/security fix: the operator's personal MCP servers no
longer leak into in-app agents.
Guard (ClaudeAdapter.test.ts): two red-green tests — (1) with an mcpSession, the
query isolates + injects only devgame with alwaysLoad; (2) with NO mcpSession,
isolation still holds and no server is injected (the privacy property is
independent of harness injection). Both proven to go red when their lever is
removed. tsgo clean; ClaudeAdapter suite 70/70.
Verified structurally live: the real claude CLI invocation now carries
--strict-mcp-config (absent before the fix). The in-app generate_3d E2E on the
real desktop app remains the closing gate (standalone dev rig is auth-blocked by
OAuth contention, not fix-blocked).
Reviewed by an independent Opus pass (correct + mergeable); its two actionable
findings (unconditional privacy levers; alwaysLoad) are folded in. Sibling
adapters (Grok/Cursor/Codex/OpenCode) inject devgame without this isolation but
use array-style mcpServers — unverified, tracked separately.
Co-Authored-By: Claude Opus 4.8 <[email protected]>1 parent bae21a1 commit 374d3ed
2 files changed
Lines changed: 93 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| 276 | + | |
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
| |||
400 | 403 | | |
401 | 404 | | |
402 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
403 | 474 | | |
404 | 475 | | |
405 | 476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4195 | 4195 | | |
4196 | 4196 | | |
4197 | 4197 | | |
4198 | | - | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
| 4212 | + | |
| 4213 | + | |
| 4214 | + | |
4199 | 4215 | | |
4200 | 4216 | | |
4201 | 4217 | | |
4202 | 4218 | | |
| 4219 | + | |
| 4220 | + | |
| 4221 | + | |
| 4222 | + | |
4203 | 4223 | | |
4204 | 4224 | | |
4205 | 4225 | | |
4206 | 4226 | | |
4207 | 4227 | | |
4208 | 4228 | | |
4209 | 4229 | | |
| 4230 | + | |
4210 | 4231 | | |
4211 | 4232 | | |
4212 | 4233 | | |
| |||
0 commit comments