fix(cli): improve description extraction for toolsets

- Updated the description extraction logic to split on ". " (period+space) to avoid breaking on abbreviations like "e.g." or version numbers.
- Changed the method to prioritize the first line of the description, ensuring more relevant information is captured for display.
This commit is contained in:
teknium1 2026-02-26 12:11:32 -08:00
parent 760fb2ca0e
commit bf9dd83c10

6
cli.py
View file

@ -1088,8 +1088,10 @@ class HermesCLI:
if toolset not in toolsets:
toolsets[toolset] = []
desc = tool["function"].get("description", "")
# Get first sentence or first 60 chars
desc = desc.split(".")[0][:60]
# First sentence: split on ". " (period+space) to avoid breaking on "e.g." or "v2.0"
desc = desc.split("\n")[0]
if ". " in desc:
desc = desc[:desc.index(". ") + 1]
toolsets[toolset].append((name, desc))
# Display by toolset