Repository navigation
Commit 92ec93e
fix: opencode run works — 3 critical fixes (#433)
## Summary
Fixes three critical bugs that prevented Cistern from spawning opencode
agents.
1. **PromptPositional**: opencode takes the prompt as a positional
argument after `run`, not via a flag. The old code used `PromptFlag: ""`
with `NonInteractive.PromptFlag: "-p"`, but `-p` is `--password` in
opencode, not a prompt flag. Added `PromptPositional: true` to the
opencode preset. When set, the short prompt is appended as a positional
argument after all flags, and the full prompt is written to `AGENTS.md`
via `PromptFileTemplate`.
2. **`--dangerously-skip-permissions`**: Added to the opencode preset
`Args`. Cistern agents must run without permission prompts to function
autonomously.
3. **Unset `OPENCODE_SERVER_*` env vars**: CodeNomad sets
`OPENCODE_SERVER_USERNAME` and `OPENCODE_SERVER_PASSWORD` in the
environment. When these are set, `opencode run` tries to connect to an
authenticated server instead of starting a fresh session, causing
"Session not found" errors. The fix explicitly unsets
`OPENCODE_SERVER_USERNAME`, `OPENCODE_SERVER_PASSWORD`, `OPENCODE_PID`,
and `OPENCODE` in every spawned tmux session. See:
anomalyco/opencode#8502
Co-authored-by: Lobsterdog <[email protected]>1 parent 9f1571e commit 92ec93e
3 files changed
Lines changed: 49 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
201 | 212 | | |
202 | 213 | | |
203 | 214 | | |
| |||
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
320 | | - | |
321 | | - | |
322 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
323 | 336 | | |
324 | | - | |
| 337 | + | |
325 | 338 | | |
326 | 339 | | |
327 | 340 | | |
328 | 341 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 342 | | |
335 | 343 | | |
336 | 344 | | |
| |||
357 | 365 | | |
358 | 366 | | |
359 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
360 | 388 | | |
361 | | - | |
362 | | - | |
363 | | - | |
| 389 | + | |
| 390 | + | |
364 | 391 | | |
365 | 392 | | |
366 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
| 174 | + | |
168 | 175 | | |
169 | 176 | | |
170 | | - | |
171 | | - | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | | - | |
| 180 | + | |
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
0 commit comments