feat: activate coordinator mode in open build - #647
Merged
kevincodex1 merged 3 commits intoApr 13, 2026
Merged
Conversation
Enable the COORDINATOR_MODE feature flag and create the missing
src/coordinator/workerAgent.ts module that provides worker agent
definitions for the coordinator.
Coordinator mode is a multi-agent system where a coordinator agent
orchestrates independent workers via AgentTool, SendMessageTool,
and TaskStopTool. The implementation was already 99% complete
(19KB coordinatorMode.ts, 26 gate sites across 15 files) — only
the workerAgent module was missing from the source snapshot.
Workers get the standard built-in agents (general-purpose, explore,
plan). The coordinator system prompt (252 lines) handles all
orchestration logic.
Activate at runtime: CLAUDE_CODE_COORDINATOR_MODE=1
Optional scratchpad: set {"tengu_scratch": true} in
~/.claude/feature-flags.json (Twigpine#639)
Contributor
There was a problem hiding this comment.
Pull request overview
Enables the open-build COORDINATOR_MODE feature flag and adds the missing coordinator worker agent module so coordinator-mode wiring can resolve at build/runtime.
Changes:
- Added
src/coordinator/workerAgent.tsto supply coordinator-mode agent definitions. - Enabled
COORDINATOR_MODE: trueinscripts/build.tsso coordinator-mode code is included in open builds.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coordinator/workerAgent.ts | Adds getCoordinatorAgents() used by builtInAgents.ts when coordinator mode is active. |
| scripts/build.ts | Flips the open-build flag to include coordinator-mode code paths in the bundled output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The coordinator system prompt instructs the model to spawn workers with subagent_type: "worker", but no agent had agentType === 'worker'. This caused AgentTool to throw "Agent type 'worker' not found" on every coordinator spawn attempt. Add a WORKER_AGENT definition that spreads GENERAL_PURPOSE_AGENT with agentType: 'worker'. Also use the narrower BuiltInAgentDefinition type.
Enable BUILTIN_EXPLORE_PLAN_AGENTS so Explore (fast, haiku, read-only) and Plan (architect, read-only) agents are available to all users in both normal and coordinator modes. This resolves the inconsistency flagged in code review: coordinator workers had access to Explore/Plan agents while normal sessions did not. The GrowthBook A/B test gate (tengu_amber_stoat) defaults to true via the no-telemetry stub. Users can disable via feature-flags.json (Twigpine#639).
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 13, 2026
Flo5k5
added a commit
to Flo5k5/openclaude
that referenced
this pull request
Apr 13, 2026
With KAIROS=true, MONITOR_TOOL=true, and COORDINATOR_MODE=true, the build system's auto-generated noop stubs are truthy — causing runtime crashes when included in tool/task arrays. Add proper null-export stubs so conditional checks (?:) correctly exclude them. Stubs added: - MonitorTool, MonitorMcpTask, MonitorMcpDetailDialog, MonitorPermissionRequest (will be replaced by PR Twigpine#649's full implementation) - SendUserFileTool, PushNotificationTool (internal tools, no open-build impl) - coordinator/workerAgent (will be replaced by PR Twigpine#647's implementation)
Flo5k5
added a commit
to Flo5k5/openclaude
that referenced
this pull request
Apr 13, 2026
…ent (Twigpine#647) Replace null stubs with full implementations from PRs Twigpine#649 and Twigpine#647: - MonitorTool: streaming shell output tool with bash permission delegation, background task spawning, and 30min timeout (PR Twigpine#649) - MonitorMcpTask: task registry entry with agent-scoped cleanup for monitor-kind shell tasks (PR Twigpine#649) - MonitorPermissionRequest: permission UI with "don't ask again" support, delegates rules to Bash toolName for correct matching (PR Twigpine#649) - workerAgent: WORKER_AGENT definition + getCoordinatorAgents() returning worker, general-purpose, explore, and plan agents (PR Twigpine#647) MonitorMcpDetailDialog remains a null stub (not in PR Twigpine#649's scope).
kevincodex1
approved these changes
Apr 13, 2026
kevincodex1
requested review from
Vasanthdev2004,
anandh8x,
auriti and
gnanam1990
April 13, 2026 12:19
gnanam1990
approved these changes
Apr 13, 2026
C1ph3r404
pushed a commit
to C1ph3r404/openclaude
that referenced
this pull request
Apr 29, 2026
* feat: activate coordinator mode in open build
Enable the COORDINATOR_MODE feature flag and create the missing
src/coordinator/workerAgent.ts module that provides worker agent
definitions for the coordinator.
Coordinator mode is a multi-agent system where a coordinator agent
orchestrates independent workers via AgentTool, SendMessageTool,
and TaskStopTool. The implementation was already 99% complete
(19KB coordinatorMode.ts, 26 gate sites across 15 files) — only
the workerAgent module was missing from the source snapshot.
Workers get the standard built-in agents (general-purpose, explore,
plan). The coordinator system prompt (252 lines) handles all
orchestration logic.
Activate at runtime: CLAUDE_CODE_COORDINATOR_MODE=1
Optional scratchpad: set {"tengu_scratch": true} in
~/.claude/feature-flags.json (Twigpine#639)
* fix: add worker agent type for coordinator mode
The coordinator system prompt instructs the model to spawn workers with
subagent_type: "worker", but no agent had agentType === 'worker'.
This caused AgentTool to throw "Agent type 'worker' not found" on
every coordinator spawn attempt.
Add a WORKER_AGENT definition that spreads GENERAL_PURPOSE_AGENT with
agentType: 'worker'. Also use the narrower BuiltInAgentDefinition type.
* feat: activate built-in explore and plan agents in open build
Enable BUILTIN_EXPLORE_PLAN_AGENTS so Explore (fast, haiku, read-only)
and Plan (architect, read-only) agents are available to all users in
both normal and coordinator modes.
This resolves the inconsistency flagged in code review: coordinator
workers had access to Explore/Plan agents while normal sessions did not.
The GrowthBook A/B test gate (tengu_amber_stoat) defaults to true via
the no-telemetry stub. Users can disable via feature-flags.json (Twigpine#639).
The-FOOL-00
pushed a commit
to The-FOOL-00/openclaude
that referenced
this pull request
May 24, 2026
* feat: activate coordinator mode in open build
Enable the COORDINATOR_MODE feature flag and create the missing
src/coordinator/workerAgent.ts module that provides worker agent
definitions for the coordinator.
Coordinator mode is a multi-agent system where a coordinator agent
orchestrates independent workers via AgentTool, SendMessageTool,
and TaskStopTool. The implementation was already 99% complete
(19KB coordinatorMode.ts, 26 gate sites across 15 files) — only
the workerAgent module was missing from the source snapshot.
Workers get the standard built-in agents (general-purpose, explore,
plan). The coordinator system prompt (252 lines) handles all
orchestration logic.
Activate at runtime: CLAUDE_CODE_COORDINATOR_MODE=1
Optional scratchpad: set {"tengu_scratch": true} in
~/.claude/feature-flags.json (Twigpine#639)
* fix: add worker agent type for coordinator mode
The coordinator system prompt instructs the model to spawn workers with
subagent_type: "worker", but no agent had agentType === 'worker'.
This caused AgentTool to throw "Agent type 'worker' not found" on
every coordinator spawn attempt.
Add a WORKER_AGENT definition that spreads GENERAL_PURPOSE_AGENT with
agentType: 'worker'. Also use the narrower BuiltInAgentDefinition type.
* feat: activate built-in explore and plan agents in open build
Enable BUILTIN_EXPLORE_PLAN_AGENTS so Explore (fast, haiku, read-only)
and Plan (architect, read-only) agents are available to all users in
both normal and coordinator modes.
This resolves the inconsistency flagged in code review: coordinator
workers had access to Explore/Plan agents while normal sessions did not.
The GrowthBook A/B test gate (tengu_amber_stoat) defaults to true via
the no-telemetry stub. Users can disable via feature-flags.json (Twigpine#639).
discopops
pushed a commit
to discopops/openclaude
that referenced
this pull request
May 28, 2026
* feat: activate coordinator mode in open build
Enable the COORDINATOR_MODE feature flag and create the missing
src/coordinator/workerAgent.ts module that provides worker agent
definitions for the coordinator.
Coordinator mode is a multi-agent system where a coordinator agent
orchestrates independent workers via AgentTool, SendMessageTool,
and TaskStopTool. The implementation was already 99% complete
(19KB coordinatorMode.ts, 26 gate sites across 15 files) — only
the workerAgent module was missing from the source snapshot.
Workers get the standard built-in agents (general-purpose, explore,
plan). The coordinator system prompt (252 lines) handles all
orchestration logic.
Activate at runtime: CLAUDE_CODE_COORDINATOR_MODE=1
Optional scratchpad: set {"tengu_scratch": true} in
~/.claude/feature-flags.json (Twigpine#639)
* fix: add worker agent type for coordinator mode
The coordinator system prompt instructs the model to spawn workers with
subagent_type: "worker", but no agent had agentType === 'worker'.
This caused AgentTool to throw "Agent type 'worker' not found" on
every coordinator spawn attempt.
Add a WORKER_AGENT definition that spreads GENERAL_PURPOSE_AGENT with
agentType: 'worker'. Also use the narrower BuiltInAgentDefinition type.
* feat: activate built-in explore and plan agents in open build
Enable BUILTIN_EXPLORE_PLAN_AGENTS so Explore (fast, haiku, read-only)
and Plan (architect, read-only) agents are available to all users in
both normal and coordinator modes.
This resolves the inconsistency flagged in code review: coordinator
workers had access to Explore/Plan agents while normal sessions did not.
The GrowthBook A/B test gate (tengu_amber_stoat) defaults to true via
the no-telemetry stub. Users can disable via feature-flags.json (Twigpine#639).
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
Activate the full multi-agent system in the open build: coordinator mode, worker agents, and built-in Explore/Plan agents.
Highlight: agent nesting unlocked
The most impactful change is a single line removed in
src/constants/tools.ts:41(PR #644):This line added
AGENT_TOOL_NAMEto the disallowed tools list for sub-agents, preventing non-ant users from using recursive agent workflows. Removing it unlocks recursive agent spawning: a sub-agent can now spawn its own sub-agents. This enables complex coordination patterns (agent teams, hierarchical delegation) that were previously reserved for Anthropic employees.Changes (3 commits)
1. Coordinator mode activated (
scripts/build.ts,src/coordinator/workerAgent.ts)COORDINATOR_MODE: truebuild flagworkerAgent.ts— the only missing module from the source snapshotWORKER_AGENTwithagentType: 'worker'to match the coordinator system prompt'ssubagent_type: "worker"instructions2. Explore and Plan agents activated (
scripts/build.ts)BUILTIN_EXPLORE_PLAN_AGENTS: truebuild flagWhat is coordinator mode?
A multi-agent orchestration system:
AgentToolthat execute in parallelSendMessageTool, coordinator can stop them withTaskStopToolRuntime activation
Coordinator mode is opt-in at runtime:
export CLAUDE_CODE_COORDINATOR_MODE=1Explore and Plan agents are always available (no env var needed).
Optional scratchpad for cross-worker knowledge sharing:
Relationship to other PRs
COORDINATOR_MODE_ALLOWED_TOOLStengu_scratchscratchpad andtengu_amber_stoatcontrolTest plan
bun run build— compiles successfullybun run smoke— smoke tests passCLAUDE_CODE_COORDINATOR_MODE=1, verify coordinator system prompt loadssubagent_type: "worker", verify it resolves/agentlist