Skip to content

feat: [AI-7392] humanize tool-call titles at the source#980

Open
ralphstodomingo wants to merge 2 commits into
mainfrom
feat/AI-7392-tool-title-labels
Open

feat: [AI-7392] humanize tool-call titles at the source#980
ralphstodomingo wants to merge 2 commits into
mainfrom
feat/AI-7392-tool-title-labels

Conversation

@ralphstodomingo

@ralphstodomingo ralphstodomingo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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"
  • non-file / rich-title tools (sql_analyze → "Analyze: 2 issues [high]", bash → its description) are unchanged.

How

  • src/altimate/tool-label.tsdescribeToolCall(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 existing execute() wrapper rewrites result.title for 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 render state.title verbatim 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).
  • E2E: built this branch's binary, ran it under altimate serve in 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.title directly. Addresses Linear AI-7392 by making file-tool labels dbt-aware and readable (e.g., "Reading customers model").

  • New Features

    • Rewrites result.title in the Tool.execute() wrapper for consistent labels.
    • Adds describeToolCall(tool, input, rawTitle) in packages/opencode/src/altimate/tool-label.ts to humanize file tools (read, write, edit, multiedit, glob, grep, list) with dbt-aware targets; falls back to the filename off-dbt.
    • Adds tests in packages/opencode/test/altimate/tool-label.test.ts covering dbt naming, glob/grep/list, passthrough, and fallbacks; updates packages/opencode/test/tool/write.test.ts to expect "Writing " labels.
  • Migration

    • Clients should render state.title as-is and remove any custom title logic.

Written for commit 9e1853e. Summary will update on new commits.

Review in cubic

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.
@ralphstodomingo ralphstodomingo self-assigned this Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d3e6e321-9dc3-4f33-9aca-1c5cc2a20592

📥 Commits

Reviewing files that changed from the base of the PR and between f0fb1e1 and 9e1853e.

📒 Files selected for processing (4)
  • packages/opencode/src/altimate/tool-label.ts
  • packages/opencode/src/tool/tool.ts
  • packages/opencode/test/altimate/tool-label.test.ts
  • packages/opencode/test/tool/write.test.ts
 _______________________________________
< Uniformly random comments incoming... >
 ---------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/AI-7392-tool-title-labels

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ralphstodomingo

Copy link
Copy Markdown
Contributor Author

Paired chat-webview change (renders the humanized state.title from this PR): AltimateAI/vscode-altimate-mcp-server#388

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.
@ralphstodomingo ralphstodomingo marked this pull request as ready for review July 2, 2026 02:58
Copilot AI review requested due to automatic review settings July 2, 2026 02:58

@claude claude 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant