Commit c925afb
fix(cli): restart opencode automatically when src/mcp/ changes
OpenCode caches the MCP tool list at connect time. When the bot adds
or modifies tools (anything under src/mcp/), the bot rebuild updates
the server but OpenCode keeps serving the stale list — new tools
don't show up in /mcps until something kicks the connection.
The --update flow now detects diffs in src/mcp/ and runs
\`docker compose restart opencode\` after the bot rebuild. ~2s extra,
no full rebuild of opencode (its image is unchanged), and the next
prompt sees the fresh tool list.
Skipped when rebuild_opencode is already true (a full rebuild includes
the restart anyway).
CLI doc updated to mention the new behavior.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 38bf378 commit c925afb
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
216 | 226 | | |
217 | 227 | | |
218 | 228 | | |
| |||
232 | 242 | | |
233 | 243 | | |
234 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
235 | 248 | | |
236 | 249 | | |
237 | 250 | | |
| |||
253 | 266 | | |
254 | 267 | | |
255 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
256 | 273 | | |
257 | 274 | | |
258 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
0 commit comments