You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codegraph_explore tells a fresh subagent that source was "already sent" to a different context #1620
codegraph_explore's cross-call dedup replaces already-served source with an "Already sent earlier in this conversation … Use it from your context; do NOT Read this file" pointer. The already-sent record is kept per MCP connection, but one connection is not always one agent context:
Subagents (Claude Code): subagents dispatch tool calls over the parent's MCP connection. A fresh subagent exploring a file the parent already received gets the pointer instead of the source — wrong on both counts: the source is not in its context, and it's told not to Read the file. There is no in-tool recovery; re-querying hits the same suppression, so the subagent falls back to Read/grep (or worse, answers without the source).
Compaction: after the host compacts the conversation, the context no longer holds the already-sent source, but the server's record still does — subsequent explores return pointers to text that is gone until the connection restarts.
Reproduction
In Claude Code, run any codegraph_explore that returns a file's source.
Spawn a subagent (Task tool) and have it explore the same symbols.
The subagent's very first explore returns > **Already sent earlier in this conversation:** … Do NOT Read this file.
Compaction variant: explore, /compact, explore the same symbols again — same pointer, source no longer in context.
Why it matters
The pointer is designed to be trusted ("that copy is still exact"). When it points at source the current context never had, the agent either reads the file anyway (defeating dedup and teaching it to distrust codegraph) or proceeds without source it believes it has.
Codex is unaffected on the subagent side (each thread gets its own MCP server process), but the compaction case applies to every host whose connection outlives a compact.
PR:#1788 Approach: landed upstream #1624 (@danusha2345) — make explore cross-call dedup opt-in via CODEGRAPH_EXPLORE_DEDUP=1. Default is now re-serve, so shared MCP connections (Claude Code subagents) and post-compaction contexts never get Already sent… Do NOT Read pointers to source they never held.
Not used: draft #1621 (session buckets + installer hooks) — correct direction for keeping dedup on with host lifecycle hooks, but draft / no clean merge-base with current main; the opt-in default fixes both cases without that infrastructure.
Activity
colbymchenry commentedon Sep 8, 2026
Fix landed (Linux verified)
PR: #1788
Approach: landed upstream #1624 (@danusha2345) — make explore cross-call dedup opt-in via
CODEGRAPH_EXPLORE_DEDUP=1. Default is now re-serve, so shared MCP connections (Claude Code subagents) and post-compaction contexts never getAlready sent… Do NOT Readpointers to source they never held.Not used: draft #1621 (session buckets + installer hooks) — correct direction for keeping dedup on with host lifecycle hooks, but draft / no clean merge-base with current
main; the opt-in default fixes both cases without that infrastructure.Linux fail → pass
main7be699cdCODEGRAPH_EXPLORE_DEDUPunset →exploreDedupEnabled() === truef9fe7e5afalse;npx vitest run __tests__/explore-cross-call-dedup.test.ts→ 26 passed;tsc --noEmitcleanClosing as fixed by #1788.
fix(mcp): land #1624 opt-in explore dedup (#1788)