Skip to content

search_graph name_pattern misses indexed Class nodes found by BM25 query #481

@thaoula

Description

@thaoula

Version

codebase-memory-mcp 0.8.1

Platform

macOS (Apple Silicon)

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

standard

What happened, and what did you expect?

search_graph with name_pattern does not return indexed class nodes that are returned by BM25 query.

Example from a TypeScript/Angular repo:

BM25 query works:

{
  "project": "example-project",
  "query": "ExampleDialogService",
  "label": "",
  "name_pattern": "",
  "limit": 20
}

Returns:
ExampleDialogService
label: Class
file_path: src/app/services/example-dialog.service.ts

But regex name search returns no results:
{
  "project": "example-project",
  "query": "",
  "label": "",
  "name_pattern": ".*ExampleDialogService.*",
  "limit": 20
}
Result:
total: 0

A broader regex also missed expected classes:
"name_pattern": ".*Dialog.*Service.*"

Expected behavior:
- name_pattern should match the indexed Class node by name.
- If name_pattern intentionally searches a different field/scope than BM25, the tool docs or response hint should make that clear.

Impact:
- Agents fall back to grep even though the symbol graph contains the class.
- This makes structural discovery unreliable for class/service inventory tasks.

### Reproduction

- search_graph(query="WorkBuddyDialogService") finds WorkBuddyDialogService as Class
- search_graph(name_pattern=".*WorkBuddyDialogService.*") returns 0
- Same issue with broader .*Dialog.*Service.*

### Logs

```text

Project scale (if relevant)

No response

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions