fix: load review backend managers only when selected - #6699
Merged
atomantic merged 2 commits intoSep 9, 2026
Merged
Conversation
atomantic
deleted the
cos/app-improve-portos-default-module-hygiene-mttpq7ig/agent-c2788b8d
branch
September 9, 2026 06:34
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
Review-defaults callers imported LM Studio and Ollama download/install dependencies even when they never executed a local review. Load each manager only at the selected backend's existing async boundary, matching MTPLX. The review service's static closure shrinks from 149 to 138 modules.
server/services/codeReview.js:66owns endpoint dispatch and:359owns the Ollama capability gate.server/services/agentCliSpawning.test.js:110andserver/services/cleanupAgentWorktree.test.js:14explicitly document mock accommodations for the former eager manager dependency. Defaults are consumed by agent prompting, task generation, and completion cleanup.importScoping.test.js:149guard; no new public surface, catalog, wrapper, or migration.codeReview, merged PRs, and file history. Related feat: offer OpenCode, Kimi and MTPLX as code reviewers #5967/fall back to a local reviewer's served model so an unpinned mtplx review isn't blocked #6081 establish MTPLX behavior; A non-thinking ollama model makes every local reviewer AND the claim-comment gate fail, silently shrinking the claimable queue #5960/Local reviewer sends reasoning_effort to every ollama model, 400-ing on models without thinking support #6050/Local reviewer sends reasoning_effort to models that reject thinking, hard-failing the review and the claim comment gate #6060 cover thinking compatibility, which stays intact. Excluded declarative validation/registry/barrel size and rejected a broader service split because the existing async seam solves this finding without moving exports.Test plan
services/codeReview.test.js,services/codeReview.providers.test.js,services/codeReview.backendLoading.test.js,routes/codeReview.test.js,lib/importScoping.test.js,services/agentCliSpawning.test.js, andservices/cleanupAgentWorktree.test.js(npm test --prefix server -- --run ...).git diff --checkpassed.