Skip to content

feat(evals): tools_called require_args param to catch empty tool arguments - #947

Merged
chaholl merged 1 commit into
mainfrom
feat/943-tools-called-require-args
Apr 12, 2026
Merged

chaholl merged 1 commit into
mainfrom
feat/943-tools-called-require-args

Conversation

@chaholl

@chaholl chaholl commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add require_args: true param to tools_called assertion handler
  • Only counts tool calls with non-empty arguments when enabled
  • Update capability matrix streaming-tools scenario to use it

Context

Issue #940 revealed that tool call arguments can be silently dropped during Responses API streaming. The tools_called assertion passed because it only checks tool names, not argument correctness. This meant the capability matrix didn't catch the regression.

Changes

  • tools_called handler: new require_args param (default false for backward compat)
  • shouldCountCall: skip calls with nil/empty Arguments when requireArgs is true
  • streaming-tools.scenario.yaml: enabled require_args: true

Test plan

  • TestToolsCalledHandler_RequireArgs_Pass — tool with args passes
  • TestToolsCalledHandler_RequireArgs_FailEmpty — tool with nil args fails
  • TestToolsCalledHandler_RequireArgs_DefaultFalse — backward compat: nil args still pass without the flag
  • All existing TestToolsCalledHandler_* tests pass (no regressions)

Closes #943

tools_called now supports require_args: true which only counts tool
calls that have non-empty arguments. This catches the #940 failure
mode where tool args are silently dropped during streaming.

Updated the capability matrix streaming-tools scenario to use
require_args: true so future regressions are caught automatically.

Closes #943
@sonarqubecloud

Copy link
Copy Markdown

@chaholl
chaholl merged commit 7916605 into main Apr 12, 2026
26 checks passed
@chaholl
chaholl deleted the feat/943-tools-called-require-args branch April 12, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

capability matrix: tools_called assertion doesn't validate argument correctness

1 participant