Skip to content

fix(upstream): filter unavailable agent models - #37

Closed
coolxll wants to merge 5 commits into
Sliverkiss:masterfrom
coolxll:codex/-coolxll/workbuddy2api
Closed

coolxll wants to merge 5 commits into
Sliverkiss:masterfrom
coolxll:codex/-coolxll/workbuddy2api

Conversation

@coolxll

@coolxll coolxll commented Sep 11, 2026

Copy link
Copy Markdown

修正模型发现逻辑:

  • 过滤仅出现在 agents 中但实际不可用的模型(如 lite)
  • 仅在 agents 为空时回退模型目录
  • 增加模型过滤与兜底行为的回归测试
  • 同时包含 Codex 身份信息净化

已通过 go test ./...

FetchModels 的发现范围改为所有 agents 引用模型的并集:比只读 cli 预设更全(覆盖其他 agent 引用的新模型,上游改 agent 名称不会整体失败),又比整份 models 目录更准(目录混有上代退役模型和图像等非聊天模型,不应暴露给聊天客户端)。models 目录仅作元数据来源;agents 引用但目录暂无元数据的模型(如 lite)保留 ID 返回;agents 整体为空时兜底退回目录启用模型。
@coolxll
coolxll force-pushed the codex/-coolxll/workbuddy2api branch from 88d791c to cace384 Compare September 11, 2026 08:56
@coolxll coolxll closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant