race
Run multiple tasks in parallel and return the first successful result, canceling the rest. Used for speculative execution or testing multiple strategies.
Instructions
Run multiple approaches in parallel, return the first to succeed.
All tasks start simultaneously. As soon as one completes without error, its ref is returned. Remaining tasks are abandoned (their containers are killed). Use for speculative execution or when multiple strategies might work.
Args: tasks: JSON array of task objects (same format as par). max_concurrency: Max agents running simultaneously (default: 5).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasks | Yes | ||
| max_concurrency | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |