Conversation
… plan execution Agent-Logs-Url: https://github.com/huberp/agentloop/sessions/3eafff6a-ff97-4969-a9fe-39bbe0e978dc Co-authored-by: huberp <4027454+huberp@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add agent coordinator to select agent profiles
feat: Agent Coordinator — automatic profile routing and profile-aware plan execution
Mar 27, 2026
huberp
approved these changes
Mar 27, 2026
Owner
… PromptRegistry Agent-Logs-Url: https://github.com/huberp/agentloop/sessions/88a8938d-cc22-44c1-b761-a6287ff3d83a Co-authored-by: huberp <4027454+huberp@users.noreply.github.com>
Contributor
Author
The CI failure was in Fixed in 2e711bf by serialising all writes through a promise chain ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
huberp
approved these changes
Mar 27, 2026
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.
Agent profiles had to be explicitly named by callers; there was no mechanism to auto-select a profile based on free-text input or to annotate individual plan steps with specialist profiles.
Changes
src/agents/coordinator.ts(new)routeRequest(request, profileRegistry, registry, llm?)— lightweight LLM subagent selects the bestAgentProfilefor a request; returnsnullon no match, unknown name, invalid JSON, or subagent failure (never throws)coordinatedExecute(request, options)— high-level entry point:routeRequest → generatePlan → executePlan(or single-invoke whensteps.length ≤ planThreshold)ROUTER_SYSTEM_PROMPT— exported constant; instructs the router to respond only with{ "profile": "<name>" }or{ "profile": null }src/subagents/planner.tsPlanStepgains optionalagentProfile?: stringfieldgeneratePlan()accepts a new optionalprofileRegistry?param; when present, injects profile names into the planner task and system prompt so the model can annotate each stepJSON_SCHEMA_HINTandPLANNER_SYSTEM_PROMPTupdated accordinglysrc/orchestrator.tsExecutionOptionsgainsprofileRegistry?: AgentProfileRegistryrunStep()activates the annotated profile per step: resolves model/temperature overrides and intersectsactiveToolswithstep.toolsNeeded; warns when intersection is emptysrc/index.tsexecuteWithTools(): whenCOORDINATOR_ENABLED=trueand no explicitprofileNameis passed, callsrouteRequest()to auto-select a profile before the agent loop runssrc/config.ts/.env.exampleCOORDINATOR_ENABLED(defaultfalse) — enables auto-routing inagentExecutor.invoke()COORDINATOR_PLAN_THRESHOLD(default1) — step count threshold forcoordinatedExecute()plan pathUsage
Tests
routeRequesttests incoordinator.test.ts(correct selection,nullon unknown/null/parse-error/subagent-failure, empty registry short-circuit, task content, markdown-fence parsing)agentProfileparsing tests inplanner.test.tsorchestrator.test.tsWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
duckduckgo.com/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/agentloop/agentloop/node_modules/jest-worker/build/processChild.js(dns block)/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/agentloop/agentloop/node_modules/jest-worker/build/processChild.js t git bran�� -v find exist_xyz 3c6d28ffa51cb5afa21b7289b8e36e9aae6/log.json f k/_temp/ghcca-no. git conf��(dns block)If you need me to access, download, or install something from one of these locations, you can either:
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.