Commit 1851e51
fix: use ANTHROPIC_API_KEY for opencode agent in gh-action (#383)
## Summary
- OpenCode is a multi-provider tool with no single API key.
`AgentEnvVar()` previously fell through to the `default` case returning
`OPENAI_API_KEY`, which was confusing and misleading.
- Default to `ANTHROPIC_API_KEY` for the opencode agent, matching
[OpenCode's own GitHub Actions docs](https://opencode.ai/docs/github/).
- Add guidance in the generated workflow preamble and CLI next-steps
output telling users to swap the secret if they use a different model
provider (e.g., `OPENAI_API_KEY`, `GOOGLE_API_KEY`).
Closes #325
## Test plan
- [x] `TestAgentEnvVar/opencode` — verifies opencode maps to
`ANTHROPIC_API_KEY`
- [x] `TestGenerate/opencode_uses_ANTHROPIC_API_KEY` — verifies workflow
output contains `ANTHROPIC_API_KEY` and the "different model provider"
guidance
- [x] `TestGenerate/dedupes_env_vars` — claude-code + opencode share a
key, deduped to one entry
- [x] `TestAgentSecrets/codex_and_opencode_have_separate_keys` — codex
and opencode no longer incorrectly dedupe
- [x] `TestGhActionCmd` — all CLI subtest variants pass
- [x] Full `go test -race ./internal/ghaction/... ./cmd/roborev/...`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 05b27f8 commit 1851e51
File tree
3 files changed
+52
-13
lines changed- cmd/roborev
- internal/ghaction
3 files changed
+52
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
256 | 263 | | |
257 | 264 | | |
| 265 | + | |
258 | 266 | | |
259 | 267 | | |
260 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
202 | 218 | | |
203 | 219 | | |
204 | 220 | | |
205 | | - | |
| 221 | + | |
206 | 222 | | |
207 | 223 | | |
208 | | - | |
| 224 | + | |
209 | 225 | | |
210 | 226 | | |
211 | 227 | | |
212 | | - | |
213 | | - | |
| 228 | + | |
| 229 | + | |
214 | 230 | | |
215 | 231 | | |
216 | 232 | | |
| |||
262 | 278 | | |
263 | 279 | | |
264 | 280 | | |
265 | | - | |
| 281 | + | |
266 | 282 | | |
267 | 283 | | |
268 | 284 | | |
269 | 285 | | |
270 | | - | |
| 286 | + | |
271 | 287 | | |
272 | 288 | | |
273 | 289 | | |
| |||
453 | 469 | | |
454 | 470 | | |
455 | 471 | | |
456 | | - | |
| 472 | + | |
457 | 473 | | |
458 | 474 | | |
459 | 475 | | |
| |||
482 | 498 | | |
483 | 499 | | |
484 | 500 | | |
485 | | - | |
| 501 | + | |
486 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
487 | 509 | | |
488 | | - | |
| 510 | + | |
489 | 511 | | |
490 | 512 | | |
491 | 513 | | |
| |||
0 commit comments