fix(agent): address code review findings for tool hint enhancement

- C1: Fix IndexError on empty list arguments via _get_args() helper
- I1: Remove redundant branch in _fmt_known
- I2: Export abbreviate_path from nanobot.utils.__init__
- I3: Fix _abbreviate_url negative-budget format consistency
- S1: Move FORMATS to class-level _TOOL_HINT_FORMATS constant
- S2: Add list_dir to FORMATS registry (ls path)
- G1-G5: Add tests for empty list args, None args, URL edge cases,
  mixed folding groups, and list_dir format
This commit is contained in:
chengyongru
2026-04-07 15:15:07 +08:00
committed by Xubin Ren
parent b1d3c00deb
commit 3e3a7654f8
5 changed files with 107 additions and 23 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
"""Utility functions for nanobot."""
from nanobot.utils.helpers import ensure_dir
from nanobot.utils.path import abbreviate_path
__all__ = ["ensure_dir"]
__all__ = ["ensure_dir", "abbreviate_path"]