Skip to content

codegraph_index_markdown` overwrites previously indexed documents in v0.19.1 #16

Description

@finix7776

Environment

  • CodeGraph: 0.19.1
  • Build: ef6a466
  • Platform: macOS ARM64
  • Transport: MCP through a resident --serve engine and --connect client
  • Client: OpenAI Codex

Description

Indexing multiple Markdown files does not preserve all previously indexed
documents.

codegraph_index_markdown returns status: success, but after indexing another
file, previously indexed sources or chunks disappear from
codegraph_list_doc_sources and can no longer be found with
codegraph_search_docs.

The issue still occurs with only one resident CodeGraph engine and one connected
client. All VS Code CodeGraph processes were disabled before reproducing it.

Minimal reproduction

Create two files:

a.md

# Alpha

unique-alpha-marker

b.md

# Beta

unique-beta-marker

Then run:

  1. codegraph_index_markdown(path: "/tmp/a.md")
  2. codegraph_list_doc_sources()
  3. codegraph_index_markdown(path: "/tmp/b.md")
  4. codegraph_list_doc_sources()
  5. Search for both unique markers with codegraph_search_docs.

Actual behavior

After indexing the second file, sections belonging to the first file can
disappear.

The response also appears to generate chunk IDs starting again from
doc-0001 for every source. This may cause collisions between chunks from
different Markdown files.

Expected behavior

Indexing a new Markdown source should add its chunks without removing chunks
belonging to other sources.

Chunk identifiers should be unique across sources, for example by including a
source-path hash or another stable namespace.

Additional evidence

The server documentation says that re-indexing should replace data only for the
same source file. In this case, indexing a different source affects previously
indexed sources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions