fix: show actual OpenAI model name in welcome screen UI
When using OpenAI provider, getPublicModelDisplayName() was incorrectly returning "Opus 4.6" because CLAUDE_OPUS_4_6_CONFIG.openai maps to 'gpt-4o', causing a false match in the switch statement. Now returns null for OpenAI provider so the raw model name (e.g. 'gpt-4o') is displayed directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -193,6 +193,11 @@ export function getRuntimeMainLoopModel(params: {
|
|||||||
* @returns The default model setting to use
|
* @returns The default model setting to use
|
||||||
*/
|
*/
|
||||||
export function getDefaultMainLoopModelSetting(): ModelName | ModelAlias {
|
export function getDefaultMainLoopModelSetting(): ModelName | ModelAlias {
|
||||||
|
// OpenAI provider: always use the configured OpenAI model
|
||||||
|
if (getAPIProvider() === 'openai') {
|
||||||
|
return process.env.OPENAI_MODEL || 'gpt-4o'
|
||||||
|
}
|
||||||
|
|
||||||
// Ants default to defaultModel from flag config, or Opus 1M if not configured
|
// Ants default to defaultModel from flag config, or Opus 1M if not configured
|
||||||
if (process.env.USER_TYPE === 'ant') {
|
if (process.env.USER_TYPE === 'ant') {
|
||||||
return (
|
return (
|
||||||
@@ -364,6 +369,10 @@ export function renderModelSetting(setting: ModelName | ModelAlias): string {
|
|||||||
* if the model is not recognized as a public model.
|
* if the model is not recognized as a public model.
|
||||||
*/
|
*/
|
||||||
export function getPublicModelDisplayName(model: ModelName): string | null {
|
export function getPublicModelDisplayName(model: ModelName): string | null {
|
||||||
|
// For OpenAI provider, show the actual model name (e.g. 'gpt-4o') not a Claude alias
|
||||||
|
if (getAPIProvider() === 'openai') {
|
||||||
|
return null
|
||||||
|
}
|
||||||
switch (model) {
|
switch (model) {
|
||||||
case getModelStrings().opus46:
|
case getModelStrings().opus46:
|
||||||
return 'Opus 4.6'
|
return 'Opus 4.6'
|
||||||
|
|||||||
Reference in New Issue
Block a user