Skip to content

feat: support bulk TaskCreate calls#25

Open
nnourr wants to merge 1 commit into
tintinweb:masterfrom
nnourr:feat/taskcreate-bulk-create
Open

feat: support bulk TaskCreate calls#25
nnourr wants to merge 1 commit into
tintinweb:masterfrom
nnourr:feat/taskcreate-bulk-create

Conversation

@nnourr

@nnourr nnourr commented May 29, 2026

Copy link
Copy Markdown

Purpose

Creating several related tasks currently requires multiple sequential TaskCreate tool 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 TaskCreate tool instead of adding a separate bulk-only tool. A separate TaskCreateMany-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, extending TaskCreate with an optional tasks array gives agents the efficient path without adding another tool for models to choose between.

Summary

  • allow TaskCreate to accept a tasks array for creating multiple tasks in a single tool call
  • preserve backwards-compatible top-level subject + description usage
  • keep one creation tool rather than adding a separate bulk tool
  • document the new bulk format in the README
  • add integration coverage for bulk creation and invalid empty input

API 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?

  • Bulk creation uses the exact same fields as single creation.
  • A second tool would increase tool-list bloat and duplicate descriptions/prompt guidance.
  • Models would need to choose between two overlapping creation tools.
  • Extending TaskCreate keeps the common action — create task(s) — in one place while still reducing repeated tool calls.

Validation

  • npm run typecheck
  • npm run build
  • npm test — 5 files passed, 150 tests passed

@tintinweb

tintinweb commented May 30, 2026

Copy link
Copy Markdown
Owner

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:

  • system setting to allow batch tasks
  • either (1) register one batch tool or (2) the taskcreatemany as additional tool (probably in favor of (1))

@nnourr

nnourr commented Jun 1, 2026

Copy link
Copy Markdown
Author

@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

@tintinweb

Copy link
Copy Markdown
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants