validate a public-review stage's model pin against the provider's own model list - #6127
Merged
Merged
Conversation
… model list A pr-reviewer stage pin survives edits to its provider's `models` list, so the live Eligibility Gate sat pinned to a model its provider no longer offered. The pin guard only checked that the pinned PROVIDER matched the resolved one, so the stale id was handed to the CLI as a model it could not serve: the stage spawned, exited in ~12s with no output, and was retried through a fresh task id — roughly 20 spawns in five minutes. Require the resolved provider to actually offer the pinned model, mirroring the check the ordinary resolution path and `cliProviderRun.js` already make. A provider that enumerates no models stays a pass-through. The unbounded retry that the empty run then caused is tracked in #6124.
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
modelslist. The live Eligibility Gate was pinned to a model its provider no longer offered, and the guard only checked that the pinned provider matched the resolved one — so the stale id reached the CLI as a model it could not serve.resolvePublicReviewAgentProvidernow also requires the resolved provider to offer the pinned model, mirroring the check the ordinary resolution path andcliProviderRun.js#resolveCliProviderAndModelalready make. A provider that enumerates no models stays a pass-through.Found while driving the pr-reviewer automation over the five open contributor PRs (all now reviewed and merged).
Test plan
server/services/agentProviderResolution.test.js— 29/29, with two new cases: a pin the matching provider no longer offers falls back to the provider's own selection, and a pin on a provider that enumerates no models is still honored.pinIsOffered = truefails the new test, confirming it catches the defect rather than restating the implementation.prReviewerPipeline.test.js+prReviewerSecurity.test.js— 46/46 together with the above.Follow-ups filed
opencode-ollama-tuicannot serve any ollama model on this install; needs a readiness probe so a broken provider reports unavailable instead of failing at spawn.