feat(ai-providers): GLM + Kimi presets, region-aware endpoints, quieter auth errors#131
Merged
luokerenx4 merged 4 commits intomasterfrom Apr 19, 2026
Merged
feat(ai-providers): GLM + Kimi presets, region-aware endpoints, quieter auth errors#131luokerenx4 merged 4 commits intomasterfrom
luokerenx4 merged 4 commits intomasterfrom
Conversation
…ndpoint Mirrors the MiniMax preset — backend=agent-sdk + loginMethod=api-key, hardcoded baseUrl to https://open.bigmodel.cn/api/anthropic. Ships with glm-5.1 (default), glm-4.7, glm-4.6 (200K), and glm-4.5-air as model options. Zhipu officially supports the Anthropic-compatible route for Claude-Code-style tooling, so agent-sdk is the right backend here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nfig API key / baseUrl mistakes used to dump a full stack trace via console.error, indistinguishable from a real SDK crash. Added a small classifyError() helper that regex-matches auth signals (401, invalid_api_key, unauthorized, etc.) across message/stderr/stdout; hits become a one-line console.warn, everything else keeps the loud path. Pino log gains a classification field for future filtering. Signal preserved, noise cut — real bugs are no longer buried in config mistakes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GLM, Kimi, and MiniMax all run two hard-split platforms (China vs International) with independent accounts, keys, billing, and sometimes model catalogs. Baking in a single baseUrl per preset made half the users of each brand reach a non-existent endpoint. Changes: - PresetDef gains optional endpoints: EndpointOption[]; presets.ts generalizes the model-field label rewrite to cover baseUrl too, so a preset declaring endpoints renders a labeled dropdown with the same UX as the model picker. - MiniMax and GLM switch baseUrl from z.literal to z.string() with two endpoint options each. GLM default drops from glm-5.1 to glm-4.7 (the only flagship available on both regions); 5.1 and 4.6 stay selectable with "(China only)" label hints. - New KIMI preset, kimi-k2.5 flagship, China default. - Error classifier picks up a 'model' class alongside 'auth'; wrong region/model combos get a one-line console.warn instead of the loud console.error + stack. Existing user profiles are unaffected — schema relaxed from literal to string, so stored values still validate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…hing OpenAI-compat Moonshot's quickstart leads with OpenAI Chat Completions, but our codex backend talks the Responses API, which Moonshot doesn't implement. Anthropic-compat at api.moonshot.*/anthropic is Moonshot's officially supported secondary path, so we route Kimi through agent-sdk there. Comment exists to spare the next reader from re-deriving why an OpenAI- compat vendor sits under agent-sdk in this catalog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
baseUrlis now a labeled dropdown — parallel to howmodelalready works. MiniMax and GLM gain region pickers; Kimi ships with both regions from day one.console.warnline instead of a full stack trace masquerading as a system crash. Pino still captures full detail for debugging.Test plan
npx tsc --noEmitcleanpnpm test— 1069 tests passz.literaltoz.string, so stored values continue to validate)🤖 Generated with Claude Code