Conversation
added 2 commits
September 13, 2026 00:15
国际版网关下 GET /console/enterprises/personal/models 返回 500, 正确路径为 /v2/enterprises/personal/models(实测 200,含 credits 定价)。 新增按账号 region 选择路径的 modelsPath(),CN 保持原路径不变; 影响 FetchModels(动态模型列表)与 FetchModelPricing(费率)。
登录流程原本写死 CN 端点(copilot.tencent.com / codebuddy.cn), region=global 的实例点「+ WorkBuddy」仍打开国内登录页,且保存的 账号 domain 为 CN,不会被国际版实例加载。 新增 Endpoints / EndpointsForRegion,按 region 选择 API 基址与 Origin/Referer,并透传到 Start / Poll / ResolveAuthURL; 国际版 token 响应若缺 domain 则按区域兜底,避免账号被判为 CN。
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.
背景
按 README 以
region: "global"(国际版 WorkBuddy)部署后,发现两处 CN 硬编码导致国际版功能不完整:改动
1. 模型 / 费率接口路径(
internal/upstream/client.go)国际版网关下
GET https://www.workbuddy.ai/console/enterprises/personal/models返回 HTTP 500,正确路径为/v2/enterprises/personal/models(实测 200,返回含credits定价的完整模型表)。modelsPath(a):按账号 region 选择路径,CN 保持/console/...不变FetchModels(动态模型列表)与FetchModelPricing(费率)2. 面板登录流程(
internal/login/login.go、internal/app/app.go)登录端点原本写死 CN(
UpstreamBaseCN,注释标注 "CN only"),region: "global"实例点「+ WorkBuddy」仍打开www.codebuddy.cn/login/...;即便完成登录,保存的账号domain为 CN,也不会被国际版实例加载。Endpoints/EndpointsForRegion(region):按 region 选择 API 基址与 Origin/RefererStart/Poll/ResolveAuthURL增加Endpoints参数,由app.StartLoginFor传入cfg.Regiondomain时按区域兜底为www.workbuddy.ai,避免账号被判为 CN验证(region: global 实例实测)
www.codebuddy.cn/login/...www.workbuddy.ai/login/...www.workbuddy.ai,被正确识别为 globalCN 实例回归:模型 42 个、登录链接仍为
www.codebuddy.cn,行为不变。说明