fix(tool_hints): pass max_length to abbreviate_path for is_path tools
The is_path branch in _fmt_known was not passing max_length to abbreviate_path, so read_file, write_file, edit, list_dir, and web_fetch always truncated paths at 40 chars regardless of config. Now all three branches (is_path, is_command, fallback) honor the configured toolHintMaxLength.
This commit is contained in:
1 parent
67875d7a15
commit
99209a806d
2 files changed
+22
-1
No files matched your search
@@ -86,7 +86,7 @@ def _fmt_known(tc, fmt: tuple, max_length: int = 40) -> str:
|
||||
if val is None:
|
||||
return tc.name
|
||||
if fmt[2]: # is_path
|
||||
val = abbreviate_path(val)
|
||||
val = abbreviate_path(val, max_len=max_length)
|
||||
elif fmt[3]: # is_command
|
||||
val = _abbreviate_command(val, max_len=max_length)
|
||||
return fmt[1].format(val)
|
||||
|
||||
Reference in new issue
Block a user