Skip to content

feat: advertise one-shot context/explain/callpath/list_dir/status - #701

Merged
justrach merged 1 commit into
release/0.2.5842from
cursor/oneshot-surface-1a17
Aug 21, 2026
Merged

feat: advertise one-shot context/explain/callpath/list_dir/status#701
justrach merged 1 commit into
release/0.2.5842from
cursor/oneshot-surface-1a17

Conversation

@justrach

Copy link
Copy Markdown
Owner

Default agent tools/list (CODEDB_TOOLS_PROFILE=mini) now advertises five one-shots instead of the hop six:

  • codedb_context — task-shaped orientation
  • codedb_explain — definition body + callers (explain / around CLI)
  • codedb_callpath — shortest A→B (path alias)
  • codedb_list_dir — live BFS listing (wired from the existing module)
  • codedb_status — index health

Hop 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/mcp.zig
.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),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/mcp.zig
Comment on lines +2682 to +2684
var call_out: std.ArrayList(u8) = .empty;
defer call_out.deinit(alloc);
handleCallers(alloc, args, &call_out, explorer);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/mcp.zig
Comment on lines +2686 to +2688
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@justrach
justrach merged commit 021d5bc into release/0.2.5842 Aug 21, 2026
2 checks passed
justrach added a commit that referenced this pull request Aug 21, 2026
list_dir BFS (#697) and one-shot advertised surface (#701).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant