Why Batch Management Matters
Critical System Requirement: All tool approvals within the sametoolExecutionBatchId
must be responded to simultaneously in a single API call. Individual responses will cause the batch to complete prematurely, potentially leaving some tools unprocessed.
This is a fundamental constraint of the approval system that directly impacts both backend processing and user experience design.
Understanding Tool Execution Batches
Batch Identification
Every tool requiring approval includes atoolExecutionBatchId
field that groups related tool executions:
batch_456
, meaning they must be approved or denied together.
Why Batches Exist
Batches ensure atomic operations and maintain workflow integrity:- Atomic Operations: Related tools succeed or fail together
- Workflow Consistency: Prevents partial execution of multi-step processes
- User Context: Groups logically related actions for easier decision-making
Batch Response Requirements
Single Response Rule
The backend expects exactly one response containing decisions for all tools in a batch:Incomplete Batch Consequences
When a batch receives partial responses:- Premature Completion: The agent may respond before all tools are processed
- Undefined State: Unresponded tools may be left in pending state
- Workflow Failure: Multi-step processes may fail due to missing tool results
UX Implications
Batch Processing Patterns
Recommended: Collect all decisions before submittingUI Design Patterns
Batch-Aware Interface:- Group tools by
toolExecutionBatchId
in the UI - Show batch completion progress (e.g., “2 of 3 tools decided”)
- Disable submission until all tools in batch are decided
- Provide batch-level actions (“Approve All”, “Deny All”)
Implementation Strategies
Batch Collection Pattern
Common Pitfalls
- Immediate Processing: Don’t submit approvals as soon as user clicks buttons
- Ignoring Batch ID: Always group tools by
toolExecutionBatchId
- Partial Submissions: Never submit incomplete batches
- State Management: Don’t lose track of pending decisions across UI updates
Next Steps
- Learn about Approval States and their constraints
- Review API Integration for proper request formatting
- See Best Practices for UX recommendations