You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1cdf07c
Browse filesBrowse the repository at this point in the historyBrowse files
`src/index.ts` is the MCP server entry point (`bun run start`, bundled to `dist/index.js` by `bun run build`); it builds on the `delegate`, `resolveModel`, `buildArgs` and `EventCollector` modules, which also document how `opencode run` is invoked and its JSON stream parsed. Changing `src/` changes the MCP tools, so rebuild and commit `dist/`. The provider preference (direct provider over an aggregator, `OPENCODE_DELEGATE_PREFERRED_PROVIDERS` first) applies to the MCP server only, not to the worker. Variables read by `src/config.ts`:
| `OPENCODE_BIN` | auto-detected | Path to `opencode` |
151
-
| `OPENCODE_DELEGATE_DEFAULT_MODEL` | unset | Model when none given; unset or empty means OpenCode's configured default |
152
-
|`OPENCODE_DELEGATE_READ_MODEL`|unset| Model when none given and `auto` is false;unset or empty falls back to `OPENCODE_DELEGATE_DEFAULT_MODEL`, then OpenCode's default |
153
-
| `OPENCODE_DELEGATE_AUTO` | `true` | Default for `auto`; `0`, `false`, `no`, `off` disable it |
154
-
| `OPENCODE_DELEGATE_TIMEOUT` | `1800` | Seconds before a run is killed |
155
-
| `OPENCODE_DELEGATE_MAX_OUTPUT` | `40000` | Maximum response characters returned |
156
-
| `OPENCODE_DELEGATE_THINKING` | `true` | Include reasoning blocks in output |
157
-
| `OPENCODE_DELEGATE_CWD` | process cwd | Base working directory |
158
-
| `OPENCODE_DELEGATE_PREFERRED_PROVIDERS` | none | Comma-separated provider order when a model has several providers |
| `OPENCODE_BIN` | auto-detected | Path to `opencode` |
151
+
| `OPENCODE_DELEGATE_DEFAULT_MODEL` | unset | Model when none given, for write and read-only runs; unset or empty means OpenCode's configured default |
152
+
|`OPENCODE_DELEGATE_AUTO`|`true`| Default for`auto`;`0`, `false`, `no`, `off` disable it |
153
+
|`OPENCODE_DELEGATE_TIMEOUT`|`1800`| Seconds before a run is killed |
154
+
|`OPENCODE_DELEGATE_MAX_OUTPUT`|`40000`| Maximum response characters returned |
155
+
|`OPENCODE_DELEGATE_THINKING`|`true`| Include reasoning blocks in output |
156
+
|`OPENCODE_DELEGATE_CWD`| process cwd | Base working directory |
157
+
|`OPENCODE_DELEGATE_PREFERRED_PROVIDERS`| none | Comma-separated provider order when a model has several providers |
@@ -21988,14 +21987,14 @@ var text = (t, isError = false) => ({
21988
21987
});
21989
21988
var delegateShape = {
21990
21989
prompt: string2().min(1).describe("Complete, self-contained task for the opencode model. It cannot see this conversation: include goal, relevant files/paths, constraints, and acceptance criteria."),
21991
-
model: string2().optional().describe(`opencode model: exact 'provider/model' id (e.g. 'xai/grok-4.7') or a loose name ('grok 4.7', 'kimi k3'). Append '#variant' for a reasoning variant. Omit to use the default: ${config2.defaultModel ?? "opencode's default"} for normal tasks, ${config2.readModel ?? config2.defaultModel ?? "opencode's default"} (free) when auto is false.`),
21990
+
model: string2().optional().describe(`opencode model: exact 'provider/model' id (e.g. 'xai/grok-4.7') or a loose name ('grok 4.7', 'kimi k3'). Append '#variant' for a reasoning variant. Omit to use the default: ${config2.defaultModel ?? "opencode's configured default model"}.`),
21992
21991
cwd: string2().optional().describe("Working directory for the task (absolute, or relative to the server's cwd). Defaults to the current project."),
21993
21992
agent: string2().optional().describe("opencode agent to use (e.g. 'build', 'plan', or a custom agent)."),
21994
21993
files: array(string2()).optional().describe("Files to attach to the message."),
21995
21994
session_id: string2().optional().describe("Continue an existing opencode session (returned by a previous call) for follow-ups."),
21996
21995
continue: boolean2().optional().describe("Continue the most recent opencode session in cwd."),
21997
21996
fork: boolean2().optional().describe("Fork the session given by session_id/continue instead of appending to it."),
21998
-
auto: boolean2().optional().describe(`Auto-approve tool permissions (edits, shell) that are not explicitly denied. Default: ${config2.auto}. Set false for read-only work (reading files, reviews, questions); without a model that also selects the free read model.`),
21997
+
auto: boolean2().optional().describe(`Auto-approve tool permissions (edits, shell) that are not explicitly denied. Default: ${config2.auto}. Set false for read-only work (reading files, reviews, questions).`),
Copy file name to clipboardExpand all lines: src/index.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ const delegateShape = {
44
44
.string()
45
45
.optional()
46
46
.describe(
47
-
`opencode model: exact 'provider/model' id (e.g. 'xai/grok-4.7') or a loose name ('grok 4.7', 'kimi k3'). Append '#variant' for a reasoning variant. Omit to use the default: ${config.defaultModel??"opencode's default"} for normal tasks, ${config.readModel??config.defaultModel??"opencode's default"} (free) when auto is false.`,
47
+
`opencode model: exact 'provider/model' id (e.g. 'xai/grok-4.7') or a loose name ('grok 4.7', 'kimi k3'). Append '#variant' for a reasoning variant. Omit to use the default: ${config.defaultModel??"opencode's configured default model"}.`,
48
48
),
49
49
cwd: z
50
50
.string()
@@ -72,7 +72,7 @@ const delegateShape = {
72
72
.boolean()
73
73
.optional()
74
74
.describe(
75
-
`Auto-approve tool permissions (edits, shell) that are not explicitly denied. Default: ${config.auto}. Set false for read-only work (reading files, reviews, questions); without a model that also selects the free read model.`,
75
+
`Auto-approve tool permissions (edits, shell) that are not explicitly denied. Default: ${config.auto}. Set false for read-only work (reading files, reviews, questions).`,
0 commit comments