feat(cli): /tools lists every tool available in this session#231
Merged
emal-avala merged 1 commit intomainfrom Apr 23, 2026
Merged
feat(cli): /tools lists every tool available in this session#231emal-avala merged 1 commit intomainfrom
emal-avala merged 1 commit intomainfrom
Conversation
Adds /tools — a slash command that prints every tool currently registered on the active query engine. Complements /skills (which lists the user-authored .md skill surface) and /help (which lists slash commands, not tools). Why this exists: users troubleshooting 'the agent didn't call the tool I expected' have no way to confirm which tools are actually available — they have to read source or guess from error messages. /tools closes that gap in one shot. Output is alphabetized for stable diffing across sessions; each row is `<name> <one-line description>`, with descriptions whitespace- collapsed to one line and clipped at 120 chars so rows stay readable in any terminal width. Implementation: - New `pub fn tools(&self) -> &ToolRegistry` accessor on QueryEngine so CLI surfaces can introspect the registry without knowing engine internals - execute_tools helper in commands/mod.rs that sorts + renders - Two new pure helpers (render_tool_summary, clip_summary) kept testable without needing an engine Tests: 5 new - render_tool_summary collapses \n and \t whitespace to single spaces - render_tool_summary pads the name column to 22 chars for alignment - clip_summary passes short strings through unchanged - clip_summary truncates long strings with a trailing … - clip_summary respects char (not byte) boundaries for multi-byte glyphs
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
/tools— a slash command that prints every tool currently registered on the active query engine.Complements:
/skills— lists the user-authored.mdskill surface/help— lists slash commands, not toolsWhy this exists: users troubleshooting "the agent didn't call the tool I expected" have no way to confirm which tools are actually available — they have to read source or guess from error messages.
/toolscloses that gap in one shot.Example
Output is alphabetized for stable diffing across sessions. Each row is
<name> <one-line description>, with descriptions whitespace-collapsed to one line and clipped at 120 chars so rows stay readable in any terminal width.Implementation
pub fn tools(&self) -> &ToolRegistryaccessor onQueryEngineso CLI surfaces can introspect the registry without knowing engine internalsexecute_toolshelper incommands/mod.rsthat sorts + rendersrender_tool_summary,clip_summary) kept testable without needing an engineTest plan
cargo clippy --workspace --tests --no-deps -- -D warnings— cleancargo test -p agent-code --bin agent commands::tests::render_tool_summary— 2/2 passcargo test -p agent-code --bin agent commands::tests::clip_summary— 3/3 pass5 new tests:
render_tool_summarycollapses/whitespace to single spacesrender_tool_summarypads the name column to 22 chars for alignmentclip_summarypasses short strings through unchangedclip_summarytruncates long strings with a trailing…clip_summaryrespects char (not byte) boundaries for multi-byte glyphs