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
* feat(providers): add opencode CLI provider
* test(providers): add unit tests for opencode CLI provider
* fix(providers): address code review for opencode provider
- Replace --dangerously-skip-permissions with read-only permission profile
via OPENCODE_CONFIG_CONTENT env var (deny: edit, bash, external_directory,
doom_loop)
- Add model discovery via 'opencode models' to show available models in UI
- Fix model name format to use provider/model (e.g., deepseek/deepseek-v4-pro)
- Fix install command to use curl instead of npm
- Remove dead rate-limiter entry (opencode uses semaphore serialization)
- Accumulate tokens across multi-step runs instead of overwriting
- Fix redundant except clause
- Update tests to verify security config and model discovery
* fix(providers): tighten read-only permission profile for opencode
Add webfetch, websearch, and task to deny set to prevent:
- task subagent bypassing top-level edit/bash denies
- network egress for data exfiltration from private repos
- Subclass `BaseProvider` and implement `generate()`, `provider_name`, `model_name`
97
+
- For local CLI providers, use `asyncio.create_subprocess_exec` (never `shell=True`), validate user-supplied model names against a safe character set, and resolve paths with `Path.resolve()`
98
+
- See `opencode.py` for a clean reference implementation
99
+
100
+
2.**Register** in `registry.py` — add to `_BUILTIN_PROVIDERS` and the `_missing` package map
101
+
102
+
3.**Wire up configuration** in these files:
103
+
-`rate_limiter.py` — add `RateLimitConfig` to `PROVIDER_DEFAULTS`
104
+
-`provider_config.py` — add entry to `PROVIDER_CATALOG`
105
+
-`provider_selection.py` — add to `_PROVIDER_DEFAULTS`, `_PROVIDER_ENV`, `_PROVIDER_SIGNUP`, and detection
106
+
-`helpers.py` — add validation in `validate_provider_config()`
107
+
108
+
4.**Update the web UI** — add to `PROVIDERS`, `MODEL_PLACEHOLDERS`, and `PROVIDER_ENV_VARS` in `provider-section.tsx` and `run-config-form.tsx`
109
+
110
+
5.**Add tests** in `tests/unit/test_providers/` — mock the subprocess, test success/error/timeout paths (see `test_codex_cli_provider.py` for the pattern)
111
+
112
+
6.**Write docs** — `docs/<NAME>.md` and `website/<name>.md`, following `docs/CODEX.md` and `docs/OPENCODE.md`.
113
+
93
114
Adding a new language or LLM provider has a dedicated recipe — see
Copy file name to clipboardExpand all lines: docs/CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
---
11
11
12
+
## [Unreleased]
13
+
14
+
### Added
15
+
-**OpenCode CLI provider.** A new local OpenCode LLM provider runs documentation generation through the local OpenCode CLI via `opencode run --format json`. Uses `asyncio.create_subprocess_exec` (no shell), parses JSONL output, validates model names against a safe character set, and treats `opencode/*` cost as `$0.00`. No API keys are stored — OpenCode manages its own auth and model selection through its provider system. Interactive selection detects the OpenCode CLI on `PATH` and shows helpful install/setup instructions when it's missing.
0 commit comments