Set the default model and behaviour
opencode_set_modelSet the default model, agent, and permission mode for future opencode tasks. Pass only the fields you want to change; all values persist for subsequent runs.
Instructions
Persists which model, agent and permission mode future opencode tasks use. Every field is optional; only the fields you pass are changed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | opencode agent, e.g. 'build' or 'plan'. | |
| model | No | Model as 'provider/model', e.g. 'opencode/big-pickle'. An empty string resets to the opencode default. | |
| variant | No | Reasoning variant, e.g. 'high' or 'max' (provider dependent). | |
| serverUrl | No | Attach to an existing opencode server instead of spawning one. Empty string = spawn again. | |
| keepSessions | No | Do not delete the temporary session after a run (debugging). | |
| permissionMode | No | auto = may edit files and run commands; readonly = no changes; strict = deny everything. | |
| defaultDirectory | No | Default working directory for tasks that do not name one. |