mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
don't log exit code !=0 as terminal failure
This commit is contained in:
parent
1614c15bb1
commit
ab7293bed6
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue