feat: update defautls#2431
Conversation
|
| export function formatGatewayModelName(model: GatewayModel): string { | ||
| if (isOpenAIModel(model)) { | ||
| return model.id.toLowerCase(); | ||
| } | ||
|
|
||
| return formatModelId(model.id); | ||
| } |
There was a problem hiding this comment.
formatGatewayModelName now returns model.id.toLowerCase() for OpenAI models without stripping the provider prefix first. The old path (formatModelId) stripped prefixes like "openai/" before formatting. If the gateway serves a model with id: "openai/gpt-5.3", this function now returns "openai/gpt-5.3" as the display name instead of "gpt-5.3". The blocked-models set itself includes prefixed forms like "openai/gpt-5.3", confirming the gateway does return prefixed IDs, so this regression is reachable in production.
| export function formatGatewayModelName(model: GatewayModel): string { | |
| if (isOpenAIModel(model)) { | |
| return model.id.toLowerCase(); | |
| } | |
| return formatModelId(model.id); | |
| } | |
| export function formatGatewayModelName(model: GatewayModel): string { | |
| if (isOpenAIModel(model)) { | |
| return formatCodexModelName(model.id); | |
| } | |
| return formatModelId(model.id); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/agent/src/gateway-models.ts
Line: 179-185
Comment:
`formatGatewayModelName` now returns `model.id.toLowerCase()` for OpenAI models without stripping the provider prefix first. The old path (`formatModelId`) stripped prefixes like `"openai/"` before formatting. If the gateway serves a model with `id: "openai/gpt-5.3"`, this function now returns `"openai/gpt-5.3"` as the display name instead of `"gpt-5.3"`. The blocked-models set itself includes prefixed forms like `"openai/gpt-5.3"`, confirming the gateway does return prefixed IDs, so this regression is reachable in production.
```suggestion
export function formatGatewayModelName(model: GatewayModel): string {
if (isOpenAIModel(model)) {
return formatCodexModelName(model.id);
}
return formatModelId(model.id);
}
```
How can I resolve this? If you propose a fix, please make it concise.|
|
||
| export const DEFAULT_CODEX_MODEL = "gpt-5.5"; | ||
|
|
||
| export const BLOCKED_MODELS = new Set([ |
There was a problem hiding this comment.
BLOCKED_MODELS is still exported publicly, but all its entries are lowercase. Any caller that uses BLOCKED_MODELS.has() directly (instead of isBlockedModelId()) will silently bypass the case-normalisation, potentially allowing a mixed-case blocked ID like "Claude-Opus-4-5" to slip through. Since the exported set is no longer safe to call directly, it should either be unexported or documented as internal.
| export const BLOCKED_MODELS = new Set([ | |
| const BLOCKED_MODELS = new Set([ |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/agent/src/gateway-models.ts
Line: 22
Comment:
`BLOCKED_MODELS` is still exported publicly, but all its entries are lowercase. Any caller that uses `BLOCKED_MODELS.has()` directly (instead of `isBlockedModelId()`) will silently bypass the case-normalisation, potentially allowing a mixed-case blocked ID like `"Claude-Opus-4-5"` to slip through. Since the exported set is no longer safe to call directly, it should either be unexported or documented as internal.
```suggestion
const BLOCKED_MODELS = new Set([
```
How can I resolve this? If you propose a fix, please make it concise.214c59f to
eb541c1
Compare
490f0bd to
c3886ab
Compare
eb541c1 to
fe43578
Compare

Problem
Model version references throughout the codebase were pointing to outdated Claude and Codex model IDs. Deprecated models were also not being consistently blocked across all code paths, and OpenAI model name formatting was inconsistent with how those models are identified in practice.
Changes
claude-opus-4-7toclaude-opus-4-8and default Codex model fromgpt-5.4togpt-5.5across all references in the agent package, mobile app, and desktop app.BLOCKED_MODELSset to include deprecated Claude models (claude-opus-4-5,claude-opus-4-6,claude-sonnet-4-5,claude-haiku-4-5) and deprecated Codex models (gpt-5.2,gpt-5.3,gpt-5.3-codex), along with theiranthropic/andopenai/prefixed variants.BLOCKED_MODELS.has()calls with a newisBlockedModelId()function that normalises model IDs to lowercase before checking, making the block list case-insensitive.claude-opus-4-5,claude-opus-4-6,claude-sonnet-4-5,claude-haiku-4-5) from the gateway-to-SDK model map, 1M context support set, effort support sets, and MCP injection support logic.formatCodexModelNameto return the raw lowercase model ID instead of applying title-case and acronym formatting, and updatedformatGatewayModelNameto use this approach for OpenAI models.claude-opus-4-8.isBlockedModelIdfiltering insidefetchModelsListto ensure blocked models are excluded at the list-fetch level as well.How did you test this?
Existing unit tests were updated to reflect the new model IDs and capability flags. New tests were added for
isBlockedModelId(covering both Claude and Codex deprecated models, including mixed-case variants) andformatCodexModelName. All affected test suites pass with the updated model definitions.Automatic notifications