Skip to content

Harden tool result failure detection for status/error contract#5516

Open
Vaughan-g-aus wants to merge 1 commit into
NousResearch:mainfrom
Vaughan-g-aus:fix/material-purchase-status-guard
Open

Harden tool result failure detection for status/error contract#5516
Vaughan-g-aus wants to merge 1 commit into
NousResearch:mainfrom
Vaughan-g-aus:fix/material-purchase-status-guard

Conversation

@Vaughan-g-aus

Copy link
Copy Markdown

Context

Addressed a bug where caller-layer tool handling could treat structured non-ok outputs as success for job-manager material_purchase and other flows.

Changes

  • agent/display.py: _detect_tool_failure now checks structured JSON result payloads (status != "ok" and error field) as failure, including terminal/fallback checks.
  • tools/delegate_tool.py: tool result trace now marks status error when structured status != "ok" or error field present.
  • tests/tools/test_delegate.py: added regression test to assert status contract is enforced in tool traces.

Notes

  • Kept changes surgical and focused on caller-layer contract.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder tool/delegate Subagent delegation labels May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants