feat: add GPT-5.2 model support and refresh profiles functionality

- Introduced the GPT-5.2 model with advanced coding capabilities across various components.
- Added a new button in ProfilesView to refresh default profiles, enhancing user experience.
- Updated CodexSetupStep to clarify authentication requirements and added commands for verifying login status.
- Enhanced utility functions to recognize the new GPT-5.2 model in the application.
This commit is contained in:
Kacper
2025-12-13 01:36:15 +01:00
parent 9cf5fff0ad
commit 55603cb5c7
8 changed files with 170 additions and 51 deletions

View File

@@ -146,6 +146,13 @@ const CLAUDE_MODELS: ModelOption[] = [
];
const CODEX_MODELS: ModelOption[] = [
{
id: "gpt-5.2",
label: "GPT-5.2",
description: "Latest OpenAI model with advanced coding capabilities.",
badge: "Latest",
provider: "codex",
},
{
id: "gpt-5.1-codex-max",
label: "GPT-5.1 Codex Max",

View File

@@ -41,6 +41,7 @@ import {
GripVertical,
Lock,
Check,
RefreshCw,
} from "lucide-react";
import { toast } from "sonner";
import {
@@ -89,6 +90,7 @@ const CLAUDE_MODELS: { id: AgentModel; label: string }[] = [
];
const CODEX_MODELS: { id: AgentModel; label: string }[] = [
{ id: "gpt-5.2", label: "GPT-5.2" },
{ id: "gpt-5.1-codex-max", label: "GPT-5.1 Codex Max" },
{ id: "gpt-5.1-codex", label: "GPT-5.1 Codex" },
{ id: "gpt-5.1-codex-mini", label: "GPT-5.1 Codex Mini" },
@@ -461,6 +463,7 @@ export function ProfilesView() {
updateAIProfile,
removeAIProfile,
reorderAIProfiles,
resetAIProfiles,
} = useAppStore();
const shortcuts = useKeyboardShortcutsConfig();
@@ -529,6 +532,13 @@ export function ProfilesView() {
});
};
const handleResetProfiles = () => {
resetAIProfiles();
toast.success("Profiles refreshed", {
description: "Default profiles have been updated to the latest version",
});
};
// Build keyboard shortcuts for profiles view
const profilesShortcuts: KeyboardShortcut[] = useMemo(() => {
const shortcutsList: KeyboardShortcut[] = [];
@@ -568,15 +578,26 @@ export function ProfilesView() {
</p>
</div>
</div>
<HotkeyButton
onClick={() => setShowAddDialog(true)}
hotkey={shortcuts.addProfile}
hotkeyActive={false}
data-testid="add-profile-button"
>
<Plus className="w-4 h-4 mr-2" />
New Profile
</HotkeyButton>
<div className="flex items-center gap-2">
<Button
variant="outline"
onClick={handleResetProfiles}
data-testid="refresh-profiles-button"
className="gap-2"
>
<RefreshCw className="w-4 h-4" />
Refresh Defaults
</Button>
<HotkeyButton
onClick={() => setShowAddDialog(true)}
hotkey={shortcuts.addProfile}
hotkeyActive={false}
data-testid="add-profile-button"
>
<Plus className="w-4 h-4 mr-2" />
New Profile
</HotkeyButton>
</div>
</div>
</div>
</div>

View File

@@ -282,21 +282,21 @@ export function CodexSetupStep({
<Key className="w-5 h-5" />
Authentication
</CardTitle>
<CardDescription>Codex requires an OpenAI API key</CardDescription>
<CardDescription>Codex requires authentication via ChatGPT account or API key</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
{codexCliStatus?.installed && (
<div className="p-4 rounded-lg bg-muted/50 border border-border">
<div className="flex items-start gap-3">
<Terminal className="w-5 h-5 text-green-500 mt-0.5" />
<div>
<p className="font-medium text-foreground">
Authenticate via CLI
<div className="flex-1">
<p className="font-medium text-foreground mb-2">
Authenticate via CLI (Recommended)
</p>
<p className="text-sm text-muted-foreground mb-2">
Run this command in your terminal:
<p className="text-sm text-muted-foreground mb-3">
Run the following command in your terminal to login with your ChatGPT account:
</p>
<div className="flex items-center gap-2">
<div className="flex items-center gap-2 mb-3">
<code className="bg-muted px-3 py-1 rounded text-sm font-mono text-foreground">
codex auth login
</code>
@@ -308,6 +308,21 @@ export function CodexSetupStep({
<Copy className="w-4 h-4" />
</Button>
</div>
<p className="text-xs text-muted-foreground mb-2">
After logging in, you can verify your authentication status:
</p>
<div className="flex items-center gap-2">
<code className="bg-muted px-3 py-1 rounded text-sm font-mono text-foreground">
codex login status
</code>
<Button
variant="ghost"
size="icon"
onClick={() => copyCommand("codex login status")}
>
<Copy className="w-4 h-4" />
</Button>
</div>
</div>
</div>
</div>

View File

@@ -12,6 +12,7 @@ export function cn(...inputs: ClassValue[]) {
export function isCodexModel(model?: AgentModel | string): boolean {
if (!model) return false;
const codexModels: string[] = [
"gpt-5.2",
"gpt-5.1-codex-max",
"gpt-5.1-codex",
"gpt-5.1-codex-mini",
@@ -36,6 +37,7 @@ export function getModelDisplayName(model: AgentModel | string): string {
haiku: "Claude Haiku",
sonnet: "Claude Sonnet",
opus: "Claude Opus",
"gpt-5.2": "GPT-5.2",
"gpt-5.1-codex-max": "GPT-5.1 Codex Max",
"gpt-5.1-codex": "GPT-5.1 Codex",
"gpt-5.1-codex-mini": "GPT-5.1 Codex Mini",

View File

@@ -203,6 +203,7 @@ export interface FeatureImagePath {
export type ClaudeModel = "opus" | "sonnet" | "haiku";
// OpenAI/Codex models
export type OpenAIModel =
| "gpt-5.2"
| "gpt-5.1-codex-max"
| "gpt-5.1-codex"
| "gpt-5.1-codex-mini"
@@ -445,6 +446,7 @@ export interface AppActions {
updateAIProfile: (id: string, updates: Partial<AIProfile>) => void;
removeAIProfile: (id: string) => void;
reorderAIProfiles: (oldIndex: number, newIndex: number) => void;
resetAIProfiles: () => void;
// Project Analysis actions
setProjectAnalysis: (analysis: ProjectAnalysis | null) => void;
@@ -491,6 +493,16 @@ const DEFAULT_AI_PROFILES: AIProfile[] = [
isBuiltIn: true,
icon: "Zap",
},
{
id: "profile-gpt52",
name: "GPT-5.2",
description: "GPT-5.2 - Latest OpenAI model for advanced coding tasks.",
model: "gpt-5.2",
thinkingLevel: "none",
provider: "codex",
isBuiltIn: true,
icon: "Sparkles",
},
{
id: "profile-codex-power",
name: "Codex Power",
@@ -1106,6 +1118,14 @@ export const useAppStore = create<AppState & AppActions>()(
set({ aiProfiles: profiles });
},
resetAIProfiles: () => {
// Merge: keep user-created profiles, but refresh all built-in profiles to latest defaults
const currentProfiles = get().aiProfiles;
const userProfiles = currentProfiles.filter((p) => !p.isBuiltIn);
const mergedProfiles = [...DEFAULT_AI_PROFILES, ...userProfiles];
set({ aiProfiles: mergedProfiles });
},
// Project Analysis actions
setProjectAnalysis: (analysis) => set({ projectAnalysis: analysis }),
setIsAnalyzing: (analyzing) => set({ isAnalyzing: analyzing }),