Skip to content

Commit 4cba156

Browse files
authored
docs(readme): document opencode prerequisites (#90)
## Summary Document the two prerequisites for running opencode under the dispatcher: (1) `opencode providers login` to set up credentials, and (2) explicit `AGENT_DEV_MODEL` / `AGENT_REVIEW_MODEL` in `autonomous.conf` (opencode is provider-agnostic — no default model). Also flag that `AGENT_PERMISSION_MODE=bypassPermissions` isn't yet wired to opencode's `--dangerously-skip-permissions` flag (same gap as codex). ## Why After #89 added first-class opencode support, a user reading the README's "Full support" badge and setting `AGENT_CMD=opencode` would get a silently stalled pipeline: opencode enters a session but produces no output without credentials and an explicit model. Spelling out the prereqs up-front prevents the foot-gun. ## What changed - **README → Supported Agent CLIs**: opencode row now has a † footnote covering auth + explicit model + the bypassPermissions gap. - **README → variable table**: the `AGENT_CMD` row gets an inline pointer to the footnote so users editing `autonomous.conf` see the warning without scrolling. - **`autonomous.conf.example`**: the `AGENT_CMD` comment and the `AGENT_DEV_MODEL` / `AGENT_REVIEW_MODEL` comments now explicitly call out that empty model values are valid for claude/codex but invalid for opencode. ## Test Plan - [x] No code changes; `bash -n` clean on `autonomous.conf.example` - [ ] CI checks pass ## Checklist - [x] Docs only - [x] Build/tests not affected
1 parent 3633219 commit 4cba156

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ The file is a bash script that's `source`d at every dispatcher tick and wrapper
168168
| `REPO` | Yes | `owner/repo-name` | The GitHub repo the pipeline watches. |
169169
| `REPO_OWNER`, `REPO_NAME` | Yes | Split form of `REPO` | Used for App-token scoping. |
170170
| `PROJECT_DIR` | Yes | Absolute path to the project root on the dispatcher box | Where the agent runs. |
171-
| `AGENT_CMD` | No (default `claude`) | `claude`, `codex`, `kiro`, or `opencode` | The CLI used to spawn dev/review agents. Other CLIs work via the generic `<cli> -p <prompt>` fallback. See the Supported Agent CLIs table for resume semantics per CLI. |
171+
| `AGENT_CMD` | No (default `claude`) | `claude`, `codex`, `kiro`, or `opencode` | The CLI used to spawn dev/review agents. Other CLIs work via the generic `<cli> -p <prompt>` fallback. See the Supported Agent CLIs table for resume semantics per CLI. **`opencode` requires `opencode providers login` and explicit `AGENT_DEV_MODEL`/`AGENT_REVIEW_MODEL` values** — see the table footnote. |
172172
| `AGENT_DEV_MODEL`, `AGENT_REVIEW_MODEL` | No (default empty / `sonnet`) | Model name passed to the agent CLI | Empty = let the CLI pick. The review model defaults to `sonnet` to keep review costs predictable. |
173173
| `AGENT_PERMISSION_MODE` | No (default `auto`) | `auto`, `plan`, or `bypassPermissions` | `bypassPermissions` grants the agent unrestricted shell access — only use in a trusted sandbox. |
174174
| `AGENT_TIMEOUT` | No (default `4h`) | coreutils `timeout` units (e.g. `30m`, `2h`, `1d`) | Wall-clock cap on each agent invocation. Prevents hung CLI processes (stale `--resume`, MCP stdio deadlock) from monopolizing wrapper PID slots. |
@@ -373,7 +373,17 @@ The dispatcher is an [OpenClaw](https://github.com/OpenClaw/OpenClaw) skill that
373373
| Kiro CLI | `kiro-cli` | `chat --no-interactive [--agent <name>]` | (falls back to new) | Basic support |
374374
| Cursor Agent | `agent` | `-p "<prompt>"` | `--resume=<chat-id>` | Generic fallback (untested explicit branch) |
375375
| Gemini CLI | `gemini` | `-p "<prompt>"` | (no documented resume flag) | Generic fallback (untested explicit branch) |
376-
| opencode | `opencode` | `run --format json [PROMPT]` | `run --session <sessionID>` (captured from JSON stream) | Full support |
376+
| opencode | `opencode` | `run --format json [PROMPT]` | `run --session <sessionID>` (captured from JSON stream) | Full support † |
377+
378+
**opencode prerequisites.** Unlike Claude Code (Anthropic-bound) or Codex CLI (OpenAI-bound), opencode is provider-agnostic — it has no default model, and no built-in credentials. Before setting `AGENT_CMD=opencode`:
379+
380+
1. **Authenticate a provider.** Run `opencode providers login` once on the dispatcher box (or every box that runs the wrapper if `EXECUTION_BACKEND=remote-aws-ssm`). Without this, the agent enters a session but produces no output and the pipeline silently makes no progress.
381+
2. **Set an explicit model.** opencode's `--model` argument expects `provider/model` form (e.g. `anthropic/claude-sonnet-4-6`, `openai/gpt-5.4`). The wrapper forwards `AGENT_DEV_MODEL` / `AGENT_REVIEW_MODEL` from `autonomous.conf`; leave them empty and opencode will either error out or wait for interactive selection (which never arrives in headless mode). Recommended:
382+
```bash
383+
AGENT_DEV_MODEL="anthropic/claude-sonnet-4-6"
384+
AGENT_REVIEW_MODEL="anthropic/claude-haiku-4-5"
385+
```
386+
3. **`AGENT_PERMISSION_MODE=bypassPermissions` is not yet wired** to opencode's `--dangerously-skip-permissions` flag (same gap as the codex branch — tracked as a follow-up). For now, run opencode in a sandboxed environment where the missing permission flag is acceptable.
377387

378388
Configure via `AGENT_CMD` in `scripts/autonomous.conf`. The `claude`, `codex`, `kiro`, and `opencode` rows have explicit branches in `scripts/lib-agent.sh`; the others run through the generic `<cli> -p <prompt>` fallback. Any CLI not listed should still work if it accepts a `-p <prompt>` non-interactive flag — the abstraction layer is intentionally permissive.
379389

skills/autonomous-dispatcher/scripts/autonomous.conf.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,18 @@ PROJECT_DIR="/path/to/project"
1515
# First-class support: claude, codex, kiro, opencode. Other CLIs work via
1616
# the generic `<cli> -p <prompt>` fallback. See README "Supported Agent
1717
# CLIs" for resume semantics per CLI.
18+
#
19+
# opencode prerequisites (provider-agnostic CLI, no defaults):
20+
# 1. Run `opencode providers login` once on this box to set up
21+
# credentials for at least one model provider.
22+
# 2. Set AGENT_DEV_MODEL and AGENT_REVIEW_MODEL below to explicit
23+
# `provider/model` strings (e.g. "anthropic/claude-sonnet-4-6").
24+
# Leaving them empty leaves opencode without a model to call.
1825
AGENT_CMD="claude"
26+
# AGENT_DEV_MODEL / AGENT_REVIEW_MODEL: model passed via the CLI's
27+
# --model flag. Empty = let the CLI pick its default (claude/codex
28+
# only — opencode has no default and will fail if both are empty when
29+
# AGENT_CMD=opencode).
1930
AGENT_DEV_MODEL=""
2031
AGENT_REVIEW_MODEL="sonnet"
2132
# WARNING: 'bypassPermissions' grants the agent unrestricted shell access.

0 commit comments

Comments
 (0)