Skip to content

fix(delegate): tool_trace false-positive error detection for short outputs - #26442

Closed
ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/ISSUE-26369-delegate-tool-trace-false-positive
Closed

ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/ISSUE-26369-delegate-tool-trace-false-positive

Conversation

@ms-alan

@ms-alan ms-alan commented May 15, 2026

Copy link
Copy Markdown
Contributor

Closes #26369

Bug

The logic in flagged successful tool calls as errors when their output was short JSON containing . The heuristic matched the JSON key itself within the first 80 chars.

Fix

Replace the substring heuristic with the existing function, which properly checks:

  • JSON key is truthy (null/false/empty strings don't trigger)
  • JSON field for error/failed/timeout
  • First-line error markers (error:, traceback, exception:, failed:)

Testing

Verified against the existing test suite in .

…f substring heuristic

The old heuristic 'error' in content[:80] flagged false positives for
short JSON outputs like {"output":"test","error":null} — the 'error' key
with a null value landed within the first 80 chars and was misread as
an error status. Replace with the existing _looks_like_error_output()
function which properly checks truthiness of the error field, status
field, and first-line markers.

Closes NousResearch#26369
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/delegate Subagent delegation labels May 15, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

Duplicate of #26374 — identical fix for tool_trace false-positive error detection in delegate_tool.py. That PR is already open and in review.

@teknium1

Copy link
Copy Markdown
Collaborator

Closing as duplicate — #26374 by @flooryyyy lands the same exact diff (replacing the brittle "error in first 80 chars" check with the existing _looks_like_error_output helper) and was filed ~2 hours earlier. Going with that one for attribution; the fix is correct in both. Thanks for catching the same bug independently.

@teknium1 teknium1 closed this May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants