You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d0c8454
Browse filesBrowse the repository at this point in the historyBrowse files
fix(tools): return validation error dict when Workflow entry node rejects tool args in NodeTool
When `NodeTool` wraps a `Workflow` whose `input_schema` is a JSON Schema dict (such as a workflow starting with a `FunctionNode` in `node_input` binding mode) or a non-object schema with a missing `request` argument, `BaseNode._validate_input_data` on the outer `Workflow` does not validate the inner entry node's parameters before `_run_node_in_tool_context` starts. As a result, `ValidationError` or `WorkflowDataError` raised by the `START` successor escaped `NodeTool.run_async`'s validation handler instead of returning an `{'error': ...}` dict for the LLM to self-correct.
Add `_validate_tool_input` to validate and coerce tool arguments against the wrapped node and its `START` entry nodes before starting the workflow run, while keeping downstream internal workflow errors propagating to `on_tool_error` callbacks. Also skip `START` successors with `_requires_all_predecessors` (such as `JoinNode`) during schema resolution and tool-argument pre-validation so workflows with a `START -> JoinNode` edge can be wrapped by `NodeTool`.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 999764136
0 commit comments