Skip to content

feat(agent): run parallel tool groups around sequential barriers - #250

Merged
Pepps233 merged 4 commits into
mainfrom
feat/partitioned-parallel-tool-calls
Sep 29, 2026
Merged

Pepps233 merged 4 commits into
mainfrom
feat/partitioned-parallel-tool-calls

Conversation

@Pepps233

@Pepps233 Pepps233 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Mixed tool batches containing update_plan or another sequential tool currently serialize every call.

Execute consecutive parallel-capable calls concurrently while keeping sequential tools as exclusive barriers in assistant source order.

For example, read A, read B, update_plan, read C, read D runs as [A + B], then update_plan, then [C + D].

Reasoning

Reuse the existing executors and executionMode metadata to preserve tool lifecycle behavior without introducing another scheduling mode or configuration flag.

Each phase settles execution, result hooks, completion events, and ordered result-message events before the next phase starts preflight.

The model selects independent calls; file dependencies and shell side effects are not inferred.

Changes

  • Partition globally parallel batches into consecutive parallel groups and individual sequential barriers.
  • Preserve global sequential execution, source-ordered transcript results, batch-wide termination, cancellation, and batch-boundary steering delivery.
  • Add promise-gated agent tests and a faux-provider session reproduction using the real persisted update_plan tool.
  • Document barrier behavior, event ordering, and hook visibility in API comments, the agent README, and extension documentation.
  • Correct two stale summary expectations from main to include persisted plan context, in a separate test-only commit.

Testing

  • Reproduced the original serialization failure through the session harness before implementation.
  • Package-scoped Vitest: 97 agent tests and 70 session, plan, event-settlement, compaction, and user-input tests passed.
  • npm run check passed.
  • ./test.sh passed with credentials isolated; localhost fixture servers required running outside the filesystem/network sandbox.

- Let independent calls overlap around sequential barriers
- Preserve plan persistence and source-ordered results
- Guard exclusive barriers, settlement, cancellation, and batch termination
- Verify completed phases are visible to session preflight hooks
- Describe phase-local preflight and awaited result settlement
- Clarify termination, cancellation, and model independence responsibilities
- Match the persisted plan context added to branch and compaction summaries
- Keep exact summary assertions while restoring offline suite coverage
@Pepps233 Pepps233 self-assigned this Sep 28, 2026
@Pepps233
Pepps233 merged commit dc18b9e into main Sep 29, 2026
10 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant