fix(cli): clarify hook reminder guidance

Clarify the Codex/Gemini/Antigravity SessionStart reminder so it recommends graph tools before broad grep for structural code discovery instead of implying they replace file reads. Spell out that auto-indexing uses the MCP server CWD or explicit repo paths when enabled, and add a focused Codex hook regression assertion for the wording.

Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
This commit is contained in:
Andrew Hundt
2026-07-01 20:40:19 -04:00
parent 34db7cf044
commit a64f7eac28
2 changed files with 6 additions and 2 deletions
+3 -2
View File
@@ -1639,8 +1639,9 @@ int cbm_remove_codex_mcp(const char *config_path) {
* and NO newlines. (issues #330 + Gemini/Antigravity parity) */
#define CMM_SESSION_REMINDER_CMD \
"echo \"Code discovery: prefer codebase-memory-mcp (search_graph, trace_path, " \
"get_code, query_graph, search_code) over grep/file-read; graph-backed tools " \
"auto-index CWD or explicit repo paths when auto_index=true and under " \
"get_code, query_graph, search_code) before broad grep for structural code " \
"discovery; graph-backed tools auto-index the MCP server CWD or explicit repo " \
"paths when auto_index=true and under " \
"auto_index_limit; search_code needs an indexed project; call _hidden_tools " \
"for explicit index_repository.\""
+3
View File
@@ -1783,6 +1783,9 @@ TEST(cli_codex_session_hook_issue330) {
ASSERT(strstr(d, "[[hooks.SessionStart]]") != NULL);
ASSERT(strstr(d, "[[hooks.SessionStart.hooks]]") != NULL);
ASSERT(strstr(d, "search_graph") != NULL);
ASSERT(strstr(d, "before broad grep for structural code discovery") != NULL);
ASSERT(strstr(d, "MCP server CWD") != NULL);
ASSERT(strstr(d, "grep/file-read") == NULL);
ASSERT(strstr(d, "[mcp_servers.other]") != NULL); /* pre-existing content preserved */
/* Idempotent: a second upsert leaves exactly ONE hook block. */
ASSERT_EQ(cbm_upsert_codex_hooks(cfg), 0);