start_handoff
Initiate sequential delegation from eligible intent plans by transferring context and approvals to designated profiles for continued execution.
Instructions
Start a sequential delegation handoff from a delegation-eligible intent plan
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| intentId | Yes | ||
| context | No | ||
| mcpProfile | No | ||
| bundleId | No | ||
| partnerProfile | No | ||
| approved | No | ||
| repoPath | No | ||
| delegateProfile | No | ||
| plannedChecks | No |
Implementation Reference
- scripts/delegation-runtime.js:530-585 (handler)The core implementation of the start_handoff logic.
function startHandoff(params = {}) { const evaluation = evaluateDelegation({ delegationMode: 'sequential', plan: params.plan, mcpProfile: params.mcpProfile, context: params.context, repoPath: params.repoPath, plannedChecks: params.plannedChecks, }); if (String(params.mcpProfile || '').trim() === 'dispatch') { persistRejectedStart({ taskKey: evaluation.taskKey, intentId: params.plan && params.plan.intent ? params.plan.intent.id : null, delegateProfile: null, mcpProfile: params.mcpProfile, partnerProfile: params.partnerProfile, reasonCode: 'dispatch_profile', reason: 'Dispatch MCP profile may not start handoffs.', context: params.context, repoPath: params.repoPath, }); throw createDelegationError('Dispatch MCP profile may not start handoffs.', 403); } if (String(params.mcpProfile || '').trim() === 'locked') { persistRejectedStart({ taskKey: evaluation.taskKey, intentId: params.plan && params.plan.intent ? params.plan.intent.id : null, delegateProfile: null, mcpProfile: params.mcpProfile, partnerProfile: params.partnerProfile, reasonCode: 'locked_profile', reason: 'Locked MCP profile may not start handoffs.', context: params.context, repoPath: params.repoPath, }); throw createDelegationError('Locked MCP profile may not start handoffs.', 403); } if (!evaluation.delegationEligible || evaluation.executionMode !== 'sequential_delegate') { persistRejectedStart({ taskKey: evaluation.taskKey, intentId: params.plan && params.plan.intent ? params.plan.intent.id : null, delegateProfile: evaluation.delegateProfile, mcpProfile: params.mcpProfile, partnerProfile: params.partnerProfile, reasonCode: evaluation.reasonCode, reason: evaluation.delegationReason, context: params.context, repoPath: params.repoPath, }); throw createDelegationError(evaluation.delegationReason, evaluation.reasonCode === 'unresolved_handoff_exists' ? 409 : 422, { reasonCode: evaluation.reasonCode, }); } - scripts/tool-registry.js:148-165 (registration)Tool registration for start_handoff.
destructiveTool({ name: 'start_handoff', description: 'Start a sequential delegation handoff from a delegation-eligible intent plan', inputSchema: { type: 'object', required: ['intentId'], properties: { intentId: { type: 'string' }, context: { type: 'string' }, mcpProfile: { type: 'string' }, bundleId: { type: 'string' }, partnerProfile: { type: 'string' }, approved: { type: 'boolean' }, repoPath: { type: 'string' }, delegateProfile: { type: 'string' }, plannedChecks: { type: 'array', items: { type: 'string' } }, }, }, - adapters/mcp/server-stdio.js:354-365 (handler)MCP tool handler routing for start_handoff in server-stdio.js.
case 'start_handoff': return toTextResult(startHandoff({ plan: planIntent({ intentId: args.intentId, context: args.context || '', mcpProfile: args.mcpProfile, bundleId: args.bundleId, partnerProfile: args.partnerProfile, delegationMode: 'sequential', approved: args.approved === true, repoPath: args.repoPath, }),