-
Notifications
You must be signed in to change notification settings - Fork 0
fix(autofix): resolve live NVIDIA NIM models instead of a retired pin #1172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7536d97
fddd6ee
656d506
6315f50
6cdd24a
acac253
1a887a7
ee33f66
6d28e6a
1df5004
924da99
b7dcb63
fad116f
5d0869b
15531dd
c67bb0f
df68dbf
edab578
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,6 +247,39 @@ jobs: | |
| python3 "$GITHUB_WORKSPACE/trusted-autofix-source/scripts/ci/pr_review_autofix_context.py" \ | ||
| "${context_args[@]}" | ||
|
|
||
| - name: Resolve live NVIDIA NIM autofix models | ||
| env: | ||
| NVIDIA_API_KEY: ${{ secrets.NVIDIA_NIM_API_KEY }} | ||
| # Ordered preference pools. NVIDIA retires hosted models on published | ||
| # end-of-life dates and then answers HTTP 410 Gone, so the worker | ||
| # resolves the first pool entry the provider still serves instead of | ||
| # hard-coding one id that a lifecycle event can retire. | ||
| AUTOFIX_MODEL_CANDIDATES: >- | ||
| ${{ vars.NVIDIA_NIM_AUTOFIX_MODEL_CANDIDATES || | ||
| 'nvidia/llama-3.3-nemotron-super-49b-v1.5 nvidia/nemotron-3-super-120b-a12b | ||
| nvidia/llama-3.1-nemotron-ultra-253b-v1' }} | ||
| AUTOFIX_SMALL_MODEL_CANDIDATES: >- | ||
| ${{ vars.NVIDIA_NIM_AUTOFIX_SMALL_MODEL_CANDIDATES || 'nvidia/nemotron-3-nano-30b-a3b nvidia/llama-3.1-nemotron-nano-8b-v1' }} | ||
| run: | | ||
| set -euo pipefail | ||
| if [ -z "${NVIDIA_API_KEY:-}" ]; then | ||
| echo "::error::NVIDIA_NIM_API_KEY is required for scheduled OpenCode autofix." | ||
| exit 1 | ||
| fi | ||
| resolver="$GITHUB_WORKSPACE/trusted-autofix-source/scripts/ci/select_nvidia_nim_model.py" | ||
| autofix_model_id="$( | ||
| python3 "$resolver" --role primary --candidates "$AUTOFIX_MODEL_CANDIDATES" | ||
| )" | ||
| autofix_small_model_id="$( | ||
| python3 "$resolver" --role small --candidates "$AUTOFIX_SMALL_MODEL_CANDIDATES" | ||
| )" | ||
| echo "Resolved autofix model: ${autofix_model_id}" | ||
| echo "Resolved autofix small model: ${autofix_small_model_id}" | ||
| { | ||
| printf 'AUTOFIX_MODEL_ID=%s\n' "$autofix_model_id" | ||
| printf 'AUTOFIX_SMALL_MODEL_ID=%s\n' "$autofix_small_model_id" | ||
| } >>"$GITHUB_ENV" | ||
|
Comment on lines
+270
to
+281
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Resolved model ids propagate correctly via GITHUB_ENV The resolve step exports Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| - name: Prepare isolated OpenCode autofix workspace | ||
| env: | ||
| OPENCODE_AUTOFIX_WORKDIR: ${{ runner.temp }}/opencode-autofix-project | ||
|
|
@@ -277,10 +310,13 @@ jobs: | |
| Do not execute shell commands. Do not invent broad features or claim external approval/check latency is fixed. | ||
| Queued reviews or checks remain merge blockers, but their latency is not a reason to invent a code change or stop the broader scheduler from processing other eligible work. | ||
| EOF | ||
| jq -n --arg workspace "$TARGET_WORKSPACE" '{ | ||
| jq -n \ | ||
| --arg workspace "$TARGET_WORKSPACE" \ | ||
| --arg model_id "$AUTOFIX_MODEL_ID" \ | ||
| --arg small_model_id "$AUTOFIX_SMALL_MODEL_ID" '{ | ||
|
seonghobae marked this conversation as resolved.
|
||
| "$schema": "https://opencode.ai/config.json", | ||
| "model": "nvidia-nim/mistralai/mistral-small-4-119b-2603", | ||
| "small_model": "nvidia-nim/nvidia/nemotron-3-nano-30b-a3b", | ||
| "model": "nvidia-nim/\($model_id)", | ||
| "small_model": "nvidia-nim/\($small_model_id)", | ||
| "enabled_providers": ["nvidia-nim"], | ||
| "permission": { | ||
| "edit": { | ||
|
|
@@ -306,8 +342,7 @@ jobs: | |
| "ci-autofix": { | ||
| "description": "Conservative CI pull request review autofix agent", | ||
| "mode": "primary", | ||
| "model": "nvidia-nim/mistralai/mistral-small-4-119b-2603", | ||
| "reasoningEffort": "high", | ||
| "model": "nvidia-nim/\($model_id)", | ||
|
seonghobae marked this conversation as resolved.
|
||
| "prompt": "{file:./autofix-prompt.md}", | ||
| "steps": 12, | ||
| "permission": { | ||
|
|
@@ -341,8 +376,8 @@ jobs: | |
| "apiKey": "{env:NVIDIA_API_KEY}" | ||
| }, | ||
| "models": { | ||
| "mistralai/mistral-small-4-119b-2603": { | ||
| "name": "Mistral Small 4 119B 2603", | ||
| ($model_id): { | ||
| "name": $model_id, | ||
|
seonghobae marked this conversation as resolved.
|
||
| "tool_call": true, | ||
| "reasoning": true, | ||
| "options": { | ||
|
|
@@ -353,8 +388,8 @@ jobs: | |
| "output": 4096 | ||
| } | ||
| }, | ||
| "nvidia/nemotron-3-nano-30b-a3b": { | ||
| "name": "Nemotron 3 Nano 30B A3B", | ||
| ($small_model_id): { | ||
| "name": $small_model_id, | ||
| "tool_call": true, | ||
| "reasoning": true, | ||
| "limit": { | ||
|
seonghobae marked this conversation as resolved.
seonghobae marked this conversation as resolved.
seonghobae marked this conversation as resolved.
|
||
|
|
@@ -371,7 +406,6 @@ jobs: | |
| if: env.RESOLVE_CONFLICT != 'true' | ||
| env: | ||
| NVIDIA_API_KEY: ${{ secrets.NVIDIA_NIM_API_KEY }} | ||
| MODEL: nvidia-nim/mistralai/mistral-small-4-119b-2603 | ||
| SHARE: "false" | ||
| NPM_CONFIG_IGNORE_SCRIPTS: "true" | ||
| NO_COLOR: "1" | ||
|
|
@@ -382,6 +416,11 @@ jobs: | |
| echo "::error::NVIDIA_NIM_API_KEY is required for scheduled OpenCode autofix." | ||
| exit 1 | ||
| fi | ||
| if [ -z "${AUTOFIX_MODEL_ID:-}" ]; then | ||
| echo "::error::Resolved NVIDIA NIM autofix model is missing." | ||
| exit 1 | ||
| fi | ||
| MODEL="nvidia-nim/${AUTOFIX_MODEL_ID}" | ||
| prompt_file="${RUNNER_TEMP}/opencode-autofix-prompt.md" | ||
| allowed_paths_zlist="${RUNNER_TEMP}/pr-review-autofix-allowed-paths.zlist" | ||
| allowed_paths_context="$( | ||
|
|
@@ -546,7 +585,6 @@ jobs: | |
| GITHUB_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN || secrets.OPENCODE_APPROVE_TOKEN || steps.target_app_token.outputs.token }} | ||
| GH_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN || secrets.OPENCODE_APPROVE_TOKEN || steps.target_app_token.outputs.token }} | ||
| MUTATION_CREDENTIAL_AVAILABLE: ${{ secrets.PR_REVIEW_MERGE_TOKEN != '' || secrets.OPENCODE_APPROVE_TOKEN != '' || steps.target_app_token.outputs.available == 'true' }} | ||
| MODEL: nvidia-nim/mistralai/mistral-small-4-119b-2603 | ||
| SHARE: "false" | ||
| NPM_CONFIG_IGNORE_SCRIPTS: "true" | ||
| NO_COLOR: "1" | ||
|
|
@@ -561,6 +599,11 @@ jobs: | |
| echo "::error::NVIDIA_NIM_API_KEY is required for scheduled OpenCode autofix." | ||
| exit 1 | ||
| fi | ||
| if [ -z "${AUTOFIX_MODEL_ID:-}" ]; then | ||
| echo "::error::Resolved NVIDIA NIM autofix model is missing." | ||
| exit 1 | ||
| fi | ||
| MODEL="nvidia-nim/${AUTOFIX_MODEL_ID}" | ||
| cd "$TARGET_WORKSPACE" | ||
|
|
||
| # Merge the base branch into the detached head. A clean merge stays | ||
|
|
||
|
seonghobae marked this conversation as resolved.
|
Uh oh!
There was an error while loading. Please reload this page.