Skip to content

refactor(delegation)!: retire delegate_code/coderProfile/composeProductionAgentProfile — delegate() over supervise() is the one path#358

Merged
drewstone merged 1 commit into
mainfrom
retire-delegation-plumbing
Jun 22, 2026
Merged

refactor(delegation)!: retire delegate_code/coderProfile/composeProductionAgentProfile — delegate() over supervise() is the one path#358
drewstone merged 1 commit into
mainfrom
retire-delegation-plumbing

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Retires the legacy task-specific delegation plumbing, collapsing onto the one canonical delegate() verb (over supervise()). Breaking removals → 0.72.0.

Deleted

  • delegate_code / delegate_research MCP tools + all wiring (server.ts branches, the bin coder/researcher path, the openai-tools projection of those two tools).
  • coderProfile + DEFAULT_CODER_SYSTEM_PROMPT (the hardcoded coder AgentProfile).
  • composeProductionAgentProfile + buildDelegationMcpServer + DELEGATION_MCP_SERVER_KEY (whole delegation-profile.ts).
  • coderLoopRunner + CoderLoopRunnerOptions (the loop-runner shim).
  • ResearcherDelegate type, MCP_DISABLE_CODER / MCP_DISABLE_RESEARCHER env knobs.

Kept

delegate(), supervise(), the mcp bin delegate path (MCP_ENABLE_DELEGATE), and detachedSessionDelegate (with its public type surface: CoderDelegate, DelegateRunCtx, CoderOutput, DelegateCodeArgs, DetachedSessionDelegateOptions, DetachedWinnerSelection, coderTaskFromArgs, settleDetachedCoderTurn). The queue-bound tools (delegate_feedback, delegation_status, delegation_history) and delegate_ui_audit stay.

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 ({ name: 'coder' } — no hardcoded skills/tools/prompt). harness / model / systemPrompt are 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 deleted delegate_code MCP 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. Regenerated docs/api/ via TypeDoc; updated canonical-api.md version pin + decision table. Branch merges cleanly into origin/main.

Net: -3288 / +664 lines.

…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 tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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

@drewstone drewstone merged commit c509e74 into main Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants