mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-16 21:53:07 +00:00
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:
@@ -19,7 +19,7 @@ export function ThinkingLevelSelector({
|
||||
testIdPrefix = 'thinking-level',
|
||||
model,
|
||||
}: ThinkingLevelSelectorProps) {
|
||||
const levels = model ? getThinkingLevelsForModel(model) : getThinkingLevelsForModel('');
|
||||
const levels = getThinkingLevelsForModel(model || '');
|
||||
|
||||
return (
|
||||
<div className="space-y-2 pt-2 border-t border-border">
|
||||
|
||||
@@ -1297,7 +1297,7 @@ export function PhaseModelSelector({
|
||||
Thinking Level
|
||||
</div>
|
||||
{getThinkingLevelsForModel(
|
||||
model.mapsToClaudeModel === 'opus' ? 'claude-opus' : ''
|
||||
model.mapsToClaudeModel === 'opus' ? 'claude-opus' : model.id || ''
|
||||
).map((level) => (
|
||||
<button
|
||||
key={level}
|
||||
@@ -1406,7 +1406,7 @@ export function PhaseModelSelector({
|
||||
Thinking Level
|
||||
</div>
|
||||
{getThinkingLevelsForModel(
|
||||
model.mapsToClaudeModel === 'opus' ? 'claude-opus' : ''
|
||||
model.mapsToClaudeModel === 'opus' ? 'claude-opus' : model.id || ''
|
||||
).map((level) => (
|
||||
<button
|
||||
key={level}
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
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';
|
||||
|
||||
interface CodexModelConfigurationProps {
|
||||
@@ -162,14 +162,3 @@ export function CodexModelConfiguration({
|
||||
</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);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,16 @@ import fs from 'fs/promises';
|
||||
// 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
|
||||
*/
|
||||
@@ -54,19 +64,14 @@ export function getClaudeCliPaths(): string[] {
|
||||
|
||||
if (isWindows) {
|
||||
const appData = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming');
|
||||
const nvmSymlink = process.env.NVM_SYMLINK;
|
||||
const paths = [
|
||||
return [
|
||||
path.join(os.homedir(), '.local', 'bin', 'claude.exe'),
|
||||
path.join(appData, 'npm', 'claude.cmd'),
|
||||
path.join(appData, 'npm', 'claude'),
|
||||
path.join(appData, '.npm-global', 'bin', 'claude.cmd'),
|
||||
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 [
|
||||
@@ -136,8 +141,7 @@ export function getCodexCliPaths(): string[] {
|
||||
if (isWindows) {
|
||||
const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming');
|
||||
const localAppData = process.env.LOCALAPPDATA || path.join(homeDir, 'AppData', 'Local');
|
||||
const nvmSymlink = process.env.NVM_SYMLINK;
|
||||
const paths = [
|
||||
return [
|
||||
path.join(homeDir, '.local', 'bin', 'codex.exe'),
|
||||
path.join(appData, 'npm', 'codex.cmd'),
|
||||
path.join(appData, 'npm', 'codex'),
|
||||
@@ -148,12 +152,8 @@ export function getCodexCliPaths(): string[] {
|
||||
// pnpm on Windows
|
||||
path.join(localAppData, 'pnpm', 'codex.cmd'),
|
||||
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
|
||||
@@ -1138,8 +1138,7 @@ export function getOpenCodeCliPaths(): string[] {
|
||||
if (isWindows) {
|
||||
const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming');
|
||||
const localAppData = process.env.LOCALAPPDATA || path.join(homeDir, 'AppData', 'Local');
|
||||
const nvmSymlink = process.env.NVM_SYMLINK;
|
||||
const paths = [
|
||||
return [
|
||||
// OpenCode's default installation directory
|
||||
path.join(homeDir, '.opencode', '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)
|
||||
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
|
||||
|
||||
@@ -101,7 +101,7 @@ export function getAllCodexModelIds(): CodexModelId[] {
|
||||
export const DEFAULT_MODELS = {
|
||||
claude: 'claude-opus-4-6',
|
||||
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;
|
||||
|
||||
export type ModelAlias = keyof typeof CLAUDE_MODEL_MAP;
|
||||
|
||||
Reference in New Issue
Block a user