Skip to content

feat: update defautls#2431

Merged
k11kirky merged 1 commit into
mainfrom
05-29-feat_update_defautls
May 29, 2026
Merged

feat: update defautls#2431
k11kirky merged 1 commit into
mainfrom
05-29-feat_update_defautls

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

@k11kirky k11kirky commented May 29, 2026

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

  • Bumped default Claude model from claude-opus-4-7 to claude-opus-4-8 and default Codex model from gpt-5.4 to gpt-5.5 across all references in the agent package, mobile app, and desktop app.
  • Expanded the BLOCKED_MODELS set 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 their anthropic/ and openai/ prefixed variants.
  • Replaced direct BLOCKED_MODELS.has() calls with a new isBlockedModelId() function that normalises model IDs to lowercase before checking, making the block list case-insensitive.
  • Removed deprecated model IDs (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.
  • Simplified formatCodexModelName to return the raw lowercase model ID instead of applying title-case and acronym formatting, and updated formatGatewayModelName to use this approach for OpenAI models.
  • Removed Claude Haiku 4.5 from the mobile model picker and updated the mobile default model constant to claude-opus-4-8.
  • Applied isBlockedModelId filtering inside fetchModelsList to 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) and formatCodexModelName. All affected test suites pass with the updated model definitions.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@k11kirky k11kirky marked this pull request as ready for review May 29, 2026 10:13
@k11kirky k11kirky added the Create Release This will trigger a new release label May 29, 2026 — with Graphite App
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Comments Outside Diff (1)

  1. apps/code/src/main/services/agent/service.test.ts, line 89-97 (link)

    P2 Mock missing isBlockedModelId

    The vi.mock for @posthog/agent/gateway-models now omits isBlockedModelId, which is imported and called in packages/agent/src/agent.ts. If any test exercise path reaches that import through the same resolved module, calling isBlockedModelId(...) would throw TypeError: isBlockedModelId is not a function. Adding it as isBlockedModelId: vi.fn().mockReturnValue(false) would make the mock safe against future test expansions that exercise the agent's model-filtering logic.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/code/src/main/services/agent/service.test.ts
    Line: 89-97
    
    Comment:
    **Mock missing `isBlockedModelId`**
    
    The `vi.mock` for `@posthog/agent/gateway-models` now omits `isBlockedModelId`, which is imported and called in `packages/agent/src/agent.ts`. If any test exercise path reaches that import through the same resolved module, calling `isBlockedModelId(...)` would throw `TypeError: isBlockedModelId is not a function`. Adding it as `isBlockedModelId: vi.fn().mockReturnValue(false)` would make the mock safe against future test expansions that exercise the agent's model-filtering logic.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
packages/agent/src/gateway-models.ts:179-185
`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);
}
```

### Issue 2 of 3
packages/agent/src/gateway-models.ts:22
`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([
```

### Issue 3 of 3
apps/code/src/main/services/agent/service.test.ts:89-97
**Mock missing `isBlockedModelId`**

The `vi.mock` for `@posthog/agent/gateway-models` now omits `isBlockedModelId`, which is imported and called in `packages/agent/src/agent.ts`. If any test exercise path reaches that import through the same resolved module, calling `isBlockedModelId(...)` would throw `TypeError: isBlockedModelId is not a function`. Adding it as `isBlockedModelId: vi.fn().mockReturnValue(false)` would make the mock safe against future test expansions that exercise the agent's model-filtering logic.

Reviews (1): Last reviewed commit: "feat: update defautls" | Re-trigger Greptile

Comment on lines 179 to 185
export function formatGatewayModelName(model: GatewayModel): string {
if (isOpenAIModel(model)) {
return model.id.toLowerCase();
}

return formatModelId(model.id);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Suggested change
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.

Comment thread packages/agent/src/gateway-models.ts Outdated

export const DEFAULT_CODEX_MODEL = "gpt-5.5";

export const BLOCKED_MODELS = new Set([
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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.

Copy link
Copy Markdown
Contributor Author

k11kirky commented May 29, 2026

Merge activity

  • May 29, 10:26 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 29, 11:11 AM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 11:16 AM UTC: @k11kirky merged this pull request with Graphite.

@k11kirky k11kirky force-pushed the 05-29-feat_update_defautls branch from 214c59f to eb541c1 Compare May 29, 2026 10:52
@k11kirky k11kirky force-pushed the 05-29-feat_add_enthropic_packages_to_exlude_list branch from 490f0bd to c3886ab Compare May 29, 2026 10:52
@k11kirky k11kirky changed the base branch from 05-29-feat_add_enthropic_packages_to_exlude_list to graphite-base/2431 May 29, 2026 11:02
@k11kirky k11kirky changed the base branch from graphite-base/2431 to main May 29, 2026 11:09
@k11kirky k11kirky force-pushed the 05-29-feat_update_defautls branch from eb541c1 to fe43578 Compare May 29, 2026 11:10
@k11kirky k11kirky merged commit 723cd17 into main May 29, 2026
19 checks passed
@k11kirky k11kirky deleted the 05-29-feat_update_defautls branch May 29, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Create Release This will trigger a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants