Skip to content

Fix GLM-5.2 requests failing with 400 on the developer role - #2

Open
estridell wants to merge 1 commit into
maxpaulus43:mainfrom
estridell:glm-developer-role
Open

Fix GLM-5.2 requests failing with 400 on the developer role#2
estridell wants to merge 1 commit into
maxpaulus43:mainfrom
estridell:glm-developer-role

Conversation

@estridell

@estridell estridell commented Jul 22, 2026

Copy link
Copy Markdown

Every cline-pass/glm-5.2 request failed before generation:

request failed with status 400:
{"error":{"message":"developer is not one of ['system', 'assistant', 'user', 'tool', 'function']", ...}}

pi sends the system prompt with the developer role for reasoning models, and the GLM upstream behind ClinePass only accepts system/assistant/user/tool/function.

Fix: set compat.supportsDeveloperRole: false on the glm-5.2 catalog entry so pi sends the system prompt as a plain system message. The flag survives the live recommended-models merge because that path spreads the static entry.

Also widened PiModel.compat from the prompt-cache-only ClinePromptCacheCompat to pi-ai's OpenAICompletionsCompat so catalog entries can carry the full compat surface, and made withClinePromptCacheCompat merge into existing entry compat instead of replacing it (no behavioral change today since glm-5.2 isn't cache-flagged, but the next entry that needs both would have silently lost one).

Verified fetchClinePassModels() returns glm-5.2 with compat.supportsDeveloperRole: false on both the static fallback and the live fetch path, and a real glm-5.2 request through pi succeeds with the flag set. npm test passes.

Other ClinePass models may need the same flag if their upstreams reject developer, but I only had a failing report for glm-5.2, so I kept this scoped.

The GLM upstream behind ClinePass rejects the `developer` role with
400 "developer is not one of ['system', 'assistant', 'user', 'tool',
'function']", so every glm-5.2 request failed before generation.

- Set compat.supportsDeveloperRole: false on the glm-5.2 catalog entry
  (carries through the live recommended-models merge via the static
  entry spread)
- Type PiModel.compat as pi-ai's OpenAICompletionsCompat so model
  entries can carry the full compat surface
- Merge prompt-cache compat into any existing entry compat instead of
  replacing it
@estridell
estridell marked this pull request as ready for review July 22, 2026 10:46
maybeenang added a commit to maybeenang/pi-cline that referenced this pull request Jul 27, 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.

1 participant