Skip to content

fix(workflow-ui): clamp long tool descriptions in the tool picker - #392

Merged
michaeltrefry merged 1 commit into
mainfrom
claude/tool-picker-desc-clamp
May 14, 2026
Merged

michaeltrefry merged 1 commit into
mainfrom
claude/tool-picker-desc-clamp

Conversation

@michaeltrefry

Copy link
Copy Markdown
Owner

Summary

The shared cf-tool-picker rendered each tool's full catalog description. Catalog entries like apply_patch carry a multi-paragraph spec (~864px tall), so the node-overrides tools picker — which lists the entire host + MCP catalog — became dominated by description text.

Clamp descriptions to 2 lines with a show more / show less toggle. Only descriptions long enough to actually be truncated (>140 chars or multi-line) get the clamp + toggle; short one-liners (echo, now) still render in full with no toggle. Per-tool expanded state, keyed by tool identifier.

Also benefits the agent-role editor — it uses the same picker.

Test plan

  • ng build clean
  • In-browser (node-overrides Overrides tab, host tools group):
    • echo / now — short, render plain, no toggle
    • read_file / run_command — under threshold, wrap naturally, no toggle
    • apply_patch / vcs.open_pr — clamped to 2 lines (38px) with a show more toggle
    • clicking show more on apply_patch expands 38px → 864px, label flips to show less, re-collapse returns to 38px

🤖 Generated with Claude Code

The shared cf-tool-picker rendered each tool's full catalog description.
Catalog entries like apply_patch carry a multi-paragraph spec (~864px tall),
so the node-overrides tools picker — which lists the whole host + MCP catalog
— became unusable, dominated by description text.

Clamp descriptions to 2 lines with a "show more" / "show less" toggle. Only
descriptions long enough to actually be truncated (>140 chars or multi-line)
get the clamp + toggle; short one-liners (echo, now) render in full as
before. Per-tool expanded state, keyed by tool identifier.

Benefits the agent-role editor too — it uses the same picker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@michaeltrefry
michaeltrefry merged commit d99aab9 into main May 14, 2026
2 checks passed
@michaeltrefry
michaeltrefry deleted the claude/tool-picker-desc-clamp branch May 14, 2026 18:42
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