Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

fix(loops): source model picker from per-adapter task catalog - #3782

Merged
charlesvien merged 3 commits into
mainfrom
fix/loops-model-picker
Jul 24, 2026
Merged

fix(loops): source model picker from per-adapter task catalog#3782
charlesvien merged 3 commits into
mainfrom
fix/loops-model-picker

Conversation

@charlesvien

@charlesvien charlesvien commented Jul 24, 2026

Copy link
Copy Markdown
Member

Problem

GLM-5.2 shows up in the main create-task model picker but not in loops.

Changes

  • LoopModelFields now builds its model list from the same per-adapter agent.getPreviewConfigOptions source as the main create-task picker: curated models, friendly labels, GLM-5.2 behind the existing posthog-code-glm-model flag, plan-restricted models dropped and a pinned model on an existing loop always kept selectable.
  • New loopModels.ts constrains reasoning-effort options to the effective model's supported set (GLM offers Auto/High/Max) and clamps invalid combos when the adapter or model changes, so the form can no longer submit anything the server's validation in process_task/utils.py rejects.
  • Loop detail and the review step now show the real loop default ("Claude Sonnet 5 (default)") instead of the gateway session default. LOOP_DEFAULT_MODELS mirrors the backend's DEFAULT_MODEL_BY_RUNTIME_ADAPTER unchanged: claude stays on claude-sonnet-5, codex on gpt-5.

How did you test this?

  • 21 new parameterized unit tests in loopModels.test.ts (option building, GLM flag gating, per-model effort sets, clamping).
  • Full @posthog/ui suite (2063 tests), @posthog/ui and @posthog/web typechecks and Biome all pass.

Automatic notifications

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

@trunk-io

trunk-io Bot commented Jul 24, 2026

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 83efe25.

@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/ui/src/features/loops/hooks/useLoopModelConfigOptions.ts:30
**Catalog failures remove model choices**

When the preview-config request is pending or fails, this hook returns an empty catalog, causing the loop picker to show only “Default (recommended)” with no loading or error indication instead of retaining the previous fallback model choices.

Reviews (1): Last reviewed commit: "source loops model picker from preview c..." | Re-trigger Greptile

Comment thread packages/ui/src/features/loops/hooks/useLoopModelConfigOptions.ts
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 24, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Frontend-only fix to the loops model picker reusing existing, already-tested infra (preview config catalog, restricted-model filtering, reasoning-effort helpers); all real behavior enforcement stays server-side. The one Greptile P1 concern (empty catalog on load/error) is in fact addressed by the code's fallback-model-options path, matches its [resolved] status, and 21 new parameterized tests cover the new logic directly.

  • Author wrote 61% of the modified lines and has 8 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 301L, 6F substantive, 568L/7F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1d-complex (568L, 7F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ 3792cce · reviewed head 83efe25

@charlesvien
charlesvien merged commit f969fec into main Jul 24, 2026
38 checks passed
@charlesvien
charlesvien deleted the fix/loops-model-picker branch July 24, 2026 06:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant