don't log exit code !=0 as terminal failure

This commit is contained in:
hjc-puro 2025-11-17 18:39:16 -05:00
parent 1614c15bb1
commit ab7293bed6

View file

@ -98,10 +98,9 @@ def _extract_tool_stats(messages: List[Dict[str, Any]]) -> Dict[str, Dict[str, i
# Terminal wraps its response in a "content" field # Terminal wraps its response in a "content" field
if "content" in content_json and isinstance(content_json["content"], dict): if "content" in content_json and isinstance(content_json["content"], dict):
inner_content = content_json["content"] inner_content = content_json["content"]
# Check for actual error (non-null error field or non-zero exit code) # Check for actual error (non-null error field)
has_error = (inner_content.get("error") is not None or # Note: non-zero exit codes are not failures - the model can self-correct
inner_content.get("exit_code", 0) != 0) if inner_content.get("error") is not None:
if has_error:
is_success = False is_success = False
# Check for "success": false pattern used by some tools # Check for "success": false pattern used by some tools