← Back to PRs

#19281: fix: set supportsDeveloperRole false as default for moonshot provider

by MisterGuy420 open 2026-02-17 16:28 View on GitHub →
agents size: XS
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