Repository navigation
Commit 175c1b7
feat: configure zai-coding-plan auth via env var + provider pin (#64)
## Summary
Configures `zai-coding-plan` provider authentication using environment
variables (no `opencode auth login` needed) and pins the base URL as a
workaround for
[opencode#11106](anomalyco/opencode#11106).
**Design decision:** Environment variables are sufficient for container
auth. OpenCode resolves credentials in priority order: env vars > `.env`
file > `auth.json`. Env vars take precedence over `auth.json`, need no
interactive TTY, and are the recommended path for containers. The
entrypoint deliberately does NOT call `opencode auth login`.
## Changes
- **`build/etc/opencode/opencode.jsonc`** — Pin
`provider.zai-coding-plan.options.baseURL` to
`https://api.z.ai/api/coding/paas/v4` (workaround for opencode#11106)
- **`AGENTS.md`** — Add Provider Authentication section with credential
priority + `ZHIPU_API_KEY` table; clarify `OMO_*` flags are subscription
toggles, not credentials
- **`docs/guides/configuration.md`** — Add user-facing Provider
Authentication section with `ZHIPU_API_KEY` docs, credential priority,
and `podman run` example
## Usage
```bash
podman run -it --rm \
-e ZHIPU_API_KEY=your-key-here \
-e OMO_ZAI_CODING_PLAN=yes \
opencoder
```
- `ZHIPU_API_KEY` — provides the API credential (auth)
- `OMO_ZAI_CODING_PLAN=yes` — enables ZAI models in agent fallback
chains (subscription toggle)
Both are needed for the models to work.
## Verification
- `validate.sh`: 35/36 passed, 0 failed (1 pre-existing warning)
- JSONC parsed clean — provider config intact with correct URL
- `opencode.json` validated via `jq`
## Commits
1. `feat(config): pin zai-coding-plan base URL in opencode.jsonc`
2. `docs(agents): document ZHIPU_API_KEY provider auth`
3. `docs: document ZHIPU_API_KEY for zai-coding-plan auth`
Ultraworked with
[Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
---------
Co-authored-by: Sisyphus <[email protected]>1 parent 2a14395 commit 175c1b7
3 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
304 | 312 | | |
305 | 313 | | |
306 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 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 | + | |
169 | 197 | | |
170 | 198 | | |
171 | 199 | | |
| |||
0 commit comments