diff --git a/workspace/executor_helpers.py b/workspace/executor_helpers.py index 3343dee5..b594c159 100644 --- a/workspace/executor_helpers.py +++ b/workspace/executor_helpers.py @@ -620,7 +620,9 @@ def sanitize_agent_error( # a malicious or buggy peer injecting a huge error body, and # scrubs any API keys / bearer tokens that snuck into the message. detail = _sanitize_for_external(stderr[:_MAX_STDERR_PREVIEW]) - return f"Agent error ({tag}): {detail}" + if category: + return f"Agent error ({tag}): {detail}" + return f"Agent error: {detail}" return f"Agent error ({tag}) — see workspace logs for details."