Skip to main content

Why Batch Management Matters

Critical System Requirement: All tool approvals within the same toolExecutionBatchId 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 a toolExecutionBatchId field that groups related tool executions:
Both tools share 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:
  1. Premature Completion: The agent may respond before all tools are processed
  2. Undefined State: Unresponded tools may be left in pending state
  3. Workflow Failure: Multi-step processes may fail due to missing tool results

UX Implications

Batch Processing Patterns

Recommended: Collect all decisions before submitting
Avoid: Immediate individual processing

UI 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”)
Example Batch UI State:

Implementation Strategies

Batch Collection Pattern

Common Pitfalls

  1. Immediate Processing: Don’t submit approvals as soon as user clicks buttons
  2. Ignoring Batch ID: Always group tools by toolExecutionBatchId
  3. Partial Submissions: Never submit incomplete batches
  4. State Management: Don’t lose track of pending decisions across UI updates

Next Steps