Skip to content

Refactors tool execution to support batch operations and cancellation#35

Merged
carmelosantana merged 5 commits intomainfrom
chore_cleanup-tool-schema
Apr 2, 2026
Merged

Refactors tool execution to support batch operations and cancellation#35
carmelosantana merged 5 commits intomainfrom
chore_cleanup-tool-schema

Conversation

@carmelosantana
Copy link
Copy Markdown
Owner

Improves agent tool handling by introducing pluggable tool executors and tick callbacks, enabling batch execution for improved performance and better cancellation support. Adds tool limit trimming for OpenAI-compatible providers and ensures consistent tool schema handling across all providers.

Key changes:

  • Adds BatchToolExecutorInterface and ToolExecutorInterface for flexible tool execution
  • Introduces TickCallbackInterface for monitoring agent execution
  • Refactors tool call execution into three-phase process (pre-flight, execution, post-flight)
  • Implements SynchronousToolExecutor and NullTickCallback as defaults
  • Adds tool limit trimming for OpenAI providers with warning telemetry
  • Normalizes tool schemas to include required and additionalProperties fields
  • Suppresses OpenAI stream_options extension for Mistral provider

Extracts tool execution into a pluggable interface and adds tick callbacks for periodic work during agent execution. Enables async tool execution and external integration points.
Implement tool list trimming to OpenAI's 128-tool limit with warning telemetry. Suppress OpenAI's stream_options extension for Mistral compatibility. Normalize empty tool schemas for strict mode validation.
Extracts tool execution logic into a dedicated interface with batch support. Introduces a synchronous executor that implements both single and batch execution, enabling future async support while maintaining backward compatibility. The change also improves cancellation handling during tool execution.
Extracts tool execution into dedicated interfaces and implements synchronous executor. Removes batch interface from default executor and updates documentation to clarify concurrent execution semantics.
Introduces a new interface for batch tool execution and ensures consistent 'required' field handling in tool schemas across different providers. This enables future async support while maintaining backward compatibility.
@carmelosantana carmelosantana merged commit 0908b83 into main Apr 2, 2026
4 checks passed
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.

1 participant