#23256: fix(providers): disable developer role for zhipu provider and bigmodel.cn
agents
size: XS
Cluster:
DashScope/Qwen Role Management
## Summary
- **Problem:** Zhipu (智谱) provider and GLM models return HTTP 400 \"角色信息不正确\" (incorrect role info) when the \`developer\` role is used in chat completions. The \`normalizeModelCompat\` function only disabled this role for Z.AI, not for Zhipu's own API.
- **Why it matters:** Users cannot use Zhipu/GLM-5 models at all — every request with developer role fails.
- **What changed:** Expanded the compatibility condition in \`src/agents/model-compat.ts\` to include \`model.provider === \"zhipu\"\` and \`baseUrl.includes(\"bigmodel.cn\")\`, setting \`supportsDeveloperRole: false\` for these providers.
- **What did NOT change:** Z.AI behavior is unchanged. Other providers are unaffected.
## Change Type (select all)
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [ ] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [x] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
## Linked Issue/PR
- Closes #23130
- Closes #23150
## User-visible / Behavior Changes
- Zhipu/GLM models no longer fail with 400 errors
- The \`developer\` role is automatically converted to a compatible role for Zhipu API calls
## Security Impact (required)
- New permissions/capabilities? \`No\`
- Secrets/tokens handling changed? \`No\`
- New/changed network calls? \`No\`
- Command/tool execution surface changed? \`No\`
- Data access scope changed? \`No\`
## Repro + Verification
### Environment
- OS: macOS 15.3 (arm64)
- Runtime: Node v22+
- Model/provider: Zhipu (bigmodel.cn) / GLM-5
### Steps
1. Configure Zhipu as a provider with a GLM model
2. Send a message
3. Verify no 400 error about role
### Expected
- Request succeeds without role-related errors
### Actual
- Before fix: 400 \"角色信息不正确\"
- After fix: Developer role is suppressed for Zhipu, request succeeds
## Evidence
- The fix extends the existing Z.AI compatibility pattern (same code path, same \`supportsDeveloperRole: false\` flag)
- Both issue reporters (#23130, #23150) describe the identical error with Zhipu/GLM models
## Human Verification (required)
- Verified scenarios: Reviewed \`normalizeModelCompat\` logic; confirmed the condition correctly matches both \`provider === \"zhipu\"\` and \`baseUrl.includes(\"bigmodel.cn\")\`
- Edge cases checked: Z.AI still matches via existing conditions; providers not matching Zhipu patterns are unaffected
- What I did **not** verify: Live Zhipu API call (no Zhipu API key)
## Compatibility / Migration
- Backward compatible? \`Yes\`
- Config/env changes? \`No\`
- Migration needed? \`No\`
## Failure Recovery (if this breaks)
- How to disable/revert this change quickly: Revert the condition expansion in \`model-compat.ts\`
- Files/config to restore: \`src/agents/model-compat.ts\`
- Known bad symptoms: If a future Zhipu model supports developer role, it would be unnecessarily suppressed
## Risks and Mitigations
- Risk: Future Zhipu models may support developer role
- Mitigation: The compatibility flag can be refined per-model if needed; current blanket disable matches Z.AI precedent
Most Similar PRs
#22741: fix(models): add DashScope/Qwen to normalizeModelCompat developer r...
by lailoo · 2026-02-21
76.5%
#22194: fix(agent) Moonshot/Kimi kimi-k2.5 returns ROLE_UNSPECIFIED
by ShengFuC · 2026-02-20
74.7%
#23655: fix(model): map developer role to system for Aliyun/Dashscope/Qianf...
by SleuthCo · 2026-02-22
73.8%
#23711: fix: disable developer role for DashScope/Qwen models (#23575)
by echoVic · 2026-02-22
73.3%
#14187: fix: add Moonshot AI to non-standard provider detection
by shad0wca7 · 2026-02-11
73.2%
#19326: Agents: improve z.ai GLM-5 integration and failover
by gabrielespinheira · 2026-02-17
72.0%
#19281: fix: set supportsDeveloperRole false as default for moonshot provider
by MisterGuy420 · 2026-02-17
71.9%
#21911: Enable `reasoning: true` for Kimi models
by ighostych · 2026-02-20
71.4%
#5920: fix: DeepSeek API compatibility - convert developer role to system ...
by coupclawbot · 2026-02-01
71.0%
#22941: feat: add ZHIPU provider + doctor chat check (Phase 1A)
by feelega · 2026-02-21
68.7%