Skip to content

[Bug]: Unknown tool arguments are silently dropped; schema validation errors are not recoverable #584

Description

@sami-marreed

What happened

Two related failure modes in CugaLite tool invocation:

  1. Unknown argument names are silently droppedmerge_tool_call_args keeps only schema-known keys, then the call proceeds as if it succeeded. The agent gets no error naming the unexpected fields, and the failed/partial call may not surface clearly in the trajectory.
  2. Pydantic schema errors are not recoverableStructuredTool.from_function is created without handle_validation_error=True, so wrong types / missing required fields raise bare exceptions instead of structured error strings the agent can recover from.

Validated on origin/main @ 2538f1c2.

How to reproduce

A — silent drop

Tool schema accepts product_id, quantity. Agent calls:

await place_order({"product_id": 1, "quantity": 2, "currency": "USD"})
# merge_tool_call_args → {"product_id": 1, "quantity": 2}
# Call proceeds; "currency" never reaches the API and never appears as an error.

B — bare validation failure

Agent passes wrong type (quantity="two"). Without handle_validation_error=True, Pydantic raises; agent gets an unrecoverable exception path instead of a structured error in the response/trajectory.

Expected: structured error naming unexpected fields / validation failures, recorded in ToolCallTracker.

Actual: silent drop or bare exception.

Environment

  • OS: n/a (code-path bug)
  • CUGA: origin/main @ 2538f1c2
  • Component: CugaLite providers registry / tool argument merging

Logs, screenshots, or config

  • src/cuga/backend/cuga_graph/nodes/cuga_lite/tracking/arguments.pypicked = {k: v for k, v in d.items() if k in known}
  • src/cuga/backend/cuga_graph/nodes/cuga_lite/providers/registry.pyStructuredTool.from_function(...) with no handle_validation_error

Checklist

  • I searched existing issues and this doesn’t look like a duplicate

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcomplexity: mediumModerate scope — multiple files or non-trivial logiccomponent: agentCore agent loop, DynamicAgentGraph, LLM node, tool execution, CugaLitecomponent: registryTool/agent registryneeds-triageNewly filed, not yet reviewedpriority: highImportant, address soon

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions