Skip to content

feat: MCP client identity + memory diagnostics (#37)#192

Merged
justrach merged 1 commit intomainfrom
feat/edit-consistency-and-config
Apr 7, 2026
Merged

feat: MCP client identity + memory diagnostics (#37)#192
justrach merged 1 commit intomainfrom
feat/edit-consistency-and-config

Conversation

@justrach
Copy link
Copy Markdown
Owner

@justrach justrach commented Apr 7, 2026

Summary

MCP client identity (#37)

  • Extracts clientInfo.name from MCP initialize params
  • Stores in Session.client_name for future agent identity use
  • Foundation for multi-client conflict detection

Memory diagnostics in codedb_status

Inspired by fff.nvim's health reporting. codedb_status now returns:

codedb status:
  seq: 84
  files: 84
  outlines: 84
  contents_cached: 84
  trigram_index: mmap (84 files)
  index_memory: 6586KB

Shows: outline count, cached content count, trigram index type (heap/mmap/mmap+overlay), indexed file count, and approximate index memory in KB.

Other

  • Fixed handleSnapshot that was accidentally deleted
  • Updated serverInfo version to 0.2.54

Test plan

  • All tests pass (zero leaks)
  • Live MCP test confirms new status fields
  • Pre-push benchmarks pass

Closes #37

- 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>
@justrach justrach merged commit c561c2e into main Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Benchmark Regression Report

Threshold: 10.00%

Tool Base (ns) Head (ns) Delta Status
codedb_bundle 642255 656198 +2.17% OK
codedb_changes 107675 109861 +2.03% OK
codedb_deps 30324 31162 +2.76% OK
codedb_edit 20494 41515 +102.57% FAIL
codedb_find 141199 140868 -0.23% OK
codedb_hot 160665 170689 +6.24% OK
codedb_outline 413014 416085 +0.74% OK
codedb_read 168530 174067 +3.29% OK
codedb_search 261494 260461 -0.40% OK
codedb_snapshot 3922377 3899865 -0.57% OK
codedb_status 256794 253491 -1.29% OK
codedb_symbol 63620 65148 +2.40% OK
codedb_tree 99290 104861 +5.61% OK
codedb_word 93353 91673 -1.80% OK

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add real MCP client identity instead of hardcoding all edits to agent 1

1 participant