Skip to content

codegraph_explore tells a fresh subagent that source was "already sent" to a different context #1620

Description

@AtkinsChang

Describe the bug

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:

  1. 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).
  2. 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

  1. In Claude Code, run any codegraph_explore that returns a file's source.
  2. Spawn a subagent (Task tool) and have it explore the same symbols.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions