Option to name a session's project (an index made with `name` is never watched)

Aberta
#3,021 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
c

Direção de pesquisa

Start with cbm_mcp_server_set_session_context and detect_session in src/mcp/mcp.c, then trace how index_repository handles its name option and how the session watcher selects a project. The issue proposes an environment variable, CBM_SESSION_PROJECT, normalized like name; compare that behavior with the current path-derived name. Done means a session can watch and refresh the index created under the chosen name, while an unset option preserves current behavior.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug editor/integration enhancement parsing/quality ux/behavior

index_repository takes name, but a session's project is always the name derived from its root path (cbm_mcp_server_set_session_context and detect_session, src/mcp/mcp.c). When a checkout was indexed under a chosen name, a session started in that checkout still follows the path's name: the watcher registers a project that has no index and never refreshes the named one, so edits made during the session do not reach the graph.

Measured on v0.12.1: a function added to the checkout shows up in search_graph about 15 s later when the index has the path's name, and not at all (90 s) when the same index was built with name.

We choose the name because the path-derived one is repeated in every qualified name. One repository of ours indexes to 918 MB under the name derived from a 150-character checkout path and to 367 MB under a 13-character name.

Could a session take its project name from an option? We run a small patch that reads an environment variable, CBM_SESSION_PROJECT, in those two functions and normalizes it the way name is normalized; unset, nothing changes. With it the watcher follows and refreshes the named index. We can open a pull request if that shape is acceptable.

Developed with the aid of AI under human supervision.

Linguagem predominante
C
Estrelas
45.8k
Forks
3.8k
Merge médio
2d 18h
PRs com merge (30d)
108

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de DeusData/codebase-memory-mcp

Todas as issues de DeusData/codebase-memory-mcp

Issues semelhantes

Mais issues de C

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.