feat(providers): add Moonshot API compatibility + fix Z.AI baseURL - #1
Closed
gHashTag wants to merge 1 commit into
Closed
feat(providers): add Moonshot API compatibility + fix Z.AI baseURL#1gHashTag wants to merge 1 commit into
gHashTag wants to merge 1 commit into
Conversation
Add support for Moonshot AI models (kimi-k2.5, kimi-k2.6) via NVIDIA NIM and direct Moonshot API. The Vercel AI SDK sends fields that Moonshot does not support (parallel_tool_calls, strict response_format, frequency/presence penalties, unlimited max_tokens), causing 400 errors. Changes: - moonshot-fetch.ts: intercept and filter unsupported request fields * Remove parallel_tool_calls * Remove json_schema response_format without name * Remove strict flag from response_format * Clamp max_tokens > 98304 to 32768, remove if 0 * Force frequency_penalty and presence_penalty to 0 - provider-factory.ts: wire createMoonshotFetch() into Moonshot factory - provider.ts (llm): wire createMoonshotFetch() into Moonshot model - provider-factory.ts + provider.ts: pass baseURL for Anthropic provider to support Z.AI custom endpoints (https://z.ai/api/anthropic/v1) - urls.ts: fix ZAI_API from broken https://api.z.ai to https://z.ai - moonshot-fetch.test.ts: unit tests for all filtering logic Tested with: - NVIDIA NIM: moonshotai/kimi-k2.6 via integrate.api.nvidia.com - Z.AI: glm-5.1 via z.ai/api/anthropic/v1
gHashTag
commented
May 20, 2026
OwnerAuthor
Closing to split into focused PRs |
gHashTag added a commit
that referenced
this pull request
May 24, 2026
#1) - queen-browseros.md: BrowserOS Agent for Trinity A2A - skills: tri, doctor, god-mode, bridge - cron-queen.sh: 15-min autonomous lifecycle - launchd: com.trinity.queen-cron running - .trinity/experience.md: knowledge base - Full MCP access: fs_read, fs_write, shell_execute
gHashTag added a commit
that referenced
this pull request
Aug 1, 2026
The supervisor surface was opened and looked at for the first time tonight, and it works. In the narrow panel: an OPEN DASHBOARD control at the top, a compact line reading "1 needs you - 0/4 working", and the bee board below it with a WAITING ON YOU section and a card carrying the state, the worker, the branch and an Accept button. Widened, the same plus the full swarm strip with the issue, the branch, awaitingReview and Review. gHashTag/trios#1118 closed on its last criterion, which was readability and could only ever be answered this way. Looking found a defect no test had: the issue number printed as `#1,124`. A SwiftUI `Text` interpolating an Int formats it as a quantity, and an issue number is an identifier - you cannot search for `#1,124` or paste it anywhere. Fixed on both screens that print one. The bee's own assertion for it could not pass: it compared lengths and claimed the identifier was shorter, while `browseros-ai#1129` and `1,129` are both five characters. A test that is false by construction fails the same way a real defect does, and it was caught only because the gate went red. It asserts the shape now - the rendered identifier carries no group separator. Also this cycle: an empty diff no longer sends the reviewer the first 500 lines of a file, and a verdict is bound to the tree state it was judged against. Ratchet 552 -> 559. ClosesgHashTag/trios#1129 Refs gHashTag/trios#1118, gHashTag/trios#1124
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 freeto 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
Adds support for Moonshot AI models (kimi-k2.5, kimi-k2.6) and fixes Z.AI connectivity via Anthropic-compatible API.
Moonshot API Compatibility
The Vercel AI SDK sends fields that Moonshot does not support, causing 400 errors:
parallel_tool_callsresponse_format.json_schemawithout nameresponse_format.strictmax_tokens > 98304ormax_tokens = 0frequency_penalty/presence_penalty(Moonshot only supports 0)Changes:
moonshot-fetch.ts: new fetch wrapper that intercepts and sanitizes request bodiesprovider-factory.ts: wirescreateMoonshotFetch()into the Moonshot factoryprovider.ts(llm): wirescreateMoonshotFetch()into the Moonshot modelmoonshot-fetch.test.ts: unit tests for all filtering logicZ.AI BaseURL Fix
Z.AI uses an Anthropic-compatible API at
https://z.ai/api/anthropic/v1, but the built-in Anthropic factories were ignoring custombaseUrl, sending requests toapi.anthropic.com. This caused "invalid x-api-key" errors.Changes:
provider-factory.ts: passbaseURLtocreateAnthropic()when setprovider.ts(llm): passbaseURLtocreateAnthropic()when seturls.ts: fixZAI_APIfrom brokenhttps://api.z.aitohttps://z.aiTested With
moonshotai/kimi-k2.6https://integrate.api.nvidia.com/v1glm-5.1https://z.ai/api/anthropic/v1Closesbrowseros-ai#657