feat: support bulk TaskCreate calls#25
Conversation
|
hey @nnourr thanks for taking the time to file this PR. I am a bit torn between adding batch task create or leaving it 1:1 like claude code. There might be reasons not to allow the agent to batch create tasks esp if tasks are very verbose. was thining of adding a taskCreateMany behind a system setting to test this out first and then maybe switch to a batch-by-default TaskCreate if it really works out. wdyt? my main concern: if we allow the agent to batch-create tasks then task discriptions might become worse the longer the task list. declaring description/subject optional for fallback might actually interfere with single task creation. options:
|
|
@tintinweb have you experienced any problems with agents creating tasks that are too verbose? I personally found that the more detailed the task list is, the more likely it is for an agent to complete the work at hand, especially for longer running instructions. My experience with other packages that enable tasks and have a batch create tool is that the agent will most of the time hesitate to use it at all. I understand that can probably be solved with prompting, but I also feel like the heart of pi is that you control the harness rather than the prompt, if you know what I mean. by exposing a tool that only has a bulk task option, you implicitly encourage the agent to create bulk tasks. re: description quality, I think a good task list can overcome detailed descriptions, because the way I see it, descriptions can be derived when it's time to actually work on the task, versus during initial task creation where knowledge about the problem is limited. those are my thoughts, mostly anecdotal |
|
Whoops sorry I did not express what I mean correctly. I mean that I saw deteriorating effects when allowing batch task creating in a previous extension that I made, mostly on complex formulated tasks. the agent tended to break up a the complex instructions into very simple task descriptions instead of giving concrete guidance for every task. In contrast, forcing individual task creation calls had much better, more detailed task descriptions compared to one batch invocation. This is my experience, but this information is also a quite dated 😅 (last year; https://marketplace.visualstudio.com/items?itemName=tintinweb.chonky-task-manager) |
Purpose
Creating several related tasks currently requires multiple sequential
TaskCreatetool calls. That is slow and noisy for multi-step plans, and it burns extra model/tool round trips when the agent already knows the full task list.This PR intentionally keeps the API surface small by making bulk creation a strict superset of the existing
TaskCreatetool instead of adding a separate bulk-only tool. A separateTaskCreateMany-style tool would duplicate the same task fields, docs, prompt guidance, reminder handling, and mental model. Since single-task creation is just bulk creation with one item, extendingTaskCreatewith an optionaltasksarray gives agents the efficient path without adding another tool for models to choose between.Summary
TaskCreateto accept atasksarray for creating multiple tasks in a single tool callsubject+descriptionusageAPI shape
Existing single-task calls still work unchanged:
{ "subject": "Write tests", "description": "Add parser coverage" }New bulk form:
{ "tasks": [ { "subject": "Design API", "description": "Define endpoints and data contracts" }, { "subject": "Implement API", "description": "Build endpoints after design is approved" } ] }Why not a separate tool?
TaskCreatekeeps the common action — create task(s) — in one place while still reducing repeated tool calls.Validation
npm run typechecknpm run buildnpm test— 5 files passed, 150 tests passed