Skip to content

feat(models): add Claude Sonnet 5 to available models#3036

Merged
richardsolomou merged 5 commits into
mainfrom
posthog-code/add-claude-sonnet-5
Jun 30, 2026
Merged

feat(models): add Claude Sonnet 5 to available models#3036
richardsolomou merged 5 commits into
mainfrom
posthog-code/add-claude-sonnet-5

Conversation

@richardsolomou

Copy link
Copy Markdown
Member

Problem

We want Claude Sonnet 5 selectable as a model in PostHog Code.

Changes

  • Add claude-sonnet-5 ("Claude Sonnet 5") to the mobile composer's static model picker, above Sonnet 4.6.
  • Grant claude-sonnet-5 1M-context and effort support in the Claude adapter (MODELS_WITH_1M_CONTEXT, MODELS_WITH_EFFORT), mirroring Sonnet 4.6's capability profile — effort levels low/medium/high, no xhigh (Opus-tier only).
  • Add a unit test documenting the new model's capability flags.

The desktop/web picker fetches models dynamically from the gateway's /v1/models and only filters a BLOCKED_MODELS set, so Sonnet 5 surfaces there automatically once the gateway serves it — no list edit required there. The gateway ID is inferred as claude-sonnet-5 (matching the claude-fable-5 convention); adjust if the real ID/capabilities differ.

Deliberately left alone: GATEWAY_TO_SDK_MODEL (the full ID passes through rather than aliasing to sonnet, which resolves to 4.6) and the useModelCatalog fallback / Storybook mocks (not load-bearing for availability).

How did you test this?

  • vitest run packages/agent/.../models.test.ts — 32 passed, including the new claude-sonnet-5 capability test.

Automatic notifications

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

Adds claude-sonnet-5 to the mobile model picker and grants it 1M
context + effort support in the Claude adapter, mirroring Sonnet 4.6's
capability profile (no xhigh). The desktop/web picker discovers it
automatically from the gateway since it is not in BLOCKED_MODELS.

Generated-By: PostHog Code
Task-Id: f014a1c4-35e9-4468-abe8-7df96fe69786
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 7c2015c.

@richardsolomou richardsolomou requested a review from a team June 30, 2026 18:35
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff (1)

  1. packages/agent/src/adapters/claude/session/models.test.ts, line 82-86 (link)

    P2 The existing parameterized resolveEffortForModel table covers claude-sonnet-4-6 as an effort-capable model that falls back to "high", but the new claude-sonnet-5 isn't added there. Without this row the test suite doesn't verify that the new model's default effort resolves correctly, even though claude-sonnet-5 is now in MODELS_WITH_EFFORT.

Reviews (1): Last reviewed commit: "feat(models): add Claude Sonnet 5 to ava..." | Re-trigger Greptile

Comment thread packages/agent/src/adapters/claude/session/models.test.ts Outdated
richardsolomou and others added 3 commits June 30, 2026 21:48
Keeps the Storybook model-picker mock representative of the real
gateway list now that claude-sonnet-5 is selectable.

Generated-By: PostHog Code
Task-Id: f014a1c4-35e9-4468-abe8-7df96fe69786
@charlesvien charlesvien added the Create Release This will trigger a new release label Jun 30, 2026
@richardsolomou richardsolomou merged commit 9f57e30 into main Jun 30, 2026
23 checks passed
@richardsolomou richardsolomou deleted the posthog-code/add-claude-sonnet-5 branch June 30, 2026 20:25
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.

3 participants