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:
codegraph_index_markdown(path: "/tmp/a.md")
codegraph_list_doc_sources()
codegraph_index_markdown(path: "/tmp/b.md")
codegraph_list_doc_sources()
- 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.
Environment
--serveengine and--connectclientDescription
Indexing multiple Markdown files does not preserve all previously indexed
documents.
codegraph_index_markdownreturnsstatus: success, but after indexing anotherfile, previously indexed sources or chunks disappear from
codegraph_list_doc_sourcesand can no longer be found withcodegraph_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.mdb.mdThen run:
codegraph_index_markdown(path: "/tmp/a.md")codegraph_list_doc_sources()codegraph_index_markdown(path: "/tmp/b.md")codegraph_list_doc_sources()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-0001for every source. This may cause collisions between chunks fromdifferent 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.