refactor(delegation)!: retire delegate_code/coderProfile/composeProductionAgentProfile — delegate() over supervise() is the one path#358
Merged
Conversation
…ctionAgentProfile — delegate() over supervise() is the one path Delete the legacy task-specific delegation plumbing, collapsing onto the one canonical delegate() verb (over supervise()): - delegate_code / delegate_research MCP tools + their server/bin/openai-tools wiring - coderProfile + DEFAULT_CODER_SYSTEM_PROMPT (the hardcoded coder profile) - composeProductionAgentProfile + buildDelegationMcpServer + DELEGATION_MCP_SERVER_KEY - coderLoopRunner shim (loop-runner.ts) - ResearcherDelegate type, MCP_DISABLE_CODER/RESEARCHER, the bin coder/researcher path KEEP: delegate(), supervise(), the mcp bin delegate path (MCP_ENABLE_DELEGATE), detachedSessionDelegate. detachedSessionDelegate is now profile-parameterized (§1.5): the hardcoded coderProfile is gone — callers supply workerProfile (an AgentProfile); omit it for a minimal model-only default (no hardcoded skills/tools/prompt). The external callers (loops, agent-dev-container) pass executor/model/sandboxClient, not a profile, so they keep working on the default. createSandboxAct no longer injects a delegation MCP into the eval profile; it boots the agent's own profile with optional per-persona overrides. Breaking: removes the listed exports → 0.72.0. Regenerated docs/api; updated canonical-api.md version pin + decision table.
tangletools
approved these changes
Jun 22, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved PR — 1b8f14cd
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-22T10:58:58Z
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.
Retires the legacy task-specific delegation plumbing, collapsing onto the one canonical
delegate()verb (oversupervise()). Breaking removals → 0.72.0.Deleted
delegate_code/delegate_researchMCP tools + all wiring (server.tsbranches, the bin coder/researcher path, theopenai-toolsprojection of those two tools).coderProfile+DEFAULT_CODER_SYSTEM_PROMPT(the hardcoded coderAgentProfile).composeProductionAgentProfile+buildDelegationMcpServer+DELEGATION_MCP_SERVER_KEY(wholedelegation-profile.ts).coderLoopRunner+CoderLoopRunnerOptions(the loop-runner shim).ResearcherDelegatetype,MCP_DISABLE_CODER/MCP_DISABLE_RESEARCHERenv knobs.Kept
delegate(),supervise(), the mcp bindelegatepath (MCP_ENABLE_DELEGATE), anddetachedSessionDelegate(with its public type surface:CoderDelegate,DelegateRunCtx,CoderOutput,DelegateCodeArgs,DetachedSessionDelegateOptions,DetachedWinnerSelection,coderTaskFromArgs,settleDetachedCoderTurn). The queue-bound tools (delegate_feedback,delegation_status,delegation_history) anddelegate_ui_auditstay.detachedSessionDelegate is now profile-parameterized (§1.5)
The hardcoded
coderProfileis gone. Callers supplyworkerProfile(anAgentProfile); omit it for a minimal model-only default ({ name: 'coder' }— no hardcoded skills/tools/prompt).harness/model/systemPromptare convenience overrides layered onto whichever profile is used.The live external callers (loops PR #18, agent-dev-container PR #2509) pass
executor/sandboxClient/model, not a profile, so they keep working on the default — verified against their call sites. They invoke the returned delegate directly (not through the deleteddelegate_codeMCP tool), so the tool removal does not touch them.createSandboxAct(internal-only) no longer injects a delegation MCP into the eval profile; it boots the agent's own profile with optional per-persona overrides (SandboxActComposeOverrides).Verification — all green
pnpm run build·typecheck(src + examples) ·test(1045 passed, 1 skipped, 0 failed) ·lint·docs:check(version pin 0.72.0 accurate, no drift) ·verify:package. Regenerateddocs/api/via TypeDoc; updatedcanonical-api.mdversion pin + decision table. Branch merges cleanly intoorigin/main.Net: -3288 / +664 lines.