[BUG] aimdb-mcp: get_buffer_metrics cannot find a record by its key
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start with tools/aimdb-mcp/src/tools/buffer_metrics.rs at the filter around line 41, then compare it with the matching logic in tools/aimdb-mcp/src/tools/profiling.rs around line 45. Add or locate a test for a record whose key differs from its Rust type name. Done means get_buffer_metrics finds that record when queried by its key, with the test passing.
Written by the indexing model from the issue text.
Description
Describe the bug
get_buffer_metrics takes a record_key, but it only matches that value against the record's Rust type name. When a record's key differs from its type name, querying by the real key returns found: false, even though the record exists.
The filter is in buffer_metrics.rs:41:
.filter(|r| r.name.contains(¶ms.record_key))
get_stage_profiling takes the same parameter and already matches both fields (profiling.rs:45).
To Reproduce
- Run an instance with a record whose key differs from its type name, for example key
motion.policywith typecontracts::Policy. - Call the MCP tool
get_buffer_metricswith{"record_key": "motion.policy"}. - The tool replies:
{
"found": false,
"message": "No records matching this key were found in the running instance.",
"record_key": "motion.policy"
}
Expected behavior
The tool finds the record by its key, as get_stage_profiling does. The fix is to match r.record_key as well as r.name, with a test where the two differ.
Environment
- OS: macOS 13 (Darwin 22.6)
- Rust Version: rustc 1.98.0
- AimDB Version: main at d9c7be0
Additional context
Seen against a host gateway over a Unix socket. The target instance may also be built without the metrics feature, but the lookup fails before that matters.
- Dominant language
- Rust
- Stars
- 101
- Forks
- 20
- Avg merge
- 2h 33m
- Merged PRs (30d)
- 90
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aimdb-dev/aimdb
-
🏷️ good first issue enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
dependencies
Difficulty 4/5 3-5 days Newbie friendliness 44/100
Maintainers usually reply within 1 day
Similar issues
-
Panic on live viewport resize when unstyled elements exist in display: none subtreePossibly taken @GoCoder7 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DioxusLabs/blitz#1488 ·
Maintainers usually reply within 1 day
-
S-Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
vectordotdev/vrl#2042 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day