fix(VCPBridgeServer): 补充 GET /v1/models 与 /v1/:profile/models 探活路由,兼容第三方客户端连通性检查 - #465
Merged
lioensky merged 1 commit intoSep 9, 2026
Conversation
…es for client health probe
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.
改动内容 (What)
Plugin/VCPBridgeServer/bridgeserver.js中新增GET /v1/models与GET /v1/:profile/models路由,动态提取当前已配置的模型(defaultModel及modelMap),返回符合 OpenAI REST 规范的标准模型列表。chat、responses、messages等非 profile 路径自动调用next()交由下游处理)。runtimeConfig.debugMode门控下,默认运行不污染控制台输出。改动原因 (Why)
许多第三方客户端及 API 管理工具(如 OpenAI Codex 桌面端、CC Switch、ChatBox、NextChat 等)在添加新接口或初次握手时,会默认向
{base_url}/models发起GET请求进行服务存活性探测(Health Check)与模型列表发现。在此之前,
VCPBridgeServer仅注册了面向补全推理的 POST 路由与独立的/health端点,导致针对/v1/models或带有 Profile 路径前缀(如/v1/:profile/models)的探活请求全部返回 404 Not Found,进而被客户端误判为服务离线并拒绝建立连接。补充该标准端点能够显著改善对通用生态客户端的兼容性。测试验证 (How)
http://127.0.0.1:6003/v1/models及http://127.0.0.1:6003/v1/{profile}/models分别发起 GET 请求,均稳定返回 HTTP 200 及结构严整的标准 Model List JSON。