fix: address PR #757 review comments

- Extract getNvmWindowsCliPaths() helper to DRY up NVM_SYMLINK logic
- Update DEFAULT_MODELS.codex to gpt53Codex
- Simplify redundant ternary in thinking-level-selector
- Replace local supportsReasoningEffort with shared import from @automaker/types
- Use model.id fallback in phase-model-selector thinking level resolution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Shirone
2026-02-15 16:59:54 +01:00
parent 09507bff67
commit 8ed13564f6
5 changed files with 21 additions and 37 deletions

View File

@@ -19,7 +19,7 @@ export function ThinkingLevelSelector({
testIdPrefix = 'thinking-level', testIdPrefix = 'thinking-level',
model, model,
}: ThinkingLevelSelectorProps) { }: ThinkingLevelSelectorProps) {
const levels = model ? getThinkingLevelsForModel(model) : getThinkingLevelsForModel(''); const levels = getThinkingLevelsForModel(model || '');
return ( return (
<div className="space-y-2 pt-2 border-t border-border"> <div className="space-y-2 pt-2 border-t border-border">

View File

@@ -1297,7 +1297,7 @@ export function PhaseModelSelector({
Thinking Level Thinking Level
</div> </div>
{getThinkingLevelsForModel( {getThinkingLevelsForModel(
model.mapsToClaudeModel === 'opus' ? 'claude-opus' : '' model.mapsToClaudeModel === 'opus' ? 'claude-opus' : model.id || ''
).map((level) => ( ).map((level) => (
<button <button
key={level} key={level}
@@ -1406,7 +1406,7 @@ export function PhaseModelSelector({
Thinking Level Thinking Level
</div> </div>
{getThinkingLevelsForModel( {getThinkingLevelsForModel(
model.mapsToClaudeModel === 'opus' ? 'claude-opus' : '' model.mapsToClaudeModel === 'opus' ? 'claude-opus' : model.id || ''
).map((level) => ( ).map((level) => (
<button <button
key={level} key={level}

View File

@@ -9,7 +9,7 @@ import {
SelectValue, SelectValue,
} from '@/components/ui/select'; } from '@/components/ui/select';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import type { CodexModelId } from '@automaker/types'; import { supportsReasoningEffort, type CodexModelId } from '@automaker/types';
import { OpenAIIcon } from '@/components/ui/provider-icon'; import { OpenAIIcon } from '@/components/ui/provider-icon';
interface CodexModelConfigurationProps { interface CodexModelConfigurationProps {
@@ -162,14 +162,3 @@ export function CodexModelConfiguration({
</div> </div>
); );
} }
function supportsReasoningEffort(modelId: string): boolean {
const reasoningModels = [
'codex-gpt-5.3-codex',
'codex-gpt-5.2-codex',
'codex-gpt-5.1-codex-max',
'codex-gpt-5.2',
'codex-gpt-5.1',
];
return reasoningModels.includes(modelId);
}

View File

@@ -25,6 +25,16 @@ import fs from 'fs/promises';
// System Tool Path Definitions // System Tool Path Definitions
// ============================================================================= // =============================================================================
/**
* Get NVM for Windows (nvm4w) symlink paths for a given CLI tool.
* Reused across getClaudeCliPaths, getCodexCliPaths, and getOpenCodeCliPaths.
*/
function getNvmWindowsCliPaths(cliName: string): string[] {
const nvmSymlink = process.env.NVM_SYMLINK;
if (!nvmSymlink) return [];
return [path.join(nvmSymlink, `${cliName}.cmd`), path.join(nvmSymlink, cliName)];
}
/** /**
* Get common paths where GitHub CLI might be installed * Get common paths where GitHub CLI might be installed
*/ */
@@ -54,19 +64,14 @@ export function getClaudeCliPaths(): string[] {
if (isWindows) { if (isWindows) {
const appData = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming'); const appData = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming');
const nvmSymlink = process.env.NVM_SYMLINK; return [
const paths = [
path.join(os.homedir(), '.local', 'bin', 'claude.exe'), path.join(os.homedir(), '.local', 'bin', 'claude.exe'),
path.join(appData, 'npm', 'claude.cmd'), path.join(appData, 'npm', 'claude.cmd'),
path.join(appData, 'npm', 'claude'), path.join(appData, 'npm', 'claude'),
path.join(appData, '.npm-global', 'bin', 'claude.cmd'), path.join(appData, '.npm-global', 'bin', 'claude.cmd'),
path.join(appData, '.npm-global', 'bin', 'claude'), path.join(appData, '.npm-global', 'bin', 'claude'),
...getNvmWindowsCliPaths('claude'),
]; ];
// nvm4w (NVM for Windows) symlink path
if (nvmSymlink) {
paths.push(path.join(nvmSymlink, 'claude.cmd'), path.join(nvmSymlink, 'claude'));
}
return paths;
} }
return [ return [
@@ -136,8 +141,7 @@ export function getCodexCliPaths(): string[] {
if (isWindows) { if (isWindows) {
const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming'); const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming');
const localAppData = process.env.LOCALAPPDATA || path.join(homeDir, 'AppData', 'Local'); const localAppData = process.env.LOCALAPPDATA || path.join(homeDir, 'AppData', 'Local');
const nvmSymlink = process.env.NVM_SYMLINK; return [
const paths = [
path.join(homeDir, '.local', 'bin', 'codex.exe'), path.join(homeDir, '.local', 'bin', 'codex.exe'),
path.join(appData, 'npm', 'codex.cmd'), path.join(appData, 'npm', 'codex.cmd'),
path.join(appData, 'npm', 'codex'), path.join(appData, 'npm', 'codex'),
@@ -148,12 +152,8 @@ export function getCodexCliPaths(): string[] {
// pnpm on Windows // pnpm on Windows
path.join(localAppData, 'pnpm', 'codex.cmd'), path.join(localAppData, 'pnpm', 'codex.cmd'),
path.join(localAppData, 'pnpm', 'codex'), path.join(localAppData, 'pnpm', 'codex'),
...getNvmWindowsCliPaths('codex'),
]; ];
// nvm4w (NVM for Windows) symlink path
if (nvmSymlink) {
paths.push(path.join(nvmSymlink, 'codex.cmd'), path.join(nvmSymlink, 'codex'));
}
return paths;
} }
// Include NVM bin paths for codex installed via npm global under NVM // Include NVM bin paths for codex installed via npm global under NVM
@@ -1138,8 +1138,7 @@ export function getOpenCodeCliPaths(): string[] {
if (isWindows) { if (isWindows) {
const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming'); const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming');
const localAppData = process.env.LOCALAPPDATA || path.join(homeDir, 'AppData', 'Local'); const localAppData = process.env.LOCALAPPDATA || path.join(homeDir, 'AppData', 'Local');
const nvmSymlink = process.env.NVM_SYMLINK; return [
const paths = [
// OpenCode's default installation directory // OpenCode's default installation directory
path.join(homeDir, '.opencode', 'bin', 'opencode.exe'), path.join(homeDir, '.opencode', 'bin', 'opencode.exe'),
path.join(homeDir, '.local', 'bin', 'opencode.exe'), path.join(homeDir, '.local', 'bin', 'opencode.exe'),
@@ -1155,12 +1154,8 @@ export function getOpenCodeCliPaths(): string[] {
// Go installation (if OpenCode is a Go binary) // Go installation (if OpenCode is a Go binary)
path.join(homeDir, 'go', 'bin', 'opencode.exe'), path.join(homeDir, 'go', 'bin', 'opencode.exe'),
path.join(process.env.GOPATH || path.join(homeDir, 'go'), 'bin', 'opencode.exe'), path.join(process.env.GOPATH || path.join(homeDir, 'go'), 'bin', 'opencode.exe'),
...getNvmWindowsCliPaths('opencode'),
]; ];
// nvm4w (NVM for Windows) symlink path
if (nvmSymlink) {
paths.push(path.join(nvmSymlink, 'opencode.cmd'), path.join(nvmSymlink, 'opencode'));
}
return paths;
} }
// Include NVM bin paths for opencode installed via npm global under NVM // Include NVM bin paths for opencode installed via npm global under NVM

View File

@@ -101,7 +101,7 @@ export function getAllCodexModelIds(): CodexModelId[] {
export const DEFAULT_MODELS = { export const DEFAULT_MODELS = {
claude: 'claude-opus-4-6', claude: 'claude-opus-4-6',
cursor: 'cursor-auto', // Cursor's recommended default (with prefix) cursor: 'cursor-auto', // Cursor's recommended default (with prefix)
codex: CODEX_MODEL_MAP.gpt52Codex, // GPT-5.2-Codex is the most advanced agentic coding model codex: CODEX_MODEL_MAP.gpt53Codex, // GPT-5.3-Codex is the latest frontier agentic coding model
} as const; } as const;
export type ModelAlias = keyof typeof CLAUDE_MODEL_MAP; export type ModelAlias = keyof typeof CLAUDE_MODEL_MAP;