[BUG] aimdb-mcp: get_buffer_metrics cannot find a record by its key

オープン 初心者向け
#453 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
api, backend

調査の方向性

まず tools/aimdb-mcp/src/tools/buffer_metrics.rs の41行目付近にあるフィルターを確認し、次に tools/aimdb-mcp/src/tools/profiling.rs の45行目付近にある対応するロジックと比較してください。キーがRust型名と異なるレコードのテストを追加するか、既存のテストを探してください。get_buffer_metrics がキーで検索したときにそのレコードを見つけ、テストが成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

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(&params.record_key))

get_stage_profiling takes the same parameter and already matches both fields (profiling.rs:45).

To Reproduce

  1. Run an instance with a record whose key differs from its type name, for example key motion.policy with type contracts::Policy.
  2. Call the MCP tool get_buffer_metrics with {"record_key": "motion.policy"}.
  3. 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.

主要言語
Rust
スター
101
フォーク
20
平均マージ
2時間 33分
マージ済み PR(30日)
90

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aimdb-dev/aimdb のほかの issue

aimdb-dev/aimdb の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。