Skip to content

fix: Logical model picker option order and naming#3532

Open
Twixes wants to merge 6 commits into
mainfrom
posthog-code/group-model-picker-by-family
Open

fix: Logical model picker option order and naming#3532
Twixes wants to merge 6 commits into
mainfrom
posthog-code/group-model-picker-by-family

Conversation

@Twixes

@Twixes Twixes commented Jul 17, 2026

Copy link
Copy Markdown
Member

tl;dr: Models are now ordered logically in the model picker. And gpt-5.6-sol ->  GPT-5.6 Sol, glm-5.2 -> GLM-5.2.


Problem

The model picker sorted models by the raw version number embedded in their id, which interleaved model families. With a full model list you'd see something like … Opus 4.8, Sonnet 5, Fable 5, scattering the Sonnets and Opuses instead of keeping each family together. Raised in a Slack thread — the ordering read as arbitrary.

Changes

Sort the picker by family (tier) first, then oldest-to-newest within each family. Families now stay contiguous (all Sonnets together, all Opuses together), with the newest flagship family closest to the trigger. Added a compareModelsForPicker comparator in gateway-models.ts and pointed the ACP picker at it.

How did you test this?

pnpm --filter @posthog/agent test gateway-models (30 passing, including an updated grouped-order test). Biome lint clean on the changed files.


Created with PostHog from a Slack thread

Sort the model picker by family (tier) first, then oldest-to-newest within each family, instead of by raw version number alone.

Sorting by version alone interleaves families (e.g. a Sonnet 5 lands between Opus versions), which reads as an arbitrary order. Grouping keeps every family contiguous.

Generated-By: PostHog Code
Task-Id: ea8239ab-8fc1-46b7-8dc6-d3661caf8800
@trunk-io

trunk-io Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit ca6a9fa.

Twixes added 3 commits July 17, 2026 11:58
Order model families most-capable first (Fable, Opus, Sonnet, Haiku) and display OpenAI/Cloudflare model names with their acronym uppercased (gpt-5.5 -> GPT-5.5, glm-5.2 -> GLM-5.2).

Generated-By: PostHog Code
Task-Id: ea8239ab-8fc1-46b7-8dc6-d3661caf8800
Remove a stray blank line flagged by `biome ci` in the quality check.

Generated-By: PostHog Code
Task-Id: ea8239ab-8fc1-46b7-8dc6-d3661caf8800
Sort each family newest-version-first (so Opus 4.8 sits above 4.7 with Fable at the top of the picker), render OpenAI/Cloudflare model names with the acronym uppercased, version attached, and any codename suffix title-cased (gpt-5.6-sol -> "GPT-5.6 Sol"), and trim the code comments to a minimum.

Generated-By: PostHog Code
Task-Id: ea8239ab-8fc1-46b7-8dc6-d3661caf8800
@Twixes
Twixes marked this pull request as ready for review July 17, 2026 10:22
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Order newest version first, format provi..." | Re-trigger Greptile

Comment thread packages/agent/src/gateway-models.ts
Comment thread packages/agent/src/gateway-models.ts
Twixes added 2 commits July 17, 2026 12:30
The Claude adapter's availableModels allowlist rebuilt the picker in the order the models were listed in settings, overriding the family/version sort (Codex, which does not apply the allowlist, was already correct). Re-sort the filtered list with the picker comparator so the allowlist only restricts which models appear, not their order.

Generated-By: PostHog Code
Task-Id: ea8239ab-8fc1-46b7-8dc6-d3661caf8800
Limit acronym uppercasing to GPT and GLM so ordinary Cloudflare model names (e.g. llama-3.1-8b-instruct) are not mangled into misleading all-caps labels. Addresses a Greptile review finding.

Generated-By: PostHog Code
Task-Id: ea8239ab-8fc1-46b7-8dc6-d3661caf8800
@Twixes
Twixes enabled auto-merge (squash) July 17, 2026 16:40
@Twixes Twixes changed the title Group model picker by family for a logical order Logical model picker option order and naming Jul 17, 2026
@Twixes Twixes changed the title Logical model picker option order and naming fix: Logical model picker option order and naming Jul 17, 2026
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