Repository navigation
feat: Fan-out primitive for parallel self-invocation (#230) - #233
Merged
Merged
Conversation
Add POST /api/agents/{name}/fan-out endpoint and fan_out MCP tool that
dispatches N independent tasks to an agent in parallel, collects results
with per-task status, and returns an aggregated response. Each subtask
follows the standard TaskExecutionService path for full dashboard
observability (cost, tokens, logs), linked by a shared fan_out_id.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.
Summary
POST /api/agents/{name}/fan-outendpoint andfan_outMCP tool for dispatching N independent tasks to an agent in parallelTaskExecutionServicepath — full dashboard observability (cost, tokens, logs, origin tracking)fan_out_idcolumn on execution records for aggregation and debuggingasyncio.Semaphorewith configurablemax_concurrency(1-10, default 3)Changes
src/backend/services/fan_out_service.py— Core coordination servicesrc/backend/routers/fan_out.py— Endpoint with Pydantic validationsrc/backend/services/task_execution_service.py— Acceptfan_out_idparamsrc/backend/database.py,db_models.py,db/schedules.py,db/migrations.py—fan_out_idcolumn + migrationsrc/backend/routers/schedules.py— Exposefan_out_idin execution API responsessrc/mcp-server/src/tools/chat.ts—fan_outMCP tool definitionsrc/mcp-server/src/client.ts—fanOut()API client methoddocs/memory/requirements.md— Requirement 17.5 (FANOUT-001)docs/memory/feature-flows/fan-out.md— Feature flow documentationTest Plan
triggered_by=fan_outandfan_out_idlinkagefan_out_idvisible in executions API responsepytest tests/test_fan_out.py -v(14 test cases)Closes #230
🤖 Generated with Claude Code