You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
关联 Issue
Closes #649
变更摘要
QueueMode 扩展(
api/spi/.../QueueMode.java):将PULL(1)重命名为SINGLE(1),新增BATCH(4)、SINGLE_ROUTE(3)、BATCH_ROUTE(6),改用位掩码(SINGLE_BIT=1, ROUTE_BIT=2, BATCH_BIT=4)实现模式组合,增加supportsBatch()、toWorkerMode()、toWorkerModeOrThrow()方法,并校验 SINGLE 与 BATCH 不可共存。ChannelRouter 重构(
api/server/.../ChannelRouter.java):从route()抽取listAvailableChannels(),返回按优先级/可见性排序的完整通道列表;route()取首个结果,行为与原逻辑等价。新增路由查询接口(
api/server/.../RouteController.java):POST /v1/route/list接受 apikey/endpoint/model/queueMode,验证 apikey 后返回List<RouteResult>,供外部调度系统感知可用通道。SDK 同步(
api/sdk/.../OpenapiClient.java):新增listAvailableChannels()封装对新接口的调用。ChannelService / ModelService:
listAllWorkerChannels()查询条件更新为新 QueueMode 枚举值;listActives()与fetchTerminalModelName()缓存注解暂时注释,待验证后恢复。版本号:1.2.74 → 1.2.75。
验证证据
route()重构前后行为等价:原pickMaxPriority(filteredChannels).get(0)与新listAvailableChannels().get(0)排序逻辑一致SINGLE=001、ROUTE=010、BATCH=100,互斥校验防止非法组合listActives()与fetchTerminalModelName()禁用缓存后的生产性能影响上线说明
QueueMode.PULL重命名为SINGLE,外部若有直接引用枚举名需同步更新POST /v1/route/list接口,无数据库变更回退说明
回退至版本 1.2.74 可恢复原行为;使用新 QueueMode 枚举值的通道配置需同步回滚。