feat: refresh dashboard settings UX and Codex feature toggles (#153)
* feat: refresh dashboard settings UX and Codex feature toggles Improve settings/tasks mobile layout, model effort validation by agent type, and preset models for GPT 5.5 and Opus 4.7. Store Codex fast mode and goals in config.toml with Claude fastMode session sync and updated docs for Codex 0.133. Co-authored-by: Cursor <cursoragent@cursor.com> * style: apply pre-commit formatting after dashboard settings commit Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
64
src/settings-effort.ts
Normal file
64
src/settings-effort.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
export type SettingsAgentType = 'claude-code' | 'codex';
|
||||
|
||||
export const CODEX_EFFORT_VALUES = [
|
||||
'',
|
||||
'low',
|
||||
'medium',
|
||||
'high',
|
||||
'xhigh',
|
||||
'max',
|
||||
] as const;
|
||||
|
||||
export const CLAUDE_EFFORT_VALUES = [
|
||||
'',
|
||||
'low',
|
||||
'medium',
|
||||
'high',
|
||||
'max',
|
||||
] as const;
|
||||
|
||||
export type EffortValue = (typeof CODEX_EFFORT_VALUES)[number];
|
||||
|
||||
export function effortValuesForAgent(
|
||||
agentType: SettingsAgentType,
|
||||
): readonly EffortValue[] {
|
||||
return agentType === 'claude-code'
|
||||
? CLAUDE_EFFORT_VALUES
|
||||
: CODEX_EFFORT_VALUES;
|
||||
}
|
||||
|
||||
export function isEffortSupported(
|
||||
agentType: SettingsAgentType | null | undefined,
|
||||
effort: string,
|
||||
): boolean {
|
||||
if (!effort) return true;
|
||||
if (!agentType) return true;
|
||||
return effortValuesForAgent(agentType).includes(effort as EffortValue);
|
||||
}
|
||||
|
||||
export function readSettingsAgentType(
|
||||
value: string | undefined,
|
||||
): SettingsAgentType | null {
|
||||
if (value === 'claude-code' || value === 'codex') return value;
|
||||
return null;
|
||||
}
|
||||
|
||||
export function agentTypeForRole(
|
||||
role: 'owner' | 'reviewer' | 'arbiter',
|
||||
env:
|
||||
| Record<string, string | undefined>
|
||||
| ((key: string) => string | undefined),
|
||||
): SettingsAgentType | null {
|
||||
const read = typeof env === 'function' ? env : (key: string) => env[key];
|
||||
const key =
|
||||
role === 'owner'
|
||||
? 'OWNER_AGENT_TYPE'
|
||||
: role === 'reviewer'
|
||||
? 'REVIEWER_AGENT_TYPE'
|
||||
: 'ARBITER_AGENT_TYPE';
|
||||
const raw = read(key);
|
||||
if (raw !== undefined) return readSettingsAgentType(raw);
|
||||
if (role === 'owner') return 'codex';
|
||||
if (role === 'reviewer') return 'claude-code';
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user