feat: MCP client identity + memory diagnostics (#37)#192
Conversation
- Extract clientInfo.name from MCP initialize params, store in Session - codedb_status now reports: outlines, contents_cached, trigram_index type (heap/mmap/mmap+overlay), file count, and index_memory in KB - Update serverInfo version to 0.2.54 - Fix handleSnapshot that was accidentally deleted during edit Generated with Claude Code Co-Authored-By: Claude <claude@anthropic.com>
Benchmark Regression ReportThreshold: 10.00%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7488f8b25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const file_count = store.files.count(); | ||
| store.mu.unlock(); | ||
|
|
||
| const index_bytes = telemetry_mod.approxIndexSizeBytes(explorer); |
There was a problem hiding this comment.
Hold explorer read lock while sizing indexes
handleStatus calls telemetry_mod.approxIndexSizeBytes(explorer) before acquiring explorer.mu.lockShared(). That helper iterates mutable index/hash-map structures, so a concurrent writer (initial/background scan or file watcher updates that take the write lock) can mutate those containers mid-iteration and trigger undefined behavior or crashes during codedb_status. The existing recordCodebaseStats path already wraps this same helper under explorer.mu.lockShared(), so this unlocked call is a regression in thread-safety.
Useful? React with 👍 / 👎.
Summary
MCP client identity (#37)
clientInfo.namefrom MCPinitializeparamsSession.client_namefor future agent identity useMemory diagnostics in codedb_status
Inspired by fff.nvim's health reporting.
codedb_statusnow returns:Shows: outline count, cached content count, trigram index type (heap/mmap/mmap+overlay), indexed file count, and approximate index memory in KB.
Other
handleSnapshotthat was accidentally deletedTest plan
Closes #37