Delegate to OpenCode
ode_delegateStart a background OpenCode agent session to execute a given task prompt, returning a sessionId for later follow-up or resumption.
Instructions
Starts a new OpenCode agent session to work on prompt (or promptPath) in the background and returns a sessionId - typically with status "running" once the underlying opencode server is warm, or "starting" if it just had to cold-spawn (never blocks past a few seconds either way, unless waitMs is set). Pass sessionId to resume a finished session with a follow-up prompt. Follow up with ode_await (block until done or timeout; timeoutMs: 0 = single check).
Model policy (cost-first):
default (when model omitted): opencode/deepseek-v4-flash-free
ODE_MODELS force-routing catalog: opencode/deepseek-v4-flash-free, opencode/nemotron-3-ultra-free, opencode/mimo-v2.5-free, opencode/laguna-s-2.1-free, … (13 total)
allow list: openrouter/, opencode/ (default)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for the delegated session. Omit to use the server's own cwd. | |
| agent | No | OpenCode agent/mode name to run as. Omit for opencode's own default. Ignored when resuming. | |
| model | No | Model as "provider/model", e.g. "opencode/deepseek-v4-flash-free". Omit to use OPEN_DELEGATE_DEFAULT_MODEL or the OpenCode server default. Ignored when resuming via sessionId. | |
| title | No | Optional short title for the session (shown in opencode's own session list). Ignored when resuming. | |
| prompt | No | The task/instructions to hand off (inline). Mutually exclusive with promptPath; one is required. Hard cap ~512KiB — use promptPath for anything larger. When sessionId is set, this is the follow-up prompt. | |
| waitMs | No | After setup succeeds, block up to this many ms for the session to finish (clamped 0-60000). Omitting skips the wait (same as waitMs: 0). Useful for short tasks that can finish in one tool call. | |
| sessionId | No | Resume an existing terminal session with a follow-up prompt instead of creating a new one. Session must not be running/starting. | |
| promptPath | No | Absolute path to a UTF-8 text file containing the prompt, for anything too large to inline safely (~512KiB cap applies to the file too). Mutually exclusive with prompt. |