fix: use ANTHROPIC_API_KEY for opencode agent in gh-action#383
Merged
Conversation
OpenCode is a multi-provider tool with no single API key of its own. It previously fell through to the default OPENAI_API_KEY, which was confusing. Default to ANTHROPIC_API_KEY (matching OpenCode's own GitHub Actions docs) and add a note in the workflow preamble telling users to swap the secret if they use a different model provider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AgentEnvVar()previously fell through to thedefaultcase returningOPENAI_API_KEY, which was confusing and misleading.ANTHROPIC_API_KEYfor the opencode agent, matching OpenCode's own GitHub Actions docs.OPENAI_API_KEY,GOOGLE_API_KEY).Closes #325
Test plan
TestAgentEnvVar/opencode— verifies opencode maps toANTHROPIC_API_KEYTestGenerate/opencode_uses_ANTHROPIC_API_KEY— verifies workflow output containsANTHROPIC_API_KEYand the "different model provider" guidanceTestGenerate/dedupes_env_vars— claude-code + opencode share a key, deduped to one entryTestAgentSecrets/codex_and_opencode_have_separate_keys— codex and opencode no longer incorrectly dedupeTestGhActionCmd— all CLI subtest variants passgo test -race ./internal/ghaction/... ./cmd/roborev/...🤖 Generated with Claude Code