forge-delegate
v1.2.4Delegate coding tasks from Claude Code, Codex or opencode to any model opencode can run.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_models
List the models available for delegation: local/keyless ones, direct-API models from opencode logins, and agentic models from the local opencode installation. Call it when the user asks what's available or wants to change the default model, not before an ordinary delegation — those use the configured default.
ask_model
Get a second opinion from a different model — on a design, an approach, or a tricky snippet — or ask one when the user requests it. Sends a one-shot prompt over a direct API call and returns the raw response. The model has no file access and cannot take actions; for anything touching files use delegate. Don't use it for syntax or API details you already know: a cheap model is usually less reliable than you on those. Omit model to use the configured default.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | The full question. The model has seen none of this conversation, so include the code and context it needs |
model | string | provider/model or ollama:<name>, e.g. deepseek/deepseek-v4-flash, ollama:llama3. Omit to use the configured default; don't pick a premium tier |
system | string | Optional system prompt, e.g. a role or an answer format |
delegate
Hand a coding task to another AI model running as a full agent via local opencode: it reads the project, explores, and writes the code in its own tool loop, none of which enters your context. Use it instead of writing the code yourself for: tests for code that already exists; a mechanical refactor (rename, signature change, import rewrite, API migration); lint/type/build errors (paste the error output); boilerplate or scaffolding (CRUD endpoints, config, schemas, adapters, fixtures); a port between languages or frameworks; the same edit repeated across 3 or more files; reading a large file or…
| Parameter | Type | Description |
|---|---|---|
task * | string | Self-contained instructions: the goal, the file paths to read or change, constraints, and how to check the result (e.g. which tests to run). The agent has not seen this conversation |
agent | string | opencode agent to use (defaults to config defaultAgent) |
autoApprove | boolean | Let the agent edit files and run commands without asking (defaults to config autoApprove, true). When false nobody is there to approve, so actions that need approval can stall or be refused |
background | boolean | Run detached and return a job id immediately; poll check_delegation (default false) |
continue_session | string | Session id from a previous delegation's result, to continue in that agent session |
directory | string | Absolute path of the project to work in (defaults to config defaultDirectory, else the server's working directory) |
files | array | Paths to attach to the agent's prompt (inline only; ignored with background:true). Rarely needed: the agent reads paths named in task itself |
model | string | provider/model, e.g. opencode/deepseek-v4.1-flash-free. Omit to use the configured default; don't raise it to a premium tier — split the task instead |
profile | string | Named preset from config profiles (see get_delegate_config) that sets model, agent, variant, directory and autoApprove together |
check_delegation
Check a delegation started with background:true. Returns RUNNING, DONE or TIMED OUT, the elapsed time, the session id, and the last 8,000 characters of the agent's output. Each poll costs context, so wait between polls instead of checking in a tight loop. Call with no id to list all jobs.
| Parameter | Type | Description |
|---|---|---|
id | string | Job id returned by delegate with background:true. Omit to list all jobs |
get_delegate_config
Read the current forge-delegate configuration: defaultModel, defaultAgent, defaultVariant, autoApprove, timeoutMs, defaultDirectory, and named profiles — plus the installed version and whether it updates automatically. Call this to see what will be used when a model/directory is omitted, or when the user asks which version is running.
set_delegate_config
Change forge-delegate configuration at runtime — no reinstall. Only change settings when the user asks; never raise defaultModel to a premium tier on your own. Pass any subset of {defaultModel, defaultAgent, defaultVariant, autoApprove, timeoutMs, defaultDirectory, profiles}. Set a field to null to clear it. To edit a profile, pass the whole profiles object (e.g. profiles: {tests: {model: "..."}}); set a profile to null to delete it. Only provided keys change; others are preserved.
| Parameter | Type | Description |
|---|---|---|
autoApprove | boolean | Let delegated agents edit files and run commands without asking |
defaultAgent | string | null | opencode agent used when a call omits agent |
defaultDirectory | string | null | Absolute project path used when a call omits directory |
defaultModel | string | null | provider/model used when a call omits model |
defaultVariant | string | null | Reasoning-effort variant, sent to opencode as provider/model#variant |
profiles | object | The whole profiles object: { name: { model, agent, variant, autoApprove, directory } }. A profile set to null is deleted |
timeoutMs | number | Per-delegation timeout in milliseconds (default 900000, 15 minutes) |