Turn the reviewer chain into a shared Provider/Model/Optional/Max-Iterations table#3150
Merged
Conversation
…l/Optional/Max table (#3133) Code Review Defaults rendered reviewers as a chip row plus a stack of panel-local per-backend model selects, so per-reviewer model choice existed only on that one page — TaskAddForm, ScheduleTab, and SlashDoRunDrawer all reuse ReviewerPicker but had no way to set a reviewer's model. Move the model picker into ReviewerPicker as a Model column and lay each reviewer out as a row: Provider | Model | Optional | Max Iterations. The picker stays fetch-free — callers pass resolved option lists via the new useReviewerModelOptions hook, so all four surfaces offer the same models. The pin now travels per task, not just per install: `reviewerModels` is a token-keyed map alongside `reviewerMaxRounds` (same normalizer/resolver/ task-over-default precedence), emitted as slashdo's `[<model>]` selector between the slug and the `~opt`/`~max` suffixes. Local-LLM pins ride the same map because /api/code-review/local resolves its default from global settings and can't see a task-level choice — the follow-up prompt names it in the request body instead. settings.codeReview keeps its `<reviewer>Model` scalars as the persisted encoding (it crosses installs); client/src/lib/reviewerModels.js is the one adapter between those and the map.
…op a model id that would corrupt the emitted token Two findings from the codex review pass: - The run drawer rendered the reviewer picker for every `/do:*` command, but only the `next` branch of POST /tasks/slashdo reads the reviewer fields — every other body owns its own review/PR sequence. A user could pick a reviewer and a model and have the run discard both. Pre-existing for the other three reviewer controls; the Model column would have been a fourth. Gate the picker (and the submit payload) on `isNext`. - A model id is interpolated straight into slashdo's `[<model>]` selector, which has no escape for its own delimiters: `foo]~opt` closes the selector early and leaves slashdo parsing the remainder as a suffix, and a comma splits one entry into two. Drop an id carrying `[`, `]`, `,`, or a line break server-side (the reviewer falls back to its own default rather than running against a corrupt list) and strip those characters as the user types. A space stays legal — `agy[Gemini 3.5 Flash (High)]` is valid.
…s too, so a saved pin can't display but never apply The Code Review Defaults scalars (`codexModel` etc.) accepted any string, so a hand-edited settings.json could hold an id the token builders then drop — the picker would show the pin while no reviewer ever received it. Extract the single-value check (`normalizeReviewerModel`) and run all three paths through it: the token-keyed map normalizer, the settings scalars at write time, and `reviewerModelsFromDefaults` on read (re-checked, not trusted, since the file is hand-editable). Mirror the read-side check client-side. `pickCodeReviewDefaults` stays a faithful mirror on purpose: those scalars also feed /api/code-review/local as a JSON body field, where a delimiter is harmless, so narrowing them there would reject an id that path can legitimately use.
atomantic
force-pushed
the
claim/issue-3133
branch
from
July 27, 2026 09:14
6a16bb8 to
d0f61b1
Compare
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
Code Review Defaults rendered reviewers as a chip row plus a stack of panel-local per-backend model
<select>s below it. That model-picking logic lived inCodeReviewDefaultsPanel.jsx, never in the sharedReviewerPicker.jsx— so the three other surfaces that reuse the picker (TaskAddForm.jsx,GlobalConfigControls.jsx,SlashDoRunDrawer.jsx) had no way to set a reviewer's model at all.This moves the model picker into
ReviewerPickerand lays each reviewer out as a row with all four of its controls as columns: Provider | Model | Optional | Max Iterations. Reorder / remove /~opt/~maxall move into the row and keep working. Undersmthe row collapses to a stacked labelled block rather than scrolling horizontally.Closes #3133 (#3123 shipped in #3146, so the Max Iterations column is included rather than deferred).
The picker stays fetch-free. Callers pass resolved option lists via
modelOptions, produced by the newuseReviewerModelOptionshook (local-LLM ids from/api/local-llm/status, codex/claude tiers from/api/providers, with claude's list also spanning installed Ollama ids for an Ollama-backed CLI). All four surfaces therefore offer the same options. Passing nothing degrades every Model cell to free-text rather than hiding the column.Model cell shape follows what's knowable. A local backend's installed list is authoritative, so it renders a closed
<select>; a CLI reviewer renders text +<datalist>, because an Ollama-backedclaudeor a Bedrock-form id is environment-specific and a closed list would lock out valid ids. A pin the probe no longer lists still gets an<option>so the select can't render blank and read as unset.The pin now travels per task, not just per install.
reviewerModelsis a token-keyed map alongsidereviewerMaxRounds, with the same normalizer / resolver / task-over-default precedence and the same absent-vs-empty discipline (an explicit{}means "each reviewer's own default"; clearing a field DELETES the key rather than persisting'', which would emit a--modelwith no id). It is emitted as slashdo's[<model>]selector, placed between the slug and the~opt/~maxsuffixes — slashdo's parser strips those suffixes from the right before reading the bracket, so the order is load-bearing.copilot/@login/lmstudionever get a bracket (no slashdo slug takes one).Local-LLM pins ride the same map deliberately.
POST /api/code-review/localresolves its default model from global settings and has never seen the task, so a per-task local pin would silently do nothing if dropped as a CLI-only concern.resolveReviewLoopOptionskeeps it and the follow-up prompt names it in the request body instead.Persisted encoding is unchanged.
settings.codeReviewkeeps its<reviewer>Modelscalars — that encoding crosses installs, so rewriting it to a map would need a migration for zero gain.client/src/lib/reviewerModels.js(mirroringreviewerModelsFromDefaultsserver-side) is the one adapter between the scalars and the map. No migration needed.From the review rounds
isNext. Only thenextbranch ofPOST /tasks/slashdoreads the reviewer fields; every other/do:*body owns its own review/PR sequence. Rendering the picker there let a user choose a reviewer and have the run discard it — pre-existing for the three older controls, and the Model column would have been a fourth. The submit payload states the same contract rather than leaning on the picker being unrendered.[,],,and line breaks are structural in[<model>]with no escape —foo]~optcloses the selector early and leaves slashdo parsing the remainder as a suffix, and a comma splits one entry into two. Such an id is dropped server-side (the reviewer falls back to its own default rather than running against a corrupt list) and stripped as the user types. A space stays legal:agy[Gemini 3.5 Flash (High)]is a valid slashdo entry.settings.jsoncould hold an id the token builders then drop — the picker would display a pin no reviewer ever received. All three paths (map normalizer, scalars at write time,reviewerModelsFromDefaultson read) now share onenormalizeReviewerModelcheck.pickCodeReviewDefaultsstays a faithful mirror on purpose: those scalars also feed/api/code-review/localas a JSON body field where a delimiter is harmless.Test plan
cd client && npm test— 470 files / 5242 tests pass.ReviewerPicker.test.jsxgrew from 29 to 46 tests: all 15 pre-existing reorder/remove/~opt/~maxcases pass unmodified against the new table (the contract didn't change, only the layout), plus new coverage for the Model column — which reviewers get a cell, select-vs-free-text, an uninstalled pin staying visible, clear-deletes-rather-than-empty-string, whitespace-only treated as a clear, delimiter stripping, pruning on remove, the three per-row controls staying independent, and case-insensitive key reads.SlashDoRunDrawer.test.jsxadds two cases pinning the non-nextgate.cd server && npm test— the reviewer-related suites (validation,cosroutes,settingsroutes,codeReview,cosTaskGenerator,agentPromptBuilder,cleanupAgentWorktree) pass: 659 tests. New server coverage fornormalizeReviewerModels/resolveReviewerModels/reviewerModelsFromDefaults(including the re-check on read), the[<model>]emission in both token builders (bracket-before-suffix ordering, the never-bracket cases, delimiter rejection), the sanitizer, and both schemas.pipeline/seriesStore/store,writersRoom/store,lib/dataRoot) on cleanmain, where they fail identically. CI, which does provision Postgres, is green.cd client && npm run lintclean;npm run buildsucceeds.test (24.x), Client tests and build, DB tests and server smoke, Plan test impact, CI Gate.