Skip to content

[github] feat: model selection — antagonistic review + Cindi + Specialist Agents UI tab (Phase 1)#4123

Open
mabry1985 wants to merge 1 commit into
mainfrom
feature/github-feat-model-selection-antagonistic-review-5b7ad9z
Open

[github] feat: model selection — antagonistic review + Cindi + Specialist Agents UI tab (Phase 1)#4123
mabry1985 wants to merge 1 commit into
mainfrom
feature/github-feat-model-selection-antagonistic-review-5b7ad9z

Conversation

@mabry1985

@mabry1985 mabry1985 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

SPARC PRD: Model Selection — Specialist Agents UI Tab (Phase 1)

Situation

The protoMaker platform uses a PhaseModelConfig system (libs/types/src/agent-settings.ts) allowing operators to configure LLM models per workflow phase (enhancement, spec generation, coding, etc.). The UI exposes these controls via a "Model Defaults" settings tab (apps/ui/src/components/views/settings-view/model-defaults/), and the server resolves models through getPhaseModelWithOverrides() (`apps/server/src...

Closes #4110


Created automatically by Automaker

Summary by CodeRabbit

Release Notes

  • New Features
    • Added configurable specialist agent models for antagonistic and inline review processes
    • Enabled customization of phase model behavior through settings service integration, allowing users to tailor review configurations to their needs

@protoquinn

protoquinn Bot commented Jun 6, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends the agent model configuration system to support configurable specialist review models for antagonistic and inline review. It introduces antagonisticReviewModel and inlineReviewModel fields to PhaseModelConfig, provides sensible defaults, and wires model resolution into PlanReviewService.verifyPlan to enable settings-based model overrides.

Changes

Antagonistic Review Model Configuration

Layer / File(s) Summary
Agent model configuration contracts
libs/types/src/agent-settings.ts
PhaseModelConfig is extended with antagonisticReviewModel and inlineReviewModel fields. DEFAULT_PHASE_MODELS provides protolabs/fast tier defaults for both new specialist review models.
Plan review service model resolution
apps/server/src/services/plan-review-service.ts
verifyPlan accepts an optional settingsService parameter, imports phase model resolution utilities, and resolves the antagonistic review model via getPhaseModelWithOverrides('antagonisticReviewModel', ...). The resolved model is passed to verifyPlanGoalBackward in the structured-plan path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Specialist agents, now they can align,
With settings that shine and defaults so fine,
Antagonistic reviews in review service flow,
Model selection now puts on a show!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially implements Phase 1 requirements. PhaseModelConfig was extended with new model entries and defaults added, but critical hardcoded model replacements and UI Specialist Agents tab are missing. Complete remaining work: replace all five hardcoded model locations in antagonistic-review-service.ts and lead-engineer-gtm-review-processor.ts; implement Specialist Agents UI tab; add unit tests for getPhaseModelWithOverrides per each key.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature being implemented: Phase 1 of model selection for antagonistic review, Cindi, and Specialist Agents UI tab.
Out of Scope Changes check ✅ Passed The changes are directly related to Phase 1 requirements: extending PhaseModelConfig and updating PlanReviewService to resolve phase models. Both modifications align with the linked issue scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/github-feat-model-selection-antagonistic-review-5b7ad9z

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands and usage tips.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Audit — PR #4123 | [github] feat: model selection — antagonistic review + Cindi + Specialist Agents UI tab (Phase 1)

VERDICT: WARN (CI not yet terminal)


CI Status

  • build: queued
  • test: queued
  • checks: queued

Diff Review
Adds two new PhaseModelConfig fields (antagonisticReviewModel, inlineReviewModel) to replace a hardcoded 'haiku' model in PlanReviewService. Server side wires getPhaseModelWithOverrides() to resolve the model at call time and passes it to runAntagonisticReview. Defaults to 'protolabs/fast'.

Observations

  • Gap: runAntagonisticReview is called with model and settingsService args, but the function signature update is not visible in this diff window. If the inner function doesn't accept those params, this is a runtime break. Author should confirm the full function signature accommodates these args (file:line evidence needed).
  • Gap: settingsService forwarded as optional to runAntagonisticReview — if the inner function doesn't handle null gracefully, silent null-refs could occur at runtime.
  • Gap: No tests visible in the first 200 lines of diff. CI results will reveal coverage.
  • CI not terminal: Will re-evaluate once checks complete. If CI passes cleanly, this is a PASS with the above as advisory notes.

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jun 6, 2026

Copy link
Copy Markdown

Submitted COMMENT review on protoLabsAI/protoMaker#4123.

CI is still queuing — VERDICT is WARN pending terminal checks. Key finding: runAntagonisticReview is called with new model and settingsService args that aren't visible in the diff window; the inner function signature needs to be confirmed as compatible before this can clear to PASS. Two advisory Gaps noted. Will re-evaluate once build/test/checks reach terminal state.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Audit — PR #4123 | [github] feat: model selection — antagonistic review + Cindi + Specialist Agents UI tab (Phase 1)

VERDICT: FAIL


CI Status

  • ci-complete: failure ❌
  • build: failure ❌
  • test: success ✅
  • checks: failure ❌

Diff Review
Phase 1 of specialist agent model selection. Adds antagonisticReviewModel / inlineReviewModel fields to PhaseModelConfig and wires them through PlanReviewService.verifyPlan() via getPhaseModelWithOverrides. Defaults to protolabs/fast. Clean intent, but two blocking issues.


Observations

  • CLAWPATCH/GAP: Structural review unavailable — checkout cache rejected ref main for this repo.
  • CRITICAL: apps/server/src/services/plan-review-service.ts:66verifyPlan passes model + settingsService to _runReview (lines 80–81), but _runReview's updated method signature is absent from the diff. Build failure is consistent with a TypeScript type mismatch at this call site. Author must ensure the method signature was updated end-to-end.
  • HIGH: libs/types/src/agent-settings.ts:227–230 — Both new fields are required (no ?) on PhaseModelConfig, but existing persisted configs predate this PR and will be missing them. Risk of runtime crashes on existing operators. Recommend making fields optional or adding a migration path.
  • MEDIUM: No test coverage added for the new config surface.

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jun 6, 2026

Copy link
Copy Markdown

Submitted REQUEST_CHANGES review on protoLabsAI/protoMaker#4123.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/server/src/services/plan-review-service.ts (2)

74-85: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Signature mismatch: verifyPlanGoalBackward doesn't accept model or settingsService.

The call passes model and settingsService (lines 82-83), but the method signature at lines 136-156 does not include these parameters. This will cause a TypeScript compilation error.

🐛 Proposed fix: update verifyPlanGoalBackward signature
   private async verifyPlanGoalBackward(params: {
     featureTitle: string;
     featureDescription: string;
     complexity: string;
     planOutput: string;
     projectPath: string;
     structuredPlan: StructuredPlan;
+    model: string;
+    settingsService?: SettingsService | null;
   }): Promise<{

Then use params.model on line 213 instead of resolveModelString('haiku').

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/server/src/services/plan-review-service.ts` around lines 74 - 85, The
call to verifyPlanGoalBackward passes model and settingsService but the method
signature for verifyPlanGoalBackward doesn't accept them; update the
verifyPlanGoalBackward function signature to include model and settingsService
(e.g., add model and settingsService to its params object) and inside
verifyPlanGoalBackward replace the hardcoded resolveModelString('haiku') usage
with params.model so the passed-in model is used for resolution and
settingsService is available for any settings-dependent logic.

136-156: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

verifyPlanGoalBackward ignores the passed model and hardcodes haiku.

Even after fixing the signature mismatch, line 213 hardcodes resolveModelString('haiku') instead of using the configured model. The PR objective is to make this configurable.

🔧 Proposed fix

After adding model to the params signature:

       const result = await simpleQuery({
         prompt: `You are a critical architect...`,
-        model: resolveModelString('haiku'),
+        model: params.model,
         cwd: projectPath,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/server/src/services/plan-review-service.ts` around lines 136 - 156, The
verifyPlanGoalBackward function currently ignores the configured model and
always calls resolveModelString('haiku'); update the function to accept and use
the model parameter passed in params (e.g., add model: string to the params
object and destructuring) and replace resolveModelString('haiku') with
resolveModelString(model) (or the appropriate variable name) wherever the
hardcoded string is used so the configured model is honored; ensure any callers
are updated to pass the model through to verifyPlanGoalBackward if they do not
already.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/server/src/services/plan-review-service.ts`:
- Around line 59-65: The resolved phase model stored in model (from
getPhaseModelWithOverrides + resolvePhaseModel) is not used; replace hardcoded
resolveModelString('haiku') calls in the standard review path with the
configured model (either pass model directly or call resolveModelString(model)
if model is a string alias) so the phase override is honored; update all
occurrences in the affected block (the standard review path and the similar
branch that spans the other section) to use the resolved model variable instead
of the literal 'haiku'.
- Around line 13-18: The PR uses resolveModelString (called as
resolveModelString('haiku')) but that function isn't imported, causing a runtime
ReferenceError; fix by either adding an import for resolveModelString from
'`@protolabsai/model-resolver`' or — preferred — replace the hardcoded
resolveModelString('haiku') calls with the already-resolved model variable (the
one computed via resolvePhaseModel or named `model` in this file) so all code
uses the same resolved model; update occurrences in the functions that call
resolveModelString to reference the existing resolved model or add the import
and use it consistently.

---

Outside diff comments:
In `@apps/server/src/services/plan-review-service.ts`:
- Around line 74-85: The call to verifyPlanGoalBackward passes model and
settingsService but the method signature for verifyPlanGoalBackward doesn't
accept them; update the verifyPlanGoalBackward function signature to include
model and settingsService (e.g., add model and settingsService to its params
object) and inside verifyPlanGoalBackward replace the hardcoded
resolveModelString('haiku') usage with params.model so the passed-in model is
used for resolution and settingsService is available for any settings-dependent
logic.
- Around line 136-156: The verifyPlanGoalBackward function currently ignores the
configured model and always calls resolveModelString('haiku'); update the
function to accept and use the model parameter passed in params (e.g., add
model: string to the params object and destructuring) and replace
resolveModelString('haiku') with resolveModelString(model) (or the appropriate
variable name) wherever the hardcoded string is used so the configured model is
honored; ensure any callers are updated to pass the model through to
verifyPlanGoalBackward if they do not already.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 268bcafa-80b3-4018-8827-a4906fb5159b

📥 Commits

Reviewing files that changed from the base of the PR and between 07cf379 and 3bcf4ac.

📒 Files selected for processing (2)
  • apps/server/src/services/plan-review-service.ts
  • libs/types/src/agent-settings.ts

Comment on lines 13 to +18
import { createLogger } from '@protolabsai/utils';
import type { StructuredPlan } from '@protolabsai/types';
import { resolveModelString } from '@protolabsai/model-resolver';
import { resolvePhaseModel } from '@protolabsai/model-resolver';
import { simpleQuery } from '../providers/simple-query-service.js';
import { getPhaseModelWithOverrides } from '../lib/settings-helpers.js';
import type { SettingsService } from './settings-service.js';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Missing import: resolveModelString is used but not imported.

Lines 108 and 213 call resolveModelString('haiku'), but this function is not imported. This will cause a ReferenceError at runtime.

Either import resolveModelString from @protolabsai/model-resolver, or replace the hardcoded calls with the resolved model variable.

🐛 Proposed fix: add missing import or use resolved model

Option A — Import the missing function:

 import { resolvePhaseModel } from '`@protolabsai/model-resolver`';
+import { resolveModelString } from '`@protolabsai/model-resolver`';

Option B — Use the already-resolved model throughout (preferred, aligns with PR goals):

-        model: resolveModelString('haiku'),
+        model,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { createLogger } from '@protolabsai/utils';
import type { StructuredPlan } from '@protolabsai/types';
import { resolveModelString } from '@protolabsai/model-resolver';
import { resolvePhaseModel } from '@protolabsai/model-resolver';
import { simpleQuery } from '../providers/simple-query-service.js';
import { getPhaseModelWithOverrides } from '../lib/settings-helpers.js';
import type { SettingsService } from './settings-service.js';
import { createLogger } from '`@protolabsai/utils`';
import type { StructuredPlan } from '`@protolabsai/types`';
import { resolvePhaseModel } from '`@protolabsai/model-resolver`';
import { resolveModelString } from '`@protolabsai/model-resolver`';
import { simpleQuery } from '../providers/simple-query-service.js';
import { getPhaseModelWithOverrides } from '../lib/settings-helpers.js';
import type { SettingsService } from './settings-service.js';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/server/src/services/plan-review-service.ts` around lines 13 - 18, The PR
uses resolveModelString (called as resolveModelString('haiku')) but that
function isn't imported, causing a runtime ReferenceError; fix by either adding
an import for resolveModelString from '`@protolabsai/model-resolver`' or —
preferred — replace the hardcoded resolveModelString('haiku') calls with the
already-resolved model variable (the one computed via resolvePhaseModel or named
`model` in this file) so all code uses the same resolved model; update
occurrences in the functions that call resolveModelString to reference the
existing resolved model or add the import and use it consistently.

Comment on lines +59 to +65
// Resolve model from phase model config
const { phaseModel } = await getPhaseModelWithOverrides(
'antagonisticReviewModel',
settingsService,
projectPath
);
const model = resolvePhaseModel(phaseModel).model;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Resolved model is not used in the standard review path.

The model variable is resolved from phase config (lines 59-65) but the standard review path (line 108) still hardcodes resolveModelString('haiku'). This defeats the purpose of the configurable model override.

🔧 Proposed fix
       const result = await simpleQuery({
         prompt: `You are a critical code reviewer...`,
-        model: resolveModelString('haiku'),
+        model,
         cwd: projectPath,

Also applies to: 87-114

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/server/src/services/plan-review-service.ts` around lines 59 - 65, The
resolved phase model stored in model (from getPhaseModelWithOverrides +
resolvePhaseModel) is not used; replace hardcoded resolveModelString('haiku')
calls in the standard review path with the configured model (either pass model
directly or call resolveModelString(model) if model is a string alias) so the
phase override is honored; update all occurrences in the affected block (the
standard review path and the similar branch that spans the other section) to use
the resolved model variable instead of the literal 'haiku'.

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.

feat: model selection — antagonistic review + Cindi + Specialist Agents UI tab (Phase 1)

1 participant