What happened
Two related failure modes in CugaLite tool invocation:
- Unknown argument names are silently dropped —
merge_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.
- Pydantic schema errors are not recoverable —
StructuredTool.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.py — picked = {k: v for k, v in d.items() if k in known}
src/cuga/backend/cuga_graph/nodes/cuga_lite/providers/registry.py — StructuredTool.from_function(...) with no handle_validation_error
Checklist
What happened
Two related failure modes in CugaLite tool invocation:
merge_tool_call_argskeeps 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.StructuredTool.from_functionis created withouthandle_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:B — bare validation failure
Agent passes wrong type (
quantity="two"). Withouthandle_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
origin/main@2538f1c2Logs, screenshots, or config
src/cuga/backend/cuga_graph/nodes/cuga_lite/tracking/arguments.py—picked = {k: v for k, v in d.items() if k in known}src/cuga/backend/cuga_graph/nodes/cuga_lite/providers/registry.py—StructuredTool.from_function(...)with nohandle_validation_errorChecklist