refactor: update failure message handling in display module and add debug logging in code execution tool
- Modified the `_wrap` function to append a failure suffix without applying red coloring, simplifying the failure message format. - Introduced temporary debug logging in the `execute_code` function to track enabled and sandbox tools, aiding in troubleshooting.
This commit is contained in:
parent
99af12af3f
commit
6845852e82
2 changed files with 6 additions and 2 deletions
|
|
@ -310,10 +310,10 @@ def get_cute_tool_message(
|
|||
return ("..." + p[-(n-3):]) if len(p) > n else p
|
||||
|
||||
def _wrap(line: str) -> str:
|
||||
"""Apply red coloring and failure suffix when the tool failed."""
|
||||
"""Append failure suffix when the tool failed."""
|
||||
if not is_failure:
|
||||
return line
|
||||
return f"{_RED}{line}{failure_suffix}{_RESET}"
|
||||
return f"{line}{failure_suffix}"
|
||||
|
||||
if tool_name == "web_search":
|
||||
return _wrap(f"┊ 🔍 search {_trunc(args.get('query', ''), 42)} {dur}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue