@in-the-loop-labs/pair-review 5.2.2 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +26 -16
  2. package/package.json +1 -1
  3. package/plugin/.claude-plugin/plugin.json +1 -1
  4. package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
  5. package/plugin-code-critic/skills/analyze/references/level1-thorough.md +52 -121
  6. package/plugin-code-critic/skills/analyze/references/level2-thorough.md +49 -113
  7. package/plugin-code-critic/skills/analyze/references/level3-thorough.md +46 -195
  8. package/plugin-code-critic/skills/analyze/references/orchestration-thorough.md +56 -112
  9. package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
  10. package/public/css/analysis-config.css +29 -0
  11. package/public/css/pr.css +208 -0
  12. package/public/js/components/AIPanel.js +14 -9
  13. package/public/js/components/ChatPanel.js +790 -54
  14. package/public/js/components/ConfirmDialog.js +70 -2
  15. package/public/js/modules/pierre-bridge.js +58 -97
  16. package/public/js/modules/suggestion-manager.js +9 -121
  17. package/public/js/pr.js +15 -28
  18. package/public/js/utils/scroll-into-view.js +18 -4
  19. package/src/ai/analyzer.js +31 -6
  20. package/src/ai/antigravity-provider.js +62 -42
  21. package/src/ai/claude-provider.js +18 -20
  22. package/src/ai/codex-provider.js +76 -81
  23. package/src/ai/executable-provider.js +3 -1
  24. package/src/ai/index.js +2 -0
  25. package/src/ai/muse-provider.js +84 -52
  26. package/src/ai/omp-provider.js +27 -12
  27. package/src/ai/pi-provider.js +12 -6
  28. package/src/ai/prompts/baseline/consolidation/thorough.js +56 -43
  29. package/src/ai/prompts/baseline/level1/thorough.js +76 -138
  30. package/src/ai/prompts/baseline/level2/thorough.js +76 -129
  31. package/src/ai/prompts/baseline/level3/thorough.js +67 -212
  32. package/src/ai/prompts/baseline/orchestration/thorough.js +79 -130
  33. package/src/ai/prompts/render-for-skill.js +5 -0
  34. package/src/ai/prompts/shared/adversarial-verification.js +68 -0
  35. package/src/ai/provider.js +61 -2
  36. package/src/ai/stream-parser.js +22 -1
  37. package/src/chat/acp-bridge.js +11 -0
  38. package/src/chat/chat-models.js +348 -0
  39. package/src/chat/chat-providers.js +17 -0
  40. package/src/chat/claude-code-bridge.js +9 -0
  41. package/src/chat/codex-bridge.js +6 -1
  42. package/src/chat/omp-bridge.js +5 -0
  43. package/src/chat/pi-bridge.js +20 -5
  44. package/src/chat/session-manager.js +158 -63
  45. package/src/config.js +1 -1
  46. package/src/hooks/payloads.js +5 -1
  47. package/src/main.js +1 -1
  48. package/src/routes/chat.js +83 -11
@@ -14,6 +14,7 @@ const { normalizePath, pathExistsInList, resolveRenamedFile } = require('../util
14
14
  const { buildFileLineCountMap, validateSuggestionLineNumbers } = require('../utils/line-validation');
15
15
  const { getPromptBuilder } = require('./prompts');
16
16
  const { formatValidFiles } = require('./prompts/shared/valid-files');
17
+ const { ADVERSARIAL_VERIFICATION_SECTION } = require('./prompts/shared/adversarial-verification');
17
18
  const { GIT_DIFF_FLAGS } = require('../git/diff-flags');
18
19
  const {
19
20
  buildAnalysisLineNumberGuidance,
@@ -402,7 +403,7 @@ function hasSchemaKeys(obj) {
402
403
  class Analyzer {
403
404
  /**
404
405
  * @param {Object} database - Database instance
405
- * @param {string} model - Model to use (e.g., 'opus', 'gemini-3.1-pro-low')
406
+ * @param {string} model - Model to use (e.g., 'opus', 'gemini-3.8-flash-high')
406
407
  * @param {string} provider - Provider ID (e.g., 'claude', 'antigravity'). Defaults to 'claude'.
407
408
  * @param {Object} providerOverrides - Per-call config overrides passed to createProvider (optional)
408
409
  * @param {Object|null} providerOverridesMap - Per-provider overrides map for council mode (provider ID → overrides)
@@ -655,7 +656,7 @@ class Analyzer {
655
656
  // Build dedup context from prMetadata and options
656
657
  const dedupContext = buildDedupContext(prMetadata, { reviewId: prId, serverPort, runId });
657
658
 
658
- const orchestrationResult = await this.orchestrateWithAI(allSuggestions, prMetadata, mergedInstructions, worktreePath, { analysisId, tier, progressCallback, timeout: executionTimeout, logPrefix, reviewerNum, excludePrevious, dedupContext, githubClient });
659
+ const orchestrationResult = await this.orchestrateWithAI(allSuggestions, prMetadata, mergedInstructions, worktreePath, { analysisId, tier, progressCallback, timeout: executionTimeout, logPrefix, reviewerNum, excludePrevious, dedupContext, githubClient, skipAdversarialVerification: options.skipAdversarialVerification });
659
660
 
660
661
  // orchestrateWithAI degrades to the raw union of level suggestions when
661
662
  // consolidation fails internally — report that honestly instead of 'success'
@@ -2856,7 +2857,7 @@ File-level suggestions should NOT have a line number. They apply to the entire f
2856
2857
  * array is the raw union of all levels rather than a curated set.
2857
2858
  */
2858
2859
  async orchestrateWithAI(allSuggestions, prMetadata, customInstructions = null, worktreePath = null, options = {}) {
2859
- const { analysisId, tier = 'balanced', progressCallback, providerOverride, modelOverride, timeout = 600000, logPrefix: lp = '', reviewerNum, excludePrevious, dedupContext, githubClient } = options;
2860
+ const { analysisId, tier = 'balanced', progressCallback, providerOverride, modelOverride, timeout = 600000, logPrefix: lp = '', reviewerNum, excludePrevious, dedupContext, githubClient, skipAdversarialVerification } = options;
2860
2861
  // Build adapter-level log prefix: when reviewerNum is set (council mode),
2861
2862
  // use compact format like [R1 Orch] so concurrent reviewers are disambiguated
2862
2863
  const adapterLogPrefix = reviewerNum ? `[R${reviewerNum} Orch]` : '';
@@ -2896,7 +2897,7 @@ File-level suggestions should NOT have a line number. They apply to the entire f
2896
2897
  }
2897
2898
 
2898
2899
  // Build the consolidation prompt
2899
- const prompt = this.buildOrchestrationPrompt(allSuggestions, prMetadata, customInstructions, worktreePath, tier, lp, { excludePrevious, dedupContext: resolvedDedupContext });
2900
+ const prompt = this.buildOrchestrationPrompt(allSuggestions, prMetadata, customInstructions, worktreePath, tier, lp, { excludePrevious, dedupContext: resolvedDedupContext, skipAdversarialVerification });
2900
2901
 
2901
2902
  // Execute AI for cross-level consolidation
2902
2903
  logger.info(`${lp}[Consolidation] Running AI consolidation to curate and merge suggestions...`);
@@ -3022,9 +3023,12 @@ File-level suggestions should NOT have a line number. They apply to the entire f
3022
3023
  * @param {string} worktreePath - Path to the git worktree
3023
3024
  * @param {string} tier - Capability tier: 'fast', 'balanced', or 'thorough' (default: 'balanced')
3024
3025
  * @param {string} logPrefix - Optional log prefix for reviewer identification in council mode
3025
- * @param {Object} [dedupOptions] - Dedup options
3026
+ * @param {Object} [dedupOptions] - Dedup and prompt options
3026
3027
  * @param {Object} [dedupOptions.excludePrevious] - { github: bool, feedback: bool }
3027
3028
  * @param {Object} [dedupOptions.dedupContext] - { owner, repo, pullNumber, reviewId, serverPort }
3029
+ * @param {boolean} [dedupOptions.skipAdversarialVerification] - Omit the adversarial
3030
+ * verification section. Set for per-voice orchestration inside a multi-voice
3031
+ * reviewer-centric council, where verification belongs to cross-voice consolidation
3028
3032
  * @returns {string} Orchestration prompt
3029
3033
  */
3030
3034
  buildOrchestrationPrompt(allSuggestions, prMetadata, customInstructions = null, worktreePath = null, tier = 'balanced', logPrefix = '', dedupOptions = {}) {
@@ -3042,6 +3046,14 @@ File-level suggestions should NOT have a line number. They apply to the entire f
3042
3046
  customInstructions: customInstructions ? this.buildCustomInstructionsSection(customInstructions) : '',
3043
3047
  lineNumberGuidance: this.buildOrchestrationLineNumberGuidance(worktreePath),
3044
3048
  dedupInstructions: buildDedupInstructions(dedupOptions.excludePrevious, dedupOptions.dedupContext || {}),
3049
+ // Adversarial verification runs exactly once per analysis flow, at the
3050
+ // final merge stage. Orchestration IS that stage for standalone
3051
+ // single-reviewer runs and the level-centric council's Pass 2 — but when
3052
+ // analyzeAllLevels runs as one voice inside a multi-voice
3053
+ // reviewer-centric council, cross-voice consolidation is the final stage
3054
+ // and per-voice verification would pre-kill findings before cross-voice
3055
+ // overlap is visible (same once-per-flow rule as dedup).
3056
+ adversarialVerification: dedupOptions.skipAdversarialVerification ? '' : ADVERSARIAL_VERIFICATION_SECTION,
3045
3057
  level1Count: allSuggestions.level1?.length || 0,
3046
3058
  level2Count: allSuggestions.level2?.length || 0,
3047
3059
  level3Count: allSuggestions.level3?.length || 0,
@@ -3354,7 +3366,10 @@ File-level suggestions should NOT have a line number. They apply to the entire f
3354
3366
  }
3355
3367
 
3356
3368
  // Note: excludePrevious/serverPort omitted intentionally — dedup runs once
3357
- // during cross-voice consolidation, not per-voice.
3369
+ // during cross-voice consolidation, not per-voice. Adversarial
3370
+ // verification follows the same rule: skipped here so this voice's
3371
+ // internal cross-level merge does not pre-kill findings before
3372
+ // cross-voice consolidation can see overlap between voices.
3358
3373
  const result = await voiceAnalyzer.analyzeAllLevels(
3359
3374
  reviewId,
3360
3375
  worktreePath,
@@ -3366,6 +3381,7 @@ File-level suggestions should NOT have a line number. They apply to the entire f
3366
3381
  analysisId,
3367
3382
  runId: childRunId,
3368
3383
  skipRunCreation: true,
3384
+ skipAdversarialVerification: true,
3369
3385
  enabledLevels,
3370
3386
  tier: voiceTier,
3371
3387
  timeout: voiceTimeout,
@@ -4096,6 +4112,12 @@ File-level suggestions should NOT have a line number. They apply to the entire f
4096
4112
  reviewIntro: `You are consolidating Level ${level} code review suggestions from multiple independent AI reviewers for ${reviewDescription}.`,
4097
4113
  customInstructions: customInstructions ? this.buildCustomInstructionsSection(customInstructions) : '',
4098
4114
  dedupInstructions: '',
4115
+ // Intra-level consolidation is Pass 1 of the level-centric council —
4116
+ // NOT the flow's final merge stage. Adversarial verification runs
4117
+ // exactly once per flow, at the last merge point (here, the Pass 2
4118
+ // cross-level orchestration, where it is embedded statically), so
4119
+ // findings reach it with cross-voice overlap intact as evidence.
4120
+ adversarialVerification: '',
4099
4121
  lineNumberGuidance: this.buildOrchestrationLineNumberGuidance(worktreePath),
4100
4122
  reviewerSuggestions,
4101
4123
  suggestionCount,
@@ -4296,6 +4318,9 @@ File-level suggestions should NOT have a line number. They apply to the entire f
4296
4318
  customInstructions: customInstructions ? this.buildCustomInstructionsSection(customInstructions) : '',
4297
4319
  lineNumberGuidance: this.buildOrchestrationLineNumberGuidance(worktreePath),
4298
4320
  dedupInstructions: buildDedupInstructions(excludePrevious, resolvedDedupContext || {}),
4321
+ // Cross-voice consolidation is the reviewer-centric council's final
4322
+ // merge stage — the one place in this flow the adversarial pass runs
4323
+ adversarialVerification: ADVERSARIAL_VERIFICATION_SECTION,
4299
4324
  reviewerSuggestions: voiceDescriptions,
4300
4325
  suggestionCount: voiceReviews.reduce((sum, v) => sum + v.suggestionCount, 0),
4301
4326
  reviewerCount: voiceReviews.length
@@ -62,9 +62,9 @@ const BIN_DIR = path.join(__dirname, '..', '..', 'bin');
62
62
  const ANALYSIS_DIRECTIVE =
63
63
  'Perform the code-review task described in the input provided on standard input. You are ' +
64
64
  'running non-interactively in the repository at the current working directory; you MAY use ' +
65
- 'your read-only tools (reading files, searching, and read-only git/shell commands) to gather ' +
66
- 'the context the instructions call for. Never create, modify, or delete files, and never run ' +
67
- 'mutating commands. When finished, output ONLY the exact result the instructions request (for ' +
65
+ 'your tools (reading files, searching, and running git/shell commands) to gather the context ' +
66
+ 'the instructions call for. Follow the access and leave-no-trace rules stated in the task ' +
67
+ 'instructions. When finished, output ONLY the exact result the instructions request (for ' +
68
68
  'example, a single JSON object when JSON is requested), with no extra commentary and no ' +
69
69
  'surrounding markdown code fences.';
70
70
 
@@ -73,9 +73,10 @@ const EXTRACTION_DIRECTIVE =
73
73
  'Read the input provided on standard input and return ONLY the raw JSON object it describes — ' +
74
74
  'no explanation, no markdown, no code fences. Do not use any tools.';
75
75
 
76
- // agy self-terminates print mode at --print-timeout; extraction has a 60s cap
77
- // in the base class, so ask agy to give up just before that.
78
- const EXTRACTION_PRINT_TIMEOUT_SECS = 55;
76
+ // agy self-terminates print mode at --print-timeout; extraction is capped at
77
+ // LLM_EXTRACTION_TIMEOUT_MS (300s) in the base class, so ask agy to give up
78
+ // just before that.
79
+ const EXTRACTION_PRINT_TIMEOUT_SECS = 295;
79
80
 
80
81
  // The JS-side execute() timeout is a backstop: it fires this many ms AFTER agy's
81
82
  // own --print-timeout budget, so agy self-terminates first (with its own error
@@ -91,42 +92,33 @@ const TIMEOUT_BACKSTOP_GRACE_MS = 15000;
91
92
  * which contains spaces and parentheses and must never leak into ids.
92
93
  *
93
94
  * We curate the Gemini-family models here — Antigravity is the Gemini CLI's
94
- * successor and its native models are Gemini. `agy` also exposes Claude and
95
- * GPT-OSS models; those remain reachable via a `providers.antigravity.models`
96
- * config override but are intentionally left out of the default picker to keep
97
- * the cross-provider model-mismatch guard and the UX unambiguous.
95
+ * successor and its native models are Gemini. Ordered thorough -> balanced ->
96
+ * fast, matching the other providers' pickers. Gemini 3.8 Flash at high effort
97
+ * is the thorough-tier default: it is the strongest Gemini agy exposes today
98
+ * (DeepSWE v1.1 73.7, Terminal-Bench 2.1 89.4 — on par with GPT-6 Astra and
99
+ * Muse 1.3), so "Flash" now describes latency, not capability. Gemini 3.1 Pro
100
+ * (Low/High, Feb 2026) is the previous-generation Pro line and stays on the
101
+ * balanced/thorough tiers for anyone who prefers it. Gemini 3.8 Flash at low
102
+ * effort is the sole fast-tier entry, which also makes it the JSON-extraction
103
+ * model (getFastTierModel() picks the first `tier: 'fast'` model — position
104
+ * in this array does not matter). Retired ids (3.5 Flash) are kept as aliases
105
+ * of their 3.8 Flash counterparts so saved selections keep working. `agy` also
106
+ * exposes Claude and GPT-OSS models; those remain reachable via a
107
+ * `providers.antigravity.models` config override but are intentionally left
108
+ * out of the default picker to keep the cross-provider model-mismatch guard
109
+ * and the UX unambiguous.
98
110
  */
99
111
  const ANTIGRAVITY_MODELS = [
100
112
  {
101
- id: 'gemini-3.5-flash-low',
102
- cliName: 'Gemini 3.5 Flash (Low)',
103
- aliases: ['gemini-3.5-flash'],
104
- name: '3.5 Flash (Low)',
105
- tier: 'fast',
106
- tagline: 'Rapid Sanity Check',
107
- description: 'Cheapest, fastest pass — quick scans and the JSON-extraction fallback',
108
- badge: 'Cheapest',
109
- badgeClass: 'badge-speed'
110
- },
111
- {
112
- id: 'gemini-3.5-flash-high',
113
- cliName: 'Gemini 3.5 Flash (High)',
114
- name: '3.5 Flash (High)',
115
- tier: 'fast',
116
- tagline: 'Quick Look',
117
- description: 'Flash speed with more reasoning effort for a sharper first pass',
118
- badge: 'Quick Look',
119
- badgeClass: 'badge-speed'
120
- },
121
- {
122
- id: 'gemini-3.1-pro-low',
123
- cliName: 'Gemini 3.1 Pro (Low)',
124
- aliases: ['gemini-3.1-pro'],
125
- name: '3.1 Pro (Low)',
126
- tier: 'balanced',
127
- tagline: 'Standard PR Review',
128
- description: 'Strong reasoning with a large context window — the reliable daily driver',
129
- badge: 'Daily Driver',
113
+ id: 'gemini-3.8-flash-high',
114
+ cliName: 'Gemini 3.8 Flash (High)',
115
+ // Retired 3.5 Flash (High) id — see the note on gemini-3.8-flash-low.
116
+ aliases: ['gemini-3.5-flash-high'],
117
+ name: '3.8 Flash (High)',
118
+ tier: 'thorough',
119
+ tagline: 'Frontier Review',
120
+ description: 'Gemini 3.8 Flash at high effort is the strongest Gemini on agy — DeepSWE v1.1 73.7, Terminal-Bench 2.1 89.4, on par with GPT-6 Astra and Muse 1.3. "Flash" now means latency, not capability. Uses the thorough prompt set.',
121
+ badge: 'Recommended',
130
122
  badgeClass: 'badge-recommended',
131
123
  default: true
132
124
  },
@@ -136,13 +128,39 @@ const ANTIGRAVITY_MODELS = [
136
128
  name: '3.1 Pro (High)',
137
129
  tier: 'thorough',
138
130
  tagline: 'Deep Dive',
139
- description: 'Maximum reasoning effort for complex, architectural reviews',
131
+ description: 'Previous-generation Pro (Feb 2026) at maximum reasoning effort — slower and now outscored by 3.8 Flash (High), kept for reviewers who prefer the Pro line',
140
132
  badge: 'Deep Dive',
141
133
  badgeClass: 'badge-power'
134
+ },
135
+ {
136
+ id: 'gemini-3.1-pro-low',
137
+ cliName: 'Gemini 3.1 Pro (Low)',
138
+ aliases: ['gemini-3.1-pro'],
139
+ name: '3.1 Pro (Low)',
140
+ tier: 'balanced',
141
+ tagline: 'Previous-Gen Pro',
142
+ description: 'Previous-generation Pro (Feb 2026) at low effort — a large-context middle ground, superseded as the default by 3.8 Flash (High)',
143
+ badge: 'Previous Gen',
144
+ badgeClass: 'badge-balanced'
145
+ },
146
+ {
147
+ id: 'gemini-3.8-flash-low',
148
+ cliName: 'Gemini 3.8 Flash (Low)',
149
+ // The 3.5 Flash ids no longer exist on agy (`agy --model gemini-3.5-flash-low`
150
+ // exits 1 with an unknown-model listing). Saved councils/configs that still
151
+ // name them resolve to the same effort level on 3.8 Flash; without the
152
+ // aliases they would hit agy's exit-1 unknown-model failure.
153
+ aliases: ['gemini-3.8-flash', 'gemini-3.5-flash-low', 'gemini-3.5-flash'],
154
+ name: '3.8 Flash (Low)',
155
+ tier: 'fast',
156
+ tagline: 'Rapid Sanity Check',
157
+ description: 'Cheapest, fastest pass — quick scans and the JSON-extraction fallback model',
158
+ badge: 'Cheapest',
159
+ badgeClass: 'badge-speed'
142
160
  }
143
161
  ];
144
162
 
145
- const DEFAULT_ANTIGRAVITY_MODEL = 'gemini-3.1-pro-low';
163
+ const DEFAULT_ANTIGRAVITY_MODEL = 'gemini-3.8-flash-high';
146
164
 
147
165
  class AntigravityProvider extends AIProvider {
148
166
  /**
@@ -201,7 +219,9 @@ class AntigravityProvider extends AIProvider {
201
219
  // Exact `agy --model` string. Config overrides honor the shared `cli_model`
202
220
  // contract used across providers (documented in config.example.json) and
203
221
  // fall back to `cliName`; built-ins carry `cliName`. Raw id is the last
204
- // resort — agy tolerates an unknown name by using its default.
222
+ // resort. Note: agy no longer falls back to its default for an unknown
223
+ // name — as of agy 1.0.16 it exits 1 and prints the model listing, and
224
+ // the provider's clean ids (`gemini-3.8-flash-low`) are accepted verbatim.
205
225
  const cliModel =
206
226
  configModel?.cli_model ||
207
227
  configModel?.cliName ||
@@ -7,7 +7,7 @@
7
7
 
8
8
  const path = require('path');
9
9
  const { spawn } = require('child_process');
10
- const { AIProvider, registerProvider, quoteShellArgs } = require('./provider');
10
+ const { AIProvider, registerProvider, quoteShellArgs, resolveCliModelConfig } = require('./provider');
11
11
  const logger = require('../utils/logger');
12
12
  const { extractJSON } = require('../utils/json-extractor');
13
13
  const { CancellationError, isAnalysisCancelled } = require('../routes/shared');
@@ -64,6 +64,8 @@ const CLAUDE_MODELS = [
64
64
  // The bare 'fable' alias intentionally stays pinned to Fable 5 (the same way
65
65
  // 'opus' stays on opus-4.8-xhigh) so existing configs and --model fable
66
66
  // invocations keep resolving to the generation they were written against.
67
+ // The provider DEFAULT is a separate knob: it moved to opus-5-high (same
68
+ // price as Opus 4.8) while the 'opus' alias stayed pinned to opus-4.8-xhigh.
67
69
  aliases: ['fable'],
68
70
  cli_model: 'claude-fable-5',
69
71
  env: { CLAUDE_CODE_EFFORT_LEVEL: 'xhigh' },
@@ -95,8 +97,8 @@ const CLAUDE_MODELS = [
95
97
  name: 'Opus 5 XHigh',
96
98
  tier: 'thorough',
97
99
  tagline: 'Newest Opus',
98
- description: 'Opus 5 (newest) with extra-high effort',
99
- badge: 'Latest',
100
+ description: 'Opus 5 (newest) with extra-high effort — deepest thorough reviews',
101
+ badge: 'Extra-High Effort',
100
102
  badgeClass: 'badge-power'
101
103
  },
102
104
  {
@@ -105,10 +107,11 @@ const CLAUDE_MODELS = [
105
107
  env: { CLAUDE_CODE_EFFORT_LEVEL: 'high' },
106
108
  name: 'Opus 5 High',
107
109
  tier: 'thorough',
108
- tagline: 'Newest Opus',
109
- description: 'Opus 5 with high effort — quicker than XHigh',
110
- badge: 'High Effort',
111
- badgeClass: 'badge-power'
110
+ tagline: 'Recommended Default',
111
+ description: 'Opus 5 (newest) with high effort — the recommended default for thorough reviews',
112
+ badge: 'Recommended',
113
+ badgeClass: 'badge-recommended',
114
+ default: true
112
115
  },
113
116
  {
114
117
  id: 'opus-4.8-xhigh',
@@ -117,11 +120,10 @@ const CLAUDE_MODELS = [
117
120
  env: { CLAUDE_CODE_EFFORT_LEVEL: 'xhigh' },
118
121
  name: 'Opus 4.8 XHigh',
119
122
  tier: 'thorough',
120
- tagline: 'Maximum Depth',
121
- description: 'Opus 4.8 with extra-high effort — deepest analysis',
122
- badge: 'Most Thorough',
123
- badgeClass: 'badge-power',
124
- default: true
123
+ tagline: 'Previous Gen',
124
+ description: 'Opus 4.8 with extra-high effort',
125
+ badge: 'Previous Gen',
126
+ badgeClass: 'badge-power'
125
127
  },
126
128
  {
127
129
  id: 'opus-4.8-high',
@@ -348,17 +350,13 @@ class ClaudeProvider extends AIProvider {
348
350
  _resolveModelConfig(modelId) {
349
351
  const configOverrides = this.configOverrides || {};
350
352
 
351
- // Resolve cli_model: config model > built-in model > id
353
+ // Resolve cli_model via the shared ladder (config model > built-in model > id).
352
354
  // cli_model decouples the app-level model ID from the CLI --model argument.
353
- // - undefined: fall through the resolution chain
354
- // - string: use this exact value for --model
355
- // - null: explicitly suppress --model (for tools that want the model set via env instead)
355
+ // See resolveCliModelConfig in provider.js for the undefined/null/'' contract.
356
356
  const builtIn = CLAUDE_MODELS.find(m => m.id === modelId || (m.aliases && m.aliases.includes(modelId)));
357
357
  const modelKeys = new Set([modelId, builtIn?.id, ...(builtIn?.aliases || [])].filter(Boolean));
358
358
  const configModel = configOverrides.models?.find(m => modelKeys.has(m.id));
359
- const resolvedCliModel = configModel?.cli_model !== undefined
360
- ? configModel.cli_model
361
- : (builtIn?.cli_model !== undefined ? builtIn.cli_model : modelId);
359
+ const resolvedCliModel = resolveCliModelConfig(builtIn, configModel, modelId);
362
360
 
363
361
  // Conditionally include --model in base args (null = suppress, empty string passes through to surface CLI error)
364
362
  const cliModelArgs = resolvedCliModel !== null ? ['--model', resolvedCliModel] : [];
@@ -1041,7 +1039,7 @@ class ClaudeProvider extends AIProvider {
1041
1039
  }
1042
1040
 
1043
1041
  static getDefaultModel() {
1044
- return 'opus-4.8-xhigh';
1042
+ return 'opus-5-high';
1045
1043
  }
1046
1044
 
1047
1045
  static getInstallInstructions() {
@@ -8,7 +8,7 @@
8
8
 
9
9
  const path = require('path');
10
10
  const { spawn } = require('child_process');
11
- const { AIProvider, registerProvider, quoteShellArgs } = require('./provider');
11
+ const { AIProvider, registerProvider, quoteShellArgs, resolveCliModelConfig } = require('./provider');
12
12
  const logger = require('../utils/logger');
13
13
  const { extractJSON } = require('../utils/json-extractor');
14
14
  const { CancellationError, isAnalysisCancelled } = require('../routes/shared');
@@ -21,24 +21,58 @@ const BIN_DIR = path.join(__dirname, '..', '..', 'bin');
21
21
  /**
22
22
  * Codex model definitions with tier mappings
23
23
  *
24
- * Based on OpenAI's GPT-5.6 launch and Models guide
25
- * (openai.com/index/gpt-5-6 and developers.openai.com/api/docs/models)
26
- * - gpt-5.6-sol: Flagship frontier model for complex professional work
24
+ * Based on OpenAI's GPT-6 Astra launch (Sept 2026), the GPT-5.6 launch, and the
25
+ * Models guide (developers.openai.com/api/docs/models). Verified against the
26
+ * Codex CLI 0.144.0 model catalog.
27
+ * - gpt-6-astra: GPT-6 flagship, the most capable model for complex, demanding
28
+ * work (272k context). Priced several times above Sol, so it is offered as an
29
+ * opt-in thorough choice rather than the default.
30
+ * - gpt-5.6-sol: Strong frontier model for complex professional work (default)
27
31
  * - gpt-5.6-terra: Balances intelligence and cost for everyday work
28
32
  * - gpt-5.6-luna: Fast, affordable model for cost-sensitive, high-volume work
29
- * - gpt-5.4-nano: Cheapest model ($0.20/$1.25 per MTok), good for surface scans
30
- * - gpt-5.4-mini: Fast with 400k context ($0.75/$4.50 per MTok)
31
- * - gpt-5.3-codex: Industry-leading coding model for complex engineering tasks
32
- * - GPT-5.6, gpt-5.4, and gpt-5.5 models are exposed only through the requested
33
- * explicit reasoning-effort variants.
33
+ * - gpt-5.5: Previous-generation frontier model
34
+ * - gpt-5.4-mini: Small, fast, cost-efficient model for simpler coding tasks
35
+ * (272k context) — the sole fast-tier model
36
+ * - GPT-6, GPT-5.6, and GPT-5.5 models are exposed only through explicit
37
+ * reasoning-effort variants.
38
+ *
39
+ * Tiers: thorough (Astra, Sol, GPT-5.5), balanced (Terra, Luna), fast (Mini).
40
+ * Entries are ordered thorough → balanced → fast; the first `fast` entry is the
41
+ * extraction model (see AIProvider.getFastTierModel).
34
42
  *
35
43
  * Reasoning-effort variants (-high / -xhigh / -max) use `cli_model` to pass the base
36
44
  * model ID to `codex exec -m` and add `-c model_reasoning_effort="..."` via
37
45
  * extra_args so Codex picks up the effort level through its config override.
38
46
  *
39
47
  * Deprecated (April 2026): gpt-5.1-codex-mini, gpt-5.1-codex-max, gpt-5.1-codex
48
+ * Deprecated (August 2026): gpt-5.4 (gpt-5.4-high / gpt-5.4-xhigh), gpt-5.4-nano,
49
+ * gpt-5.3-codex — retired by OpenAI; Codex rejects them with a 400. They are
50
+ * intentionally NOT aliased onto other models so saved councils fail loudly
51
+ * instead of silently running a different model.
40
52
  */
41
53
  const CODEX_MODELS = [
54
+ {
55
+ id: 'gpt-6-astra-high',
56
+ cli_model: 'gpt-6-astra',
57
+ extra_args: ['-c', 'model_reasoning_effort="high"'],
58
+ name: 'GPT-6 Astra High',
59
+ tier: 'thorough',
60
+ tagline: 'Most Capable',
61
+ description: 'OpenAI\'s GPT-6 flagship with high reasoning effort for the hardest reviews: deep cross-file analysis, subtle regressions, and demanding architectural work. Costs several times more than Sol.',
62
+ badge: 'Most Capable',
63
+ badgeClass: 'badge-power'
64
+ },
65
+ {
66
+ id: 'gpt-6-astra-xhigh',
67
+ cli_model: 'gpt-6-astra',
68
+ extra_args: ['-c', 'model_reasoning_effort="xhigh"'],
69
+ name: 'GPT-6 Astra XHigh',
70
+ tier: 'thorough',
71
+ tagline: 'Maximum Depth',
72
+ description: 'GPT-6 Astra with extra-high reasoning effort for the most difficult reviews: concurrency, security-sensitive changes, and large codebase context. Premium pricing.',
73
+ badge: 'Extra High',
74
+ badgeClass: 'badge-power'
75
+ },
42
76
  {
43
77
  id: 'gpt-5.6-sol-high',
44
78
  cli_model: 'gpt-5.6-sol',
@@ -46,7 +80,7 @@ const CODEX_MODELS = [
46
80
  name: 'GPT-5.6 Sol High',
47
81
  tier: 'thorough',
48
82
  tagline: 'Frontier Review',
49
- description: 'OpenAI flagship and best coding model yet, with high reasoning effort for demanding PR reviews, complex professional work, and cross-file analysis.',
83
+ description: 'Strong frontier reviewer at a fraction of Astra\'s cost, with high reasoning effort for demanding PR reviews, complex professional work, and cross-file analysis.',
50
84
  badge: 'Recommended',
51
85
  badgeClass: 'badge-recommended',
52
86
  default: true
@@ -62,28 +96,6 @@ const CODEX_MODELS = [
62
96
  badge: 'Extra High',
63
97
  badgeClass: 'badge-power'
64
98
  },
65
- {
66
- id: 'gpt-5.6-terra-xhigh',
67
- cli_model: 'gpt-5.6-terra',
68
- extra_args: ['-c', 'model_reasoning_effort="xhigh"'],
69
- name: 'GPT-5.6 Terra XHigh',
70
- tier: 'balanced',
71
- tagline: 'Intelligence & Value',
72
- description: 'GPT-5.6 balanced model with extra-high reasoning effort, combining strong intelligence and lower cost for careful everyday PR reviews.',
73
- badge: 'Best Balance',
74
- badgeClass: 'badge-balanced'
75
- },
76
- {
77
- id: 'gpt-5.6-luna-max',
78
- cli_model: 'gpt-5.6-luna',
79
- extra_args: ['-c', 'model_reasoning_effort="max"'],
80
- name: 'GPT-5.6 Luna Max',
81
- tier: 'balanced',
82
- tagline: 'High-Volume Value',
83
- description: 'GPT-5.6 fastest, most cost-efficient model with max reasoning effort for high-volume reviews and broad codebase scans.',
84
- badge: 'Lowest Cost',
85
- badgeClass: 'badge-speed'
86
- },
87
99
  {
88
100
  id: 'gpt-5.5-high',
89
101
  cli_model: 'gpt-5.5',
@@ -107,55 +119,34 @@ const CODEX_MODELS = [
107
119
  badgeClass: 'badge-power'
108
120
  },
109
121
  {
110
- id: 'gpt-5.4-high',
111
- // Alias keeps results/councils saved under the previous bare `gpt-5.4`
112
- // model ID resolving to the now-explicit high-effort variant.
113
- aliases: ['gpt-5.4'],
114
- cli_model: 'gpt-5.4',
115
- extra_args: ['-c', 'model_reasoning_effort="high"'],
116
- name: 'GPT-5.4 High',
117
- tier: 'thorough',
118
- tagline: 'Deep Review',
119
- description: 'GPT-5.4 with high reasoning effort for complex multi-file reviews, architectural consistency, and subtle behavioral regressions.',
120
- badge: 'Previous Gen',
121
- badgeClass: 'badge-power'
122
- },
123
- {
124
- id: 'gpt-5.4-xhigh',
125
- cli_model: 'gpt-5.4',
122
+ id: 'gpt-5.6-terra-xhigh',
123
+ cli_model: 'gpt-5.6-terra',
126
124
  extra_args: ['-c', 'model_reasoning_effort="xhigh"'],
127
- name: 'GPT-5.4 XHigh',
128
- tier: 'thorough',
129
- tagline: 'Max Depth',
130
- description: 'GPT-5.4 with extra-high reasoning effort for difficult reviews that need broad context, careful tradeoff analysis, and deeper issue validation.',
131
- badge: 'Extra High',
132
- badgeClass: 'badge-power'
133
- },
134
- {
135
- id: 'gpt-5.3-codex',
136
- name: 'GPT-5.3 Codex',
137
- tier: 'thorough',
138
- tagline: 'Deep Review',
139
- description: 'Industry-leading coding model—frontier performance with strong reasoning for cross-file analysis.',
140
- badge: 'Thorough',
141
- badgeClass: 'badge-power'
125
+ name: 'GPT-5.6 Terra XHigh',
126
+ tier: 'balanced',
127
+ tagline: 'Intelligence & Value',
128
+ description: 'GPT-5.6 balanced model with extra-high reasoning effort, combining strong intelligence and lower cost for careful everyday PR reviews.',
129
+ badge: 'Best Balance',
130
+ badgeClass: 'badge-balanced'
142
131
  },
143
132
  {
144
- id: 'gpt-5.4-mini',
145
- name: 'GPT-5.4 Mini',
133
+ id: 'gpt-5.6-luna-max',
134
+ cli_model: 'gpt-5.6-luna',
135
+ extra_args: ['-c', 'model_reasoning_effort="max"'],
136
+ name: 'GPT-5.6 Luna Max',
146
137
  tier: 'balanced',
147
- tagline: 'Best Balance',
148
- description: 'Fast reviews with 400k context—good balance of speed and capability for everyday PR review.',
149
- badge: 'Fast',
138
+ tagline: 'High-Volume Value',
139
+ description: 'GPT-5.6 fastest, most cost-efficient model with max reasoning effort for high-volume reviews and broad codebase scans.',
140
+ badge: 'Lowest Cost',
150
141
  badgeClass: 'badge-speed'
151
142
  },
152
143
  {
153
- id: 'gpt-5.4-nano',
154
- name: 'GPT-5.4 Nano',
144
+ id: 'gpt-5.4-mini',
145
+ name: 'GPT-5.4 Mini',
155
146
  tier: 'fast',
156
- tagline: 'Cheapest',
157
- description: 'Ultra-low-cost surface scans for style issues, obvious bugs, and lint-level feedback.',
158
- badge: 'Cheapest',
147
+ tagline: 'Quick Scan',
148
+ description: 'Small, fast, cost-efficient model for surface scans: obvious bugs, style issues, and lint-level feedback.',
149
+ badge: 'Fastest',
159
150
  badgeClass: 'badge-speed'
160
151
  }
161
152
  ];
@@ -222,7 +213,7 @@ class CodexProvider extends AIProvider {
222
213
 
223
214
  // Resolve cli_model + extra_args + env from built-in model, provider config,
224
215
  // and per-model config. This is what lets reasoning variants like
225
- // gpt-5.4-high pass `-m gpt-5.4` plus `-c model_reasoning_effort="high"`.
216
+ // gpt-6-astra-high pass `-m gpt-6-astra` plus `-c model_reasoning_effort="high"`.
226
217
  const { cliModel, extraArgs, env } = this._resolveModelConfig(model);
227
218
 
228
219
  // IMPORTANT: `-` (stdin marker) must come LAST, after any extra_args.
@@ -249,8 +240,8 @@ class CodexProvider extends AIProvider {
249
240
  * Produces the CLI model ID (for `-m`), merged extra_args, and merged env.
250
241
  *
251
242
  * Precedence for cli_model: config model > built-in model > modelId.
252
- * `cli_model` lets reasoning-effort variants (e.g. `gpt-5.4-high`) pass the
253
- * base model (`gpt-5.4`) to `codex exec -m` while adding reasoning overrides
243
+ * `cli_model` lets reasoning-effort variants (e.g. `gpt-6-astra-high`) pass the
244
+ * base model (`gpt-6-astra`) to `codex exec -m` while adding reasoning overrides
254
245
  * via extra_args.
255
246
  *
256
247
  * @param {string} modelId
@@ -261,11 +252,15 @@ class CodexProvider extends AIProvider {
261
252
  const configOverrides = this.configOverrides || {};
262
253
 
263
254
  const builtIn = CODEX_MODELS.find(m => m.id === modelId || (m.aliases && m.aliases.includes(modelId)));
264
- const configModel = configOverrides.models?.find(m => m.id === modelId);
265
-
266
- const cliModel = configModel?.cli_model !== undefined
267
- ? configModel.cli_model
268
- : (builtIn?.cli_model !== undefined ? builtIn.cli_model : modelId);
255
+ // A config override may target the built-in by any of its ids/aliases, or
256
+ // declare its own aliases; match on the union so no lookup diverges.
257
+ const modelKeys = new Set([modelId, builtIn?.id, ...(builtIn?.aliases || [])].filter(Boolean));
258
+ const configModel = configOverrides.models?.find(
259
+ m => modelKeys.has(m.id) || (m.aliases || []).some(a => modelKeys.has(a))
260
+ );
261
+
262
+ // Shared cli_model ladder (config model > built-in > id); see provider.js.
263
+ const cliModel = resolveCliModelConfig(builtIn, configModel, modelId);
269
264
 
270
265
  // Three-way merge for extra_args: built-in model → provider config → per-model config
271
266
  const builtInArgs = builtIn?.extra_args || [];
@@ -22,6 +22,8 @@ const { killChildSafely } = require('./abort-signal-wiring');
22
22
  const jsonExtractor = require('../utils/json-extractor');
23
23
  const configModule = require('../config');
24
24
 
25
+ const MAPPING_TIMEOUT_MS = 5 * 60 * 1000;
26
+
25
27
  /**
26
28
  * Convert a snake_case string to camelCase
27
29
  * @param {string} str - snake_case string
@@ -422,7 +424,7 @@ function createExecutableProviderClass(id, config) {
422
424
  const provider = providerModule.createProvider(mappingProviderId);
423
425
  const result = await provider.execute(mappingPrompt, {
424
426
  cwd: process.cwd(),
425
- timeout: 60000,
427
+ timeout: MAPPING_TIMEOUT_MS,
426
428
  level: 'mapping'
427
429
  });
428
430
 
package/src/ai/index.js CHANGED
@@ -24,6 +24,7 @@ const {
24
24
  getProviderConfigOverrides,
25
25
  inferModelDefaults,
26
26
  resolveDefaultModel,
27
+ resolveCliModelConfig,
27
28
  modelMatches,
28
29
  mergeModels,
29
30
  applyModelOverrides,
@@ -87,6 +88,7 @@ module.exports = {
87
88
  getProviderConfigOverrides,
88
89
  inferModelDefaults,
89
90
  resolveDefaultModel,
91
+ resolveCliModelConfig,
90
92
  modelMatches,
91
93
  mergeModels,
92
94
  applyModelOverrides,