index_repository(async=true): while indexing is queued/running, list_projects returns empty and read tools return misleading "No projects indexed yet. Call index_repository first."

オープン
#3,132 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c, sqlite

調査の方向性

Start by reading the project lookup and error handling at src/mcp/mcp.c:2852, then trace how index_repository records queued and running jobs and how list_projects checks indexed projects. Reproduce with a fresh cache and an asynchronous index job, then check the read tool and project list responses while it runs. Done when they identify indexing as in progress and direct callers to poll status.

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

説明

bug parsing/quality ux/behavior
Version

codebase-memory-mcp 0.12.1 (built from source at 9a4da7a3; also verified unchanged on main d5e39e5a, src/mcp/mcp.c:2852)

Platform

Linux (x64)

Install channel

Built from source

Binary variant

standard

What happened, and what did you expect?

When index_repository is started with "async": true on a fresh cache directory and is still queued or running:

  1. list_projects returns total: 0 with "hint": "No projects indexed. Call index_repository(repo_path=...) first." without indicating an active indexing job.
  2. Read tools such as get_graph_schema fail with "error": "project not found or not indexed" and "hint": "No projects indexed yet. Call index_repository first." (src/mcp/mcp.c:2852), even though index_repository(status=true) simultaneously reports the same project as running.

Expected: while an async index job for a project is queued or running, read tools (and/or list_projects) should report that indexing is currently in progress and direct callers to poll index_repository(repo_path=..., status=true) instead of claiming no projects have been indexed and telling them to call index_repository again.

Reproduction
  1. Code: a small synthetic C repository in /tmp/probe-repo (large enough that mode: "full" stays queued/running for a moment, e.g., ~200 small .c files).
  2. MCP calls on a fresh CBM_CACHE_DIR:
    • Call 1 — list_projects:
      {"format": "json"}
      
      Output: {"projects":[],"total":0,"offset":0,"limit":50,"returned":0,"has_more":false,"hint":"No projects indexed. Call index_repository(repo_path=...) first."}
    • Call 2 — index_repository:
      {"repo_path": "/tmp/probe-repo", "name": "probe-async-pre", "mode": "full", "async": true}
      
      Output: {"project":"probe-async-pre","state":"queued","async":true,"joined":false,"poll":"call index_repository with the same repo_path and status: true until state is succeeded, failed or cancelled"}
    • Call 3 (immediately after Call 2) — get_graph_schema:
      {"project": "probe-async-pre", "format": "json"}
      
      Actual output (isError: true):
      {"error":"project not found or not indexed","hint":"No projects indexed yet. Call index_repository first."}
      
    • Call 4 (immediately after Call 3) — index_repository:
      {"repo_path": "/tmp/probe-repo", "name": "probe-async-pre", "status": true}
      
      Output: {"project":"probe-async-pre","state":"running","async":true,...,"poll":"call again with status: true until state is succeeded, failed or cancelled"}
  3. Expected for Call 3: an in-progress hint (e.g., noting that "probe-async-pre" is currently queued/running and suggesting index_repository(..., status=true)).
Logs
Call 2 response: {"project":"probe-async-pre","state":"queued","async":true,"joined":false,"poll":"call index_repository with the same repo_path and status: true until state is succeeded, failed or cancelled"}
Call 3 response (isError=true): {"error":"project not found or not indexed","hint":"No projects indexed yet. Call index_repository first."}
Call 4 response: {"project":"probe-async-pre","state":"running","async":true,"poll":"call again with status: true until state is succeeded, failed or cancelled"}
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.
主要言語
C
スター
45.8k
フォーク
3.8k
平均マージ
2日 18時間
マージ済み PR(30日)
108

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

DeusData/codebase-memory-mcp のほかの issue

DeusData/codebase-memory-mcp の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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