feat: advertise one-shot context/explain/callpath/list_dir/status - #701
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d398a79413
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .codedb_query => handleQuery(alloc, args, out, ctx.explorer, ctx.store), | ||
| .codedb_glob => handleGlob(alloc, args, out, ctx.explorer), | ||
| .codedb_ls => handleLs(alloc, args, out, ctx.explorer), | ||
| .codedb_list_dir => mcp_list_dir.handle(io, alloc, getStr(args, "path") orelse ".", project_path orelse cache.default_path, out), |
There was a problem hiding this comment.
Bypass snapshot loading for live directory listings
When project points to a different unindexed directory, this handler is never reached: dispatch first calls cache.get, which requires a loadable snapshot and returns SnapshotLoadFailed. This breaks the advertised use case of listing unindexed trees via the tool's project field; handle codedb_list_dir before the project cache lookup while retaining the root/path validation in listUnder.
Useful? React with 👍 / 👎.
| var call_out: std.ArrayList(u8) = .empty; | ||
| defer call_out.deinit(alloc); | ||
| handleCallers(alloc, args, &call_out, explorer); |
There was a problem hiding this comment.
Expose the caller limit on codedb_explain
For symbols with more than 30 call sites, this delegates to handleCallers without setting max_results, so the supposedly one-shot result silently stops at that handler's default of 30. Unlike codedb_callers, the new tool schema and CLI aliases provide no supported way to raise the limit, which can hide affected callers during impact analysis; expose and forward max_results or clearly report that more sites exist.
Useful? React with 👍 / 👎.
| const cap: usize = 24 * 1024; | ||
| const def_text = if (def_out.items.len > cap) def_out.items[0..cap] else def_out.items; | ||
| const call_text = if (call_out.items.len > cap) call_out.items[0..cap] else call_out.items; |
There was a problem hiding this comment.
Preserve a truncation notice in explain output
When a definition rendering exceeds 24 KiB, this byte slice removes the explicit elision notice that handleSymbol only adds at its own 32 KiB body cap and can also omit later matching definitions. The response then presents an abruptly cut definition as complete, potentially even splitting a UTF-8 character; truncate at a valid boundary and append a clear continuation/elision notice.
Useful? React with 👍 / 👎.
Default agent
tools/list(CODEDB_TOOLS_PROFILE=mini) now advertises five one-shots instead of the hop six:codedb_context— task-shaped orientationcodedb_explain— definition body + callers (explain/aroundCLI)codedb_callpath— shortest A→B (pathalias)codedb_list_dir— live BFS listing (wired from the existing module)codedb_status— index healthHop tools (
symbol/callers/search/outline/ …) still dispatch; they are just not the opening menu. Codex policy and MCP instructions steer the same way.Sister graff PR (v0.0.269 line): justrach/codegraff#597