Skip to content

feat(agent): add claude-fable-5 model support#2554

Merged
k11kirky merged 1 commit into
mainfrom
posthog-code/add-claude-fable-5
Jun 9, 2026
Merged

feat(agent): add claude-fable-5 model support#2554
k11kirky merged 1 commit into
mainfrom
posthog-code/add-claude-fable-5

Conversation

@k11kirky

@k11kirky k11kirky commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

  • Flag claude-fable-5 for 1M context, reasoning effort, and xhigh/max effort in the Claude session capability sets (models.ts).
  • No GATEWAY_TO_SDK_MODEL entry — it has no opus/sonnet/haiku SDK alias, so it passes through to the gateway as its full id (the intended fallback).
  • Add it to the mobile composer model list (listed first as newest); default stays Opus 4.8.
  • Unit tests for the new capability flags and pass-through behaviour.

The desktop model picker is fed dynamically from the gateway's /v1/models, and the display name auto-derives to "Claude Fable 5" via formatModelId, so no hardcoded desktop list change is needed.

Testing

  • vitest run packages/agent/src/adapters/claude/session/models.test.ts — 20/20 pass.

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
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 7cf1884.

@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff (1)

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

    P2 Missing getEffortOptions test for claude-fable-5

    The getEffortOptions describe block covers claude-haiku-4-5, claude-opus-4-6, claude-sonnet-4-6, and claude-opus-4-7 — but not claude-fable-5. Since this model is added to MODELS_WITH_XHIGH_EFFORT, it should produce the full five-option list (low/medium/high/xhigh/max). Without a case here, the indirect path through getEffortOptions is unverified for the new model ID despite the flag tests passing.

    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: 67-88
    
    Comment:
    **Missing `getEffortOptions` test for `claude-fable-5`**
    
    The `getEffortOptions` describe block covers `claude-haiku-4-5`, `claude-opus-4-6`, `claude-sonnet-4-6`, and `claude-opus-4-7` — but not `claude-fable-5`. Since this model is added to `MODELS_WITH_XHIGH_EFFORT`, it should produce the full five-option list (`low/medium/high/xhigh/max`). Without a case here, the indirect path through `getEffortOptions` is unverified for the new model ID despite the flag tests passing.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
packages/agent/src/adapters/claude/session/models.test.ts:67-88
**Missing `getEffortOptions` test for `claude-fable-5`**

The `getEffortOptions` describe block covers `claude-haiku-4-5`, `claude-opus-4-6`, `claude-sonnet-4-6`, and `claude-opus-4-7` — but not `claude-fable-5`. Since this model is added to `MODELS_WITH_XHIGH_EFFORT`, it should produce the full five-option list (`low/medium/high/xhigh/max`). Without a case here, the indirect path through `getEffortOptions` is unverified for the new model ID despite the flag tests passing.

### Issue 2 of 2
packages/agent/src/adapters/claude/session/models.test.ts:50-55
**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.

Reviews (1): Last reviewed commit: "feat(agent): add claude-fable-5 model su..." | Re-trigger Greptile

Comment on lines +50 to +55
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);
});

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 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!

@k11kirky k11kirky merged commit d4931fa into main Jun 9, 2026
16 checks passed
@k11kirky k11kirky deleted the posthog-code/add-claude-fable-5 branch June 9, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants