docs(TaskCreate): steer parallel TaskCreate calls for multi-task batches - #58
Merged
Merged
Conversation
Instead of adding a batch parameter, the tool description now tells the model it can create several tasks at once by issuing multiple TaskCreate calls in a single response — pi executes independent tool calls in parallel, so the whole batch is created in one turn with one call per task (subject + description stay required). Co-authored-by: swift-viper-90 <swift-viper-90@pi-agent.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Replaces the closed #24 (batch
TaskCreateparameter). Instead of adding a batch API, this PR steers the model through the tool description to batch-create tasks the way the runtime already supports: by issuing multipleTaskCreatecalls in a single response.Pi executes independent tool calls from one assistant message in parallel (default parallel tool execution mode; results restored to the model's original call order). Verified empirically: three parallel bash calls started within ~34ms of each other and ran concurrently; three parallel
TaskCreatecalls created tasks without collisions (sequential IDs, results in call order). So the model can create N tasks in one turn with no extension API change at all.Change
Description-only, 3 lines in
TaskCreate's tool description (visible to the coding agent):## When to Use— "User provides multiple tasks" bullet now says: Create them all in one response with one TaskCreate call per task## Tips— new bullet: To create several tasks at once, call TaskCreate multiple times in a single response — independent tool calls run in parallel, so the whole batch is created in one turn (one task per call).No schema or behavior changes:
subject/descriptionremain required, and the tool stays 1:1 with Claude Code. This also sidesteps the earlier concern about makingsubject/descriptionoptional to accommodate a batch parameter.Verification
npm run typecheck— cleannpm test— 346 passed (16 files)npm run build— clean— swift-viper-90 🤖