Conversation
新增 services/model_pool.py,集中私聊 pool 交互逻辑: - /compare、/pk 命令处理 - 「选X」偏好切换 - select_chat_config 封装 handlers.py 私聊 pool 块从 ~20 行降至 4 行,零感知 model_selector。 runner.py 移除 hasattr 检查,直接调用 model_selector。 agent 默认 global_enabled 改为 False,与全局开关语义一致。 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- routes.py (904行) → routes/ 包(_shared/_index/_auth/_bot/_config/_logs/_system) - utils.py (402行) → utils/ 包(config_io/comment/toml_render) - main.js (2163行) → 9个模块(i18n/state/ui/api/auth/bot/config-form/log-view/main) - style.css (1128行) → 6个文件(variables/base/landing/app/components/responsive) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- biome.json: 配置 Biome 检查 webui JS(禁用全局作用域误报规则) - .stylelintrc.json: 配置 Stylelint 检查 webui CSS - api.js: Math.pow(2, n) → 2 ** n - state.js: 字符串拼接 → 模板字面量 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
- 修复私聊模型双重选择导致 round-robin 计数器错误递增 - 修复群聊错误参与模型池选择,现在群聊始终使用主模型 - 为 round-robin 计数器添加线程安全保护 - 自动清除无效的用户模型偏好(当模型从池中移除时) - 修复 get_all_chat_models 可能返回重复主模型的问题 - 修复 thinking_enabled 检查使用错误的配置对象 - 修复 pool.enabled 默认值从 True 改为 False - 添加 3 个新测试覆盖上述修复 Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
当通过热重载添加/移除/修改池模型时,队列间隔不会更新, 导致新添加的池模型使用默认间隔而不是配置的间隔。 修复方法:在 _QUEUE_INTERVAL_KEYS 中添加 chat_model.pool 和 agent_model.pool,使池配置变化时触发队列间隔更新。 Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
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.
功能概述
为 Undefined 添加多模型池功能,允许用户在私聊场景下使用多个 AI 模型,并通过对比选择最佳回复。
主要特性
核心功能
/compare命令触发多模型并行响应,用户可选择最佳回复models.chat.pool.enabled = true,单模型用户零影响架构设计
ModelPoolService,职责清晰ai/model_selector.py:纯选择逻辑(策略/偏好/compare状态)services/model_pool.py:私聊交互服务services/ai_coordinator.py:持有 ModelPoolService,队列投递时选模型WebUI 增强
代码质量
配置示例
未指定的字段会继承主模型配置(
models.chat.*)。使用流程
/compare 你好→ 所有模型并行响应[1] Claude: .../[2] GPT: ...1或选1→ 记录偏好,后续优先使用 Claude测试
相关文件
src/Undefined/ai/model_selector.pysrc/Undefined/services/model_pool.pysrc/Undefined/services/ai_coordinator.pytests/test_model_pool.pywebui/src/components/ModelPoolConfig.tsxBreaking Changes
无。默认关闭,现有用户行为不受影响。