Skip to content

fix(tasks): allow GLM reasoning levels - #72549

Merged
tatoalo merged 1 commit into
masterfrom
posthog-code/fix-glm-reasoning-efforts
Jul 21, 2026
Merged

fix(tasks): allow GLM reasoning levels#72549
tatoalo merged 1 commit into
masterfrom
posthog-code/fix-glm-reasoning-efforts

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Problem

GLM 5.2 supports high and max reasoning, but the task backend did not register the model, so valid selections were rejected before a run started. This complements PostHog/code#3615.

Changes

  • Register GLM 5.2 with only its supported high and max reasoning levels.
  • Extend the task API regression matrix to accept those levels and reject medium.

@tatoalo tatoalo self-assigned this Jul 21, 2026
@PostHog PostHog deleted a comment from github-actions Bot Jul 21, 2026
@tatoalo tatoalo added the stamphog Request AI approval (no full review) label Jul 21, 2026
@tatoalo
tatoalo marked this pull request as ready for review July 21, 2026 11:56
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 21, 2026 11:56
@greptile-apps

greptile-apps Bot commented Jul 21, 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
products/tasks/backend/temporal/process_task/utils.py:99-103
**GLM Inherits Anthropic Provider Routing**

Selecting this model through `runtime_adapter="claude"` derives `provider="anthropic"`, and that provider and the `@cf/zai-org/glm-5.2` model name are passed unchanged to the agent server. If provider selects the upstream API or credentials, valid `high` and `max` requests now pass validation but fail when Anthropic receives the Cloudflare-style model identifier.

Reviews (1): Last reviewed commit: "fix(tasks): allow GLM reasoning levels" | Re-trigger Greptile

Comment thread products/tasks/backend/temporal/process_task/utils.py
@stamphog

stamphog Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

🤖 stamphog reviewed d228ff4ba34ef3fe0b094b7819f73300d80fe08f — verdict: REFUSED

Greptile flagged an unresolved, plausible correctness issue: selecting GLM via runtime_adapter="claude" hardcodes provider="anthropic" while the model string stays the Cloudflare-style "@cf/zai-org/glm-5.2" identifier, so newly-allowed high/max requests could pass validation here but fail downstream. It's unaddressed.

  • Author wrote 74% of the modified lines and has 124 merged PRs in these paths (familiarity STRONG).
  • greptile-apps[bot] reviewed the current head.
  • Unresolved Greptile inline comment on products/tasks/backend/temporal/process_task/utils.py:99-103 about provider/model mismatch for the new GLM entry — no reply or follow-up commit addresses it.
  • Provider is derived solely from runtime_adapter (always 'anthropic' for 'claude'), with no override for the Cloudflare-namespaced GLM model id, so the mismatch Greptile describes is visible in this diff and not contradicted by anything else in the file.
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 4L, 1F substantive, 54L/2F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1b-small (54L, 2F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ 7b7de1b · reviewed head d228ff4

@stamphog stamphog Bot removed the stamphog Request AI approval (no full review) label Jul 21, 2026
@tatoalo
tatoalo force-pushed the posthog-code/fix-glm-reasoning-efforts branch from d228ff4 to f0a68eb Compare July 21, 2026 12:26
Generated-By: PostHog Code
Task-Id: 8de0334a-1bc6-40d0-85ce-1544c6105eb8
@tatoalo
tatoalo force-pushed the posthog-code/fix-glm-reasoning-efforts branch from f0a68eb to b817d02 Compare July 21, 2026 13:00
@tatoalo
tatoalo merged commit c82cafa into master Jul 21, 2026
237 checks passed
@tatoalo
tatoalo deleted the posthog-code/fix-glm-reasoning-efforts branch July 21, 2026 13:41
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-21 14:08 UTC Run
prod-us ✅ Deployed 2026-07-21 14:36 UTC Run
prod-eu ✅ Deployed 2026-07-21 14:39 UTC Run

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