Agent orchestrator — rest api for multi agent#356
Open
clintjeff2 wants to merge 5 commits into
Hidden character warning
The head ref may contain hidden characters: "Agent-orchestrator-\u2014-REST-API-for-multi-agent"
Open
Conversation
…ulti-agent-tasks Add multi-agent orchestrator API
- Increase MAX_PENDING_PER_AGENT to 500 in task-queue.ts to support tests requiring many tasks. - Refactor purgeAgentTasks unit tests to use dequeueNextTask for robust state transition verification. - Fix react/no-unescaped-entities lint error in offline page. - Fix TS error in task drain route by providing required result object to task.completed event. - Clean up next-env.d.ts to remove dev-only type imports. Co-authored-by: clintjeff2 <119521983+clintjeff2@users.noreply.github.com>
…023133 Fix CI failures in task queue and linting
|
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.



Motivation
Description
lib/planner.tsthat validatesgoal,budget, anddeadline, calls the Claude Haiku API when an API key is present, parses a DAG-style JSON plan, and falls back to a deterministic plan otherwise.lib/orchestrator.tsthat matches planned tasks to available agents, enqueuesorchestrator.steptasks via the existing task queue, emitstask.startedsystem events for canvas/UX animations, reserves x402-style costs, and persists the run.POST /api/orchestrateatapp/api/orchestrate/route.tswhich returnsrunId,plan, andtotalEstimatedCost, and registered the endpoint in the generated OpenAPI fileapp/api/openapi.json/route.ts.addOrchestrationRunhelper tolib/orchestration/runs.tsand a unit testlib/planner.test.tscovering planner fallback + budget validation.Testing
npx eslint lib/planner.ts lib/orchestrator.ts app/api/orchestrate/route.ts lib/planner.test.ts app/api/openapi.json/route.tswhich passed for the new files.npx vitest run lib/planner.test.tswhich passed (planner fallback behavior verified).npm run lintfailed due to unrelated lint errors in other files,npx tsc --noEmitfailed due to pre-existing type errors elsewhere, andnpm testshowed existing failing task-drain tests unrelated to the new orchestrator code.Closes #24