#19281: fix: set supportsDeveloperRole false as default for moonshot provider
agents
size: XS
Cluster:
Moonshot Provider Enhancements
Fixes #19260
## What changed
- Set supportsDeveloperRole: false as default for moonshot provider when using openai-completions API to prevent 400 errors
## AI-assisted contribution
- This fix was generated by an AI agent (OpenClaw cron: gh-issues-fix)
- Testing depth: validated with pnpm build
- The fix addresses the root cause by setting the correct default to avoid developer role issues with Moonshot/Kimi models
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Extended `normalizeModelCompat` to support Moonshot provider alongside Zai, setting `supportsDeveloperRole: false` by default to prevent 400 errors with openai-completions API
- Refactored provider detection into separate helper functions (`isMoonshotProvider`, `isZaiProvider`)
- Changed early return logic from OR to AND condition to handle both providers
One issue found: the `isMoonshotProvider` baseUrl check only covers `api.moonshot.ai` but not `api.moonshot.cn` (China endpoint documented in the codebase).
<h3>Confidence Score: 3/5</h3>
- This PR is safe to merge with one logical issue that should be addressed
- The refactoring is clean and the logic is correct for the `.ai` endpoint, but the code doesn't handle the documented China endpoint (`api.moonshot.cn`), which could leave users on that endpoint still experiencing 400 errors. The test coverage also doesn't validate the new Moonshot functionality.
- Pay attention to `src/agents/model-compat.ts` for the missing `.cn` endpoint check
<sub>Last reviewed commit: 03c1a84</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#14187: fix: add Moonshot AI to non-standard provider detection
by shad0wca7 · 2026-02-11
91.5%
#22194: fix(agent) Moonshot/Kimi kimi-k2.5 returns ROLE_UNSPECIFIED
by ShengFuC · 2026-02-20
87.9%
#21911: Enable `reasoning: true` for Kimi models
by ighostych · 2026-02-20
82.0%
#9024: Fix/Moonshot Provider Issue with kimi-k2-thinking Model Role Mappin...
by fotorpics · 2026-02-04
78.9%
#23655: fix(model): map developer role to system for Aliyun/Dashscope/Qianf...
by SleuthCo · 2026-02-22
77.3%
#6454: fix: enable reasoning flag for Kimi K2.5 in Moonshot provider (#6451)
by coupclawbot · 2026-02-01
76.4%
#6960: feat: Add kimi-coding provider support
by YYW0228 · 2026-02-02
75.1%
#5947: Feature/kimi reasoning support
by zzjj7000 · 2026-02-01
75.0%
#15197: fix: allow OpenAI auth profiles for OpenAI-compatible providers
by bufordtjustice2918 · 2026-02-13
74.3%
#4459: fix: enable image input for Kimi K2.5 and refresh stale config mode...
by manikv12 · 2026-01-30
74.3%