-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathopencode.jsonc
More file actions
233 lines (227 loc) · 7.48 KB
/
Copy pathopencode.jsonc
File metadata and controls
233 lines (227 loc) · 7.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
{
// opencode-native config for the Baba prompt system.
// Inert for other agents (Claude Code, Cursor, Codex) — AGENTS.md + system/
// remain the portable copy-paste unit. This file only affects opencode.
"$schema": "https://opencode.ai/config.json",
// Guarantees the system core is in every opencode session without relying
// on the model choosing to read it. Mirrors the AGENTS.md startup instruction.
// The system is merged (6 files, was 38 modules; 2026-08-31 cycle-removal pass).
// All files are pinned so module loading is fully deterministic. Phase-specific
// additions are diligence-loaded by the agent reading 00-system.md's load rules.
// Entries are explicit paths, never globs.
"instructions": [
"AGENTS.md",
"system/00-system.md",
"system/01-personas.md",
"system/02-decision-prompts.md",
"system/03-output-and-state.md",
"system/04-rubrics.md",
"system/05-impl-style.md",
"system/06-misc.md"
],
// Prefer the read-only BabaSensei planning path by default. The native Build
// and Plan overrides in .opencode/agents/ orchestrate the role subagents below.
"default_agent": "plan",
// Unofficial providers: local OpenAI-compatible server.
// `pnpm dev` must be running. Endpoint convention — the AI SDK's
// openai-compatible provider appends /chat/completions to baseURL, so
// baseURL must be the prefix *without* the /chat/completions suffix:
// correct: http://localhost:8890/v1 -> POST /v1/chat/completions
// correct: http://localhost:8890/v1/glm -> POST /v1/glm/chat/completions
// wrong: http://localhost:8890/v1/glm/chat/completions -> POST /v1/glm/chat/completions/chat/completions (404)
// The server now tolerates the wrong form via alias routes, but configure
// the correct prefix to avoid the extra hop.
"provider": {
"perplexity": {
"npm": "@ai-sdk/openai-compatible",
"name": "Perplexity (unofficial)",
"options": {
"baseURL": "http://localhost:8890/v1",
"apiKey": "ppx-local"
},
"models": {
"pplx_pro": {
"name": "Perplexity Best",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"pplx_alpha": {
"name": "Perplexity Alpha",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"turbo": {
"name": "Perplexity Turbo",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"experimental": {
"name": "Sonar 2 (Experimental)",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"grok46low": {
"name": "Grok 4.6 (fast)",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"grok4": {
"name": "Grok 4",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"claude50sonnet": {
"name": "Claude 5 Sonnet",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"claude50opus": {
"name": "Claude 5 Opus",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"gpt54": {
"name": "GPT-5.4",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"gpt5": {
"name": "GPT-5",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"gemini35flash": {
"name": "Gemini 3.5 Flash",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
},
"deepseek-default": {
"name": "DeepSeek Default",
"tool_call": false,
"limit": { "context": 128000, "output": 8192 }
},
"deepseek-expert": {
"name": "DeepSeek Expert",
"tool_call": false,
"limit": { "context": 128000, "output": 8192 }
},
"deepseek-r1": {
"name": "DeepSeek R1",
"tool_call": false,
"limit": { "context": 128000, "output": 8192 }
},
"deepseek-search": {
"name": "DeepSeek Search",
"tool_call": false,
"limit": { "context": 128000, "output": 8192 }
},
"deepseek-vision": {
"name": "DeepSeek Vision",
"tool_call": false,
"limit": { "context": 128000, "output": 8192 }
}
}
},
"motif": {
"npm": "@ai-sdk/openai-compatible",
"name": "Motif (unofficial)",
"options": {
"baseURL": "http://localhost:8890/v1/motif",
"apiKey": "ppx-local"
},
"models": {
"motif": {
"name": "Motif",
"tool_call": false,
"limit": { "context": 128000, "output": 16384 }
}
}
},
"kimi": {
"npm": "@ai-sdk/openai-compatible",
"name": "Kimi (unofficial)",
"options": {
"baseURL": "http://localhost:8890/v1/kimi",
"apiKey": "ppx-local"
},
"models": {
"kimi": {
"name": "Kimi",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
}
}
},
"qwen": {
"npm": "@ai-sdk/openai-compatible",
"name": "Qwen (unofficial)",
"options": {
"baseURL": "http://localhost:8890/v1/qwen",
"apiKey": "ppx-local"
},
"models": {
"qwen3.8-max": {
"name": "Qwen 3.8 Max",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
}
}
},
"glm": {
"npm": "@ai-sdk/openai-compatible",
"name": "GLM (unofficial)",
"options": {
"baseURL": "http://localhost:8890/v1/glm",
"apiKey": "ppx-local"
},
"models": {
"glm-5.3": {
"name": "GLM 5.3",
"tool_call": false,
"limit": { "context": 200000, "output": 16384 }
}
}
}
},
// Loop protection: hard-stop repeated identical tool calls (doom loops).
// opencode fires doom_loop detection on 3+ consecutive identical calls and
// would default to "ask"; denying it halts the loop at the process level
// instead of auto-approving under permissive setups. Guards credit burn on
// loop-prone models (Grok-class). See system/modules/31-loop-guards.txt.
"permission": {
"doom_loop": "deny"
},
// Truncate oversized tool output early so one oversized read does not burn
// the whole turn budget.
"tool_output": {
"max_lines": 1000,
"max_bytes": 32768
},
// MCP servers mirror the fallback tiers in AGENTS.md, adapted to opencode's
// schema. Note: opencode interpolates {env:VAR}, NOT ${VAR}.
// If EXA_API_KEY is absent, remove the exa entry rather than shipping a
// server that fails to start.
"mcp": {
// Tier 1 — no keys required
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp"
},
"playwright": {
"type": "local",
"command": ["npx", "-y", "@playwright/mcp@0.0.79"]
},
// Tier 2 — requires env key
"exa": {
"type": "remote",
"url": "https://mcp.exa.ai/mcp",
"headers": { "x-api-key": "{env:EXA_API_KEY}" }
},
// Remote OAuth — no key, one-time browser consent via `opencode mcp auth trello`
"trello": {
"type": "remote",
"url": "https://mcp.trello.com/v1",
"oauth": {}
}
}
}