fall back to a local reviewer's served model so an unpinned mtplx review isn't blocked - #6081
Merged
Merged
Conversation
…iew isn't blocked A review loop configured with `mtplx` and no `mtplxModel` scalar failed every pass with "No model configured for mtplx reviewer", which the agent's local-review script maps to `no-verdict` — review-blocked, while the MTPLX daemon was up and serving exactly one model. The model id carried no information there: a single-model daemon (MTPLX, llama.cpp, vLLM, or LM Studio with one model loaded) answers "which model?" unambiguously. `runToolFreeLocalCompletion` now probes the backend's own `/v1/models` (via the shared `probeOpenAiModels`) when no model is pinned and uses the answer when the backend serves exactly one. Ambiguity is never guessed: several models (an ordinary Ollama install lists every one it has), none, or an unreadable listing still error, now naming which of those it was. Results report the model the pass actually ran with. The failure also carries `code: 'NO_MODEL'`, so a config gap maps to 400 at `POST /api/code-review/local` and to `RECHECK_NO_MODEL` in the challenge re-check, instead of the 502 bucket meant for a reviewer that ran and failed. Also fixes the re-check's model read, which used an ollama-or-lmstudio ternary and so handed any third local backend LM Studio's model id.
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
mtplxand nomtplxModelscalar failed every pass withNo model configured for mtplx reviewer— which the agent's local-review script maps tono-verdict, i.e. review-blocked — while the MTPLX daemon was up and serving exactly one model.runToolFreeLocalCompletionnow resolves an unpinned model from the backend's own/v1/modelslisting (via the sharedprobeOpenAiModels) and uses it when the backend serves exactly one — the single-model-daemon case (MTPLX, llama.cpp, vLLM, LM Studio with one model loaded).code: 'NO_MODEL', so a config gap maps to 400 atPOST /api/code-review/localand toRECHECK_NO_MODELin the challenge re-check, rather than the 502 bucket meant for a reviewer that ran and failed.<backend>Model, matching the route.Test plan
cd server && npm test— full suite green (1908 files).server/services/codeReview.test.js: single served model is used (and the MTPLX/v1root isn't doubled in the probe URL), several models refuse to guess with no review request sent, an unreachable backend says so, and an up-but-empty backend still asks for a pin.server/routes/codeReview.test.js(400 onNO_MODEL) andserver/services/cosTaskStore.test.js(per-backend scalar, unpinned delegation,RECHECK_NO_MODELpassthrough).mtplxreview resolved the served model and returned real findings on a seeded typo diff.