From 6845852e827a266e4a1949b55e996086c1610693 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 24 Feb 2026 14:25:27 -0800 Subject: [PATCH] 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. --- agent/display.py | 4 ++-- tools/code_execution_tool.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/agent/display.py b/agent/display.py index 741933750..6ba02b59d 100644 --- a/agent/display.py +++ b/agent/display.py @@ -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}") diff --git a/tools/code_execution_tool.py b/tools/code_execution_tool.py index c58951fd6..d97597aa7 100644 --- a/tools/code_execution_tool.py +++ b/tools/code_execution_tool.py @@ -342,6 +342,10 @@ def execute_code( session_tools = set(enabled_tools) if enabled_tools else set() sandbox_tools = frozenset(SANDBOX_ALLOWED_TOOLS & session_tools) + # Temporary debug — remove after investigating + with open("/tmp/hermes_exec_debug.log", "a") as _dbg: + _dbg.write(f"enabled_tools={enabled_tools}\nsandbox_tools={sandbox_tools}\n---\n") + if not sandbox_tools: sandbox_tools = SANDBOX_ALLOWED_TOOLS