Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 102 additions & 4 deletions .github/workflows/opencode-review-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3411,9 +3411,9 @@ jobs:

jq -n '{
"$schema": "https://opencode.ai/config.json",
"model": "github-models/deepseek/deepseek-r1-0528",
"small_model": "github-models/deepseek/deepseek-v3-0324",
"enabled_providers": ["opencode-free", "opencode", "openai", "openrouter", "github-models"],
"model": "nvidia-nim/nvidia/llama-3.3-nemotron-super-49b-v1.5",
"small_model": "nvidia-nim/meta/llama-3.3-70b-instruct",
"enabled_providers": ["nvidia-nim", "opencode-free", "opencode", "openai", "openrouter", "github-models"],
"lsp": false,
"mcp": {},
"permission": {
Expand Down Expand Up @@ -3714,6 +3714,96 @@ jobs:
}
}
},
"nvidia-nim": {
"npm": "@ai-sdk/openai-compatible",
"name": "NVIDIA NIM",
"options": {
"baseURL": "https://integrate.api.nvidia.com/v1",
"apiKey": "{env:NVIDIA_API_KEY}"
},
"models": {
"nvidia/llama-3.3-nemotron-super-49b-v1.5": {
"name": "NVIDIA Llama 3.3 Nemotron Super 49B v1.5",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"nvidia/llama-3.1-nemotron-ultra-253b-v1": {
"name": "NVIDIA Llama 3.1 Nemotron Ultra 253B",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"nvidia/nemotron-3-super-120b-a12b": {
"name": "NVIDIA Nemotron 3 Super 120B",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"nvidia/nemotron-3-ultra-550b-a55b": {
"name": "NVIDIA Nemotron 3 Ultra 550B",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"meta/llama-3.3-70b-instruct": {
"name": "Meta Llama 3.3 70B Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"meta/llama-3.1-70b-instruct": {
"name": "Meta Llama 3.1 70B Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"deepseek-ai/deepseek-v4-pro": {
"name": "DeepSeek V4 Pro (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"mistralai/mistral-large-2-instruct": {
"name": "Mistral Large 2 Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"mistralai/codestral-22b-instruct-v0.1": {
"name": "Codestral 22B Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 32768,
"output": 8192
}
},
"google/gemma-4-31b-it": {
"name": "Gemma 4 31B IT (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
}
}
},
"github-models": {
"npm": "@ai-sdk/openai-compatible",
"name": "GitHub Models",
Expand Down Expand Up @@ -3920,6 +4010,12 @@ jobs:
}
}' >"${OPENCODE_REVIEW_WORKDIR}/opencode.jsonc"


if ! grep -Fq 'nvidia-nim' "${OPENCODE_REVIEW_WORKDIR}/opencode.jsonc" \
|| ! grep -Fq 'integrate.api.nvidia.com' "${OPENCODE_REVIEW_WORKDIR}/opencode.jsonc"; then
echo '::error::Generated isolated opencode.jsonc is missing the nvidia-nim provider; refusing to run the model pool without NIM priority.'
exit 1
fi
printf 'Prepared isolated OpenCode review workspace: %s\n' "$OPENCODE_REVIEW_WORKDIR"

- name: Run OpenCode PR Review model pool
Expand All @@ -3937,6 +4033,7 @@ jobs:
# in the opencode.jsonc "openai" provider block.
OPENCODE_API_KEY: ${{ secrets.OPENCODE_ZEN_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
SHARE: "false"
NPM_CONFIG_IGNORE_SCRIPTS: "true"
Expand All @@ -3958,7 +4055,7 @@ jobs:
# cost-efficient tier, cheaper than the legacy gpt-5 it replaced
# ($1/$6 vs $1.25/$10 per 1M tokens) so the org OpenAI budget
# stretches further between top-ups.
OPENCODE_MODEL_CANDIDATES: "${{ needs.validate-pr-metadata.outputs.is_private == 'false' && 'opencode-free/nemotron-3-ultra-free opencode-free/deepseek-v4-flash-free opencode-free/north-mini-code-free opencode-free/laguna-s-2.1-free opencode-free/ling-3.0-flash-free opencode-free/big-pickle opencode-free/mimo-v2.5-free ' || '' }}opencode/gpt-5.6-terra github-models/deepseek/deepseek-v3-0324 openai/gpt-5.6-luna openrouter/deepseek/deepseek-v3.2 openrouter/qwen/qwen3-coder github-models/openai/gpt-4.1 github-models/openai/gpt-5 github-models/openai/gpt-5-chat github-models/openai/o3 github-models/deepseek/deepseek-r1-0528 github-models/deepseek/deepseek-r1"
OPENCODE_MODEL_CANDIDATES: "${{ needs.validate-pr-metadata.outputs.is_private == 'false' && 'opencode-free/nemotron-3-ultra-free opencode-free/deepseek-v4-flash-free opencode-free/north-mini-code-free opencode-free/laguna-s-2.1-free opencode-free/ling-3.0-flash-free opencode-free/big-pickle opencode-free/mimo-v2.5-free ' || '' }}nvidia-nim/nvidia/llama-3.3-nemotron-super-49b-v1.5 nvidia-nim/nvidia/llama-3.1-nemotron-ultra-253b-v1 nvidia-nim/nvidia/nemotron-3-super-120b-a12b nvidia-nim/meta/llama-3.3-70b-instruct nvidia-nim/deepseek-ai/deepseek-v4-pro nvidia-nim/mistralai/codestral-22b-instruct-v0.1 opencode/gpt-5.6-terra github-models/deepseek/deepseek-v3-0324 openai/gpt-5.6-luna openrouter/deepseek/deepseek-v3.2 openrouter/qwen/qwen3-coder github-models/openai/gpt-4.1 github-models/openai/gpt-5 github-models/openai/gpt-5-chat github-models/openai/o3 github-models/deepseek/deepseek-r1-0528 github-models/deepseek/deepseek-r1"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
# One attempt per model, then fall through to the next model. Retrying
# the SAME model 5x let a rate-limited/hung leader consume the whole
# step, so the pool never reached a healthy fallback model.
Expand Down Expand Up @@ -4592,6 +4689,7 @@ jobs:
# Exposed so the "openai" provider in opencode.jsonc resolves during the
# failed-check diagnosis opencode run that shares this config.
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
OPENCODE_APP_TOKEN: ${{ steps.opencode_app_token.outputs.token }}
OPENCODE_EVIDENCE_FILE: ${{ runner.temp }}/opencode-review-evidence.md
OPENCODE_FAILED_CHECK_EVIDENCE_FILE: ${{ runner.temp }}/opencode-failed-check-evidence.md
Expand Down
41 changes: 41 additions & 0 deletions docs/nvidia-nim-opencode-hotfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# NVIDIA NIM OpenCode model priority (hotfix)

## Why

OpenCode Agent failed to produce a usable review on the PR thread starting at
ContextualWisdomLab/fast-mlsirm#290 (`opencode-review` check **skipped**, no
`opencode-agent[bot]` review comment). Central review therefore prioritizes
**NVIDIA NIM** models as additional catalog candidates so the model pool can
still emit APPROVE / REQUEST_CHANGES when GitHub Models / free tiers stall.

## Changes

1. `opencode.jsonc`
- `enabled_providers`: `nvidia-nim` first, then `github-models`
- default `model` / `small_model` prefer NIM Nemotron / Llama 3.3
- new OpenAI-compatible provider `nvidia-nim` → `https://integrate.api.nvidia.com/v1`
with `apiKey: {env:NVIDIA_API_KEY}`
2. `.github/workflows/opencode-review-dispatch.yml`
- `OPENCODE_MODEL_CANDIDATES` prefixes six NIM models before existing pool
- binds `NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}`
3. `scripts/ci/run_opencode_review_model_pool.sh`
- skips `nvidia-nim/*` when `NVIDIA_API_KEY` is unset (same pattern as OpenRouter)

## Temporary permission bypass (hotfix only)

For this merge-aid hotfix only:

- Branch-protection / ruleset admin override may be used to land the central
`.github` change if required checks conflict during the hotfix window.
- **Do not** permanently weaken Security Scan, trivy-fs, osv-scan, or
CodeQL gates.
- **Do not** flip OpenCode agent `permission.edit` / `bash` from `deny` to
`allow` permanently; review agents remain read-only.
- Org secret `NVIDIA_API_KEY` must be set on ContextualWisdomLab for NIM pool
entries to execute; without it the pool falls through to prior candidates.

## Rollback

Remove the `nvidia-nim/*` prefixes from `OPENCODE_MODEL_CANDIDATES`, drop the
`nvidia-nim` provider block, and delete this note once GitHub Models / OpenCode
catalog reliability is restored.
96 changes: 93 additions & 3 deletions opencode.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://opencode.ai/config.json",
"model": "github-models/deepseek/deepseek-r1-0528",
"small_model": "github-models/deepseek/deepseek-v3-0324",
"enabled_providers": ["github-models"],
"model": "nvidia-nim/nvidia/llama-3.3-nemotron-super-49b-v1.5",
"small_model": "nvidia-nim/meta/llama-3.3-70b-instruct",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"enabled_providers": ["nvidia-nim", "github-models"],
"lsp": false,
"mcp": {},
"permission": {
Expand Down Expand Up @@ -281,6 +281,96 @@
}
}
}
},
"nvidia-nim": {
"npm": "@ai-sdk/openai-compatible",
"name": "NVIDIA NIM",
"options": {
"baseURL": "https://integrate.api.nvidia.com/v1",
"apiKey": "{env:NVIDIA_API_KEY}"
},
"models": {
"nvidia/llama-3.3-nemotron-super-49b-v1.5": {
"name": "NVIDIA Llama 3.3 Nemotron Super 49B v1.5",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"nvidia/llama-3.1-nemotron-ultra-253b-v1": {
"name": "NVIDIA Llama 3.1 Nemotron Ultra 253B",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"nvidia/nemotron-3-super-120b-a12b": {
"name": "NVIDIA Nemotron 3 Super 120B",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"nvidia/nemotron-3-ultra-550b-a55b": {
"name": "NVIDIA Nemotron 3 Ultra 550B",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"meta/llama-3.3-70b-instruct": {
"name": "Meta Llama 3.3 70B Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"meta/llama-3.1-70b-instruct": {
"name": "Meta Llama 3.1 70B Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"deepseek-ai/deepseek-v4-pro": {
"name": "DeepSeek V4 Pro (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"mistralai/mistral-large-2-instruct": {
"name": "Mistral Large 2 Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
},
"mistralai/codestral-22b-instruct-v0.1": {
"name": "Codestral 22B Instruct (NIM)",
"tool_call": true,
"limit": {
"context": 32768,
"output": 8192
}
},
"google/gemma-4-31b-it": {
"name": "Gemma 4 31B IT (NIM)",
"tool_call": true,
"limit": {
"context": 131072,
"output": 8192
}
}
}
}
}
}
11 changes: 11 additions & 0 deletions scripts/ci/run_opencode_review_model_pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ is_openrouter_candidate() {
esac
}

is_nvidia_nim_candidate() {
case "$1" in
nvidia-nim/*) return 0 ;;
*) return 1 ;;
esac
}

is_low_sensitivity_candidate() {
case "$1" in
openai/*-mini | openai/*-nano | \
Expand Down Expand Up @@ -372,6 +379,10 @@ should_skip_model_candidate() {
printf 'Skipping OpenCode %s because OPENROUTER_API_KEY is not configured; falling back to the next provider-qualified candidate.\n' "$model_candidate"
return 0
fi
if is_nvidia_nim_candidate "$model_candidate" && [ -z "${NVIDIA_API_KEY:-}" ]; then
printf 'Skipping OpenCode %s because NVIDIA_API_KEY is not configured; falling back to the next provider-qualified candidate.\n' "$model_candidate"
return 0
fi
return 1
}

Expand Down
Loading
Loading