feat: [AI-7392] humanize tool-call titles at the source#980
feat: [AI-7392] humanize tool-call titles at the source#980ralphstodomingo wants to merge 2 commits into
Conversation
Rewrite each tool's state.title in the execute() wrapper so any client (chat webview, TUI, ...) can render a readable label straight from state.title — e.g. "Reading customers model" for a dbt model read, "Searching **/*.sql" for a glob. File-acting tools get a gerund verb plus a dbt-aware target (model/seed/macro, degrading to the filename off-dbt); every other tool keeps the rich title it already emits.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Paired chat-webview change (renders the humanized |
The execute() wrapper now humanizes file-tool titles at the source, so the write tool's title is "Writing <file>" rather than the raw relative path. Update the assertion accordingly.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
What
Tool calls now carry a readable, dbt-aware title at the source, so any client that renders
state.title(the chat webview, TUI, future surfaces) shows a descriptive label without re-implementing the logic:read models/customers.sql→ "Reading customers model"glob **/*.sql→ **"Searching /*.sql"edit models/staging/stg_customers.sql→ "Editing stg_customers model"sql_analyze→ "Analyze: 2 issues [high]",bash→ its description) are unchanged.How
src/altimate/tool-label.ts—describeToolCall(tool, input, rawTitle). File-acting tools get a gerund verb + a friendly target; dbt naming (model/seed/macro/…) is applied only when the path sits under the matching directory, degrading to the plain filename off-dbt. Everything else returns the tool's own title.src/tool/tool.ts— one line in the existingexecute()wrapper rewritesresult.titlefor every tool. No per-tool edits, so no upstream-merge surface.Why here
This replaces client-side humanizing (previously prototyped in the chat webview) with a single source of truth in the harness, per review feedback. The chat webview (
vscode-altimate-mcp-server) is being simplified to renderstate.titleverbatim and depends on this.Testing
bun test test/altimate/tool-label.test.ts— 6 cases (dbt naming, filename fallback, glob/grep/list, passthrough, no-path fallback).altimate servein code-server with the state.title-only webview — confirmed "Reading customers model" etc. render (the webview no longer humanizes, so the label can only come from here).🤖 Generated with Claude Code
Summary by cubic
Humanizes tool-call titles at the source so clients can render
state.titledirectly. Addresses Linear AI-7392 by making file-tool labels dbt-aware and readable (e.g., "Reading customers model").New Features
result.titlein theTool.execute()wrapper for consistent labels.describeToolCall(tool, input, rawTitle)inpackages/opencode/src/altimate/tool-label.tsto humanize file tools (read,write,edit,multiedit,glob,grep,list) with dbt-aware targets; falls back to the filename off-dbt.packages/opencode/test/altimate/tool-label.test.tscovering dbt naming, glob/grep/list, passthrough, and fallbacks; updatespackages/opencode/test/tool/write.test.tsto expect "Writing " labels.Migration
state.titleas-is and remove any custom title logic.Written for commit 9e1853e. Summary will update on new commits.