Skip to content

fall back to a local reviewer's served model so an unpinned mtplx review isn't blocked - #6081

Merged
atomantic merged 1 commit into
mainfrom
cos/task-mtloks4z/agent-878f9fa1
Sep 3, 2026
Merged

fall back to a local reviewer's served model so an unpinned mtplx review isn't blocked#6081
atomantic merged 1 commit into
mainfrom
cos/task-mtloks4z/agent-878f9fa1

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • 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, i.e. review-blocked — while the MTPLX daemon was up and serving exactly one model.
  • runToolFreeLocalCompletion now resolves an unpinned model from the backend's own /v1/models listing (via the shared probeOpenAiModels) and uses it when the backend serves exactly one — the single-model-daemon case (MTPLX, llama.cpp, vLLM, LM Studio with one model loaded).
  • 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, instead of a bare config message.
  • The no-model failure 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, rather than the 502 bucket meant for a reviewer that ran and failed.
  • Results (and the re-check's resolution note) report the model the pass actually ran with, not the absent argument.
  • Drive-by fix: the challenge re-check read its model from an ollama-or-lmstudio ternary, so any third local backend got LM Studio's model id. It now reads <backend>Model, matching the route.

Test plan

  • cd server && npm test — full suite green (1908 files).
  • New coverage in server/services/codeReview.test.js: single served model is used (and the MTPLX /v1 root 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.
  • New coverage in server/routes/codeReview.test.js (400 on NO_MODEL) and server/services/cosTaskStore.test.js (per-backend scalar, unpinned delegation, RECHECK_NO_MODEL passthrough).
  • Verified live against the local MTPLX daemon: an unpinned mtplx review resolved the served model and returned real findings on a seeded typo diff.

…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.
@atomantic
atomantic merged commit 7030ffa into main Sep 3, 2026
7 checks passed
@atomantic
atomantic deleted the cos/task-mtloks4z/agent-878f9fa1 branch September 3, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant