feat(provider): add CodeBuddy international provider (www.codebuddy.ai)#1845
Open
Yanu403 wants to merge 1 commit into
Open
feat(provider): add CodeBuddy international provider (www.codebuddy.ai)#1845Yanu403 wants to merge 1 commit into
Yanu403 wants to merge 1 commit into
Conversation
- Update registry/codebuddy.js: switch baseUrl from copilot.tencent.com to www.codebuddy.ai/v2/chat/completions, add forceStream:true, add 4 confirmed models (gpt-5.5, gpt-5.4, claude-sonnet-4.6, gemini-3.1-pro), set category to apikey, expose to UI. - Add executors/codebuddy.js: thin shim over DefaultExecutor that injects an empty system message when absent (server returns 11101 without one) and adds X-API-Key header matching CLI fingerprint. - Register executor in executors/index.js. Wire-tested via mitmproxy capture + direct curl replay against live ck_* API keys. SSE streaming confirmed with OpenAI-compatible [data: {...}] + data: [DONE] envelope.
bloodf
pushed a commit
to bloodf/9router
that referenced
this pull request
Jun 19, 2026
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
Adds CodeBuddy (www.codebuddy.ai) as a fully functional provider with API key authentication, enabling users to access GPT-5.5, GPT-5.4, Claude Sonnet 4.6, and Gemini 3.1 Pro through their CodeBuddy subscriptions.
The existing
codebuddy.jsregistry entry washidden: trueand pointed tocopilot.tencent.com(China-only). This PR switches it to the international domain, adds models, and exposes it to users.Changes
1. Registry (
providers/registry/codebuddy.js)copilot.tencent.comtowww.codebuddy.ai/v2/chat/completionsoauthtoapikey(API key is the primary auth method)forceStream: true(server requires streaming — rejects non-stream with error 11101)gpt-5.5,gpt-5.4,claude-sonnet-4.6,gemini-3.1-prohidden: falseto expose to users2. Executor (
executors/codebuddy.js)Lightweight shim over
DefaultExecutor(~53 LOC). Two responsibilities:systemmessage in the messages array (returns11101:invalid requestwithout one). InjectsYou are a helpful assistant.when absent.Authorization: BearerandX-API-Keywith the same token, matching the CLI's fingerprint.3. Executor registration (
executors/index.js)Import and register
CodeBuddyExecutorin the executor map.API Wire Format
Captured via mitmproxy interception of
codebuddy -pCLI v2.106.3:Request:
Response (SSE):
Testing
ck_*API key from active CodeBuddy accountAPI Key Setup
Users obtain API keys from: https://www.codebuddy.ai/console/api-keys
Key format:
ck_<id>.<secret>Add as API key connection in 9router dashboard → Providers → CodeBuddy.
Constraints (documented in executor JSDoc)
{"code":11101,"msg":"Parse message failed: 11101:invalid request"}without it. Handled byensureSystemMessage()in the executor.stream: falsereturns{"code":11101,"msg":"Non-stream chat request is currently not supported"}. Handled byforceStream: truein registry.Not in scope (future PRs)
/v2/plugin/auth/state+/v2/plugin/auth/token)Closes #