continue_run
Provide additional input to a paused run that requires more information to proceed, enabling continued execution of orchestrated coding tasks.
Instructions
Send an additional input message to a run that is waiting for more input.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | ||
| input_message | Yes |
Implementation Reference
- src/core/run-manager.ts:151-192 (handler)The continueRun method in RunManager contains the core handler logic for the continue_run tool. It validates the run state, checks if the run is active and awaiting input, creates a resume event, and invokes the adapter's continue method to send additional input to a waiting run.
async continueRun(input: ContinueRunInput): Promise<ContinueRunResult> { const managed = this.findManagedRun(input.run_id); if (!managed) { throw new Error(`run is not active in this process: ${input.run_id}`); } if (isTerminalStatus(managed.record.status)) { throw new Error(`run is already terminal: ${managed.record.status}`); } if (managed.record.status !== 'input_required' && managed.record.status !== 'auth_required') { throw new Error(`run is not awaiting additional input: ${managed.record.status}`); } const continueFn = managed.adapter.continue ?? managed.handle.continue; if (!continueFn) { throw new Error(`backend does not support continue: ${managed.record.backend}`); } const resumedAt = new Date().toISOString(); const resumeEvent = this.prepareEvent(managed, { seq: 0, ts: resumedAt, run_id: '', session_id: managed.record.sessionId, backend: managed.record.backend, type: 'status_changed', data: { status: 'running', reason: 'continue_run', }, }); await this.persistEvent(managed, resumeEvent); if (managed.adapter.continue) { await managed.adapter.continue(managed.handle, input.input_message); } else { await managed.handle.continue?.(input.input_message); } return { run_id: managed.record.runId, status: managed.record.status, }; } - src/tools/continue-run.ts:11-28 (registration)The registerContinueRunTool function registers the 'continue_run' tool with the MCP server, defining its name, description, input/output schemas, and the async handler that wraps the RunManager.continueRun method with error handling.
export function registerContinueRunTool(server: McpServer, manager: RunManager): void { server.registerTool( 'continue_run', { description: 'Send an additional input message to a run that is waiting for more input.', inputSchema: continueRunSchema, outputSchema: continueRunResultSchema, }, async (args) => { try { const result = await manager.continueRun(args); return asToolResult(result); } catch (error) { return asToolError(String(error)); } }, ); } - src/core/schemas.ts:124-127 (schema)The continueRunSchema defines the input validation schema using Zod, requiring a run_id string and an input_message that conforms to agentMessageSchema.
export const continueRunSchema = z.object({ run_id: z.string().min(1), input_message: agentMessageSchema, }); - src/core/schemas.ts:221-224 (schema)The continueRunResultSchema defines the output validation schema, containing run_id and status fields.
export const continueRunResultSchema = z.object({ run_id: z.string(), status: runStatusSchema, }); - src/core/types.ts:216-224 (schema)TypeScript interface definitions for ContinueRunInput (run_id and input_message) and ContinueRunResult (run_id and status) used by the continue_run tool.
export interface ContinueRunInput { run_id: string; input_message: AgentMessage; } export interface ContinueRunResult { run_id: string; status: RunStatus; }