feat(agent): add claude-fable-5 model support#2554
Conversation
Adds the new claude-fable-5 model to PostHog Code as a flagship (Opus-class) model. The default remains claude-opus-4-8. - Flag claude-fable-5 for 1M context, reasoning effort, and xhigh/max effort in the Claude session model capability sets. - It has no opus/sonnet/haiku SDK alias, so it passes through to the gateway as its full id (no GATEWAY_TO_SDK_MODEL entry). - Add it to the mobile composer model list (listed first as newest); default stays Opus 4.8. - Tests for the new capability flags and pass-through behaviour. Requires the matching llm-gateway allowlist change in posthog/posthog. Generated-By: PostHog Code Task-Id: 47e16109-09e5-45ea-aaa6-ea0c1496cad2
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
| it("flags claude-fable-5 as a flagship model", () => { | ||
| expect(supports1MContext("claude-fable-5")).toBe(true); | ||
| expect(supportsEffort("claude-fable-5")).toBe(true); | ||
| expect(supportsXhighEffort("claude-fable-5")).toBe(true); | ||
| expect(supportsMcpInjection("claude-fable-5")).toBe(true); | ||
| }); |
There was a problem hiding this comment.
Single
it bundles multiple independent assertions
The project's stated preference is parameterised tests. Bundling four capability checks into one it means that if any single check fails, the rest are not reported. Consider using it.each with a table of [modelId, supports1M, supportsEffort, supportsXhigh, supportsMcp] rows — this would also let existing models (e.g. claude-opus-4-7, claude-opus-4-8) be covered by the same table rather than spread across separate tests.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/agent/src/adapters/claude/session/models.test.ts
Line: 50-55
Comment:
**Single `it` bundles multiple independent assertions**
The project's stated preference is parameterised tests. Bundling four capability checks into one `it` means that if any single check fails, the rest are not reported. Consider using `it.each` with a table of `[modelId, supports1M, supportsEffort, supportsXhigh, supportsMcp]` rows — this would also let existing models (e.g. `claude-opus-4-7`, `claude-opus-4-8`) be covered by the same table rather than spread across separate tests.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Adds the new claude-fable-5 model to PostHog Code as a flagship (Opus-class) model. The default model remains claude-opus-4-8.
Pairs with the LLM gateway change in posthog/posthog: PostHog/posthog#62497 (the gateway must allow the model id for it to appear in the picker).
Changes
claude-fable-5for 1M context, reasoning effort, and xhigh/max effort in the Claude session capability sets (models.ts).GATEWAY_TO_SDK_MODELentry — it has no opus/sonnet/haiku SDK alias, so it passes through to the gateway as its full id (the intended fallback).The desktop model picker is fed dynamically from the gateway's
/v1/models, and the display name auto-derives to "Claude Fable 5" viaformatModelId, so no hardcoded desktop list change is needed.Testing
vitest run packages/agent/src/adapters/claude/session/models.test.ts— 20/20 pass.