Skip to content

fix(remote-connect): name the real models behind bot model aliases - #3814

Merged
bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:fix/bot-model-menu-real-names
Nov 8, 2026
Merged

bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:fix/bot-model-menu-real-names

Conversation

@bobleer

@bobleer bobleer commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

IM bot 的 /model 菜单里,第 1 项只显示「主力模型」,看不出它实际指向哪个模型;快速模型别名则完全没有入口。这个 PR 让两个别名都带上实际解析到的模型名:

  • 主力模型(gpt-6.1-sol · OpenAI) / Primary model (alpha · Provider A);没配置主力模型时显示 主力模型(未配置)
  • 配置了快速模型时新增 快速模型(xxx · 供应商) 一项(与桌面端模型选择器的 primary / fast 快捷项对齐)
  • 切换成功的提示同样带上真实模型名,例如「已切换模型:主力模型(gpt-6.1-sol · OpenAI)」

Type and Areas

Type: bug fix (UX)

Areas: Rust core — Remote Connect IM bot (command_router.rs, bot locale.rs / state.rs)

Motivation / Impact

  • 菜单原来用硬编码的 switch_model_primary 字符串作为第 1 项,没有读取目录里的 default_models.primary。现在从同一份 model catalog 解析 default_models.primary / default_models.fast。
  • 会话在桌面端选了 fast 时,bot 菜单原来没有任何一项带「当前」标记;现在会标在快速模型那一项上。
  • PendingAction::SelectModel 现在会带上打开菜单时的会话选择,所以输入无效编号后重新渲染的菜单会标出正确的当前项,不会再固定标在主力模型上。
  • 菜单项改成统一的 (selection, label) 列表(第 1 项是 primary,配置了快速模型时接着是 fast,然后是各个已启用模型),编号到选择的映射只存一份。PendingAction 不做持久化,没有兼容性问题。

Verification

  • cargo test -p openbitfun-core --features product-full --lib -- remote_connect::bot — 79 passed(包含新增的 model_menu_names_the_models_behind_primary_and_fast、model_menu_flags_an_unconfigured_primary_model,以及扩展了断言的 remote_model_switch_reads_and_updates_the_device_session)
  • cargo test -p openbitfun-services-integrations --features remote-connect --lib -- bot — 74 passed
  • cargo clippy -p openbitfun-core --features product-full --lib — 改动部分没有新增告警
  • cargo fmt -p openbitfun-core

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.(zh-CN / zh-TW / en-US)

Generated with OpenBitFun

The IM bot /model menu listed the primary alias as a bare "主力模型"
with no hint of which configured model it runs, and offered no entry
for the fast alias at all, so a session switched to fast on desktop
showed no current marker.

Label both aliases with the model they resolve to, e.g.
"主力模型(gpt-6.1-sol · OpenAI)", show "未配置" when the primary
default is missing, list the fast alias when it is configured, and keep
the session's selection on the pending menu so a re-rendered menu marks
the right entry instead of always marking the primary one.

Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
@bobleer
bobleer marked this pull request as ready for review November 8, 2026 01:45
@bobleer
bobleer merged commit 68da513 into openBitFun:main Nov 8, 2026
12 checks passed
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