Skip to content

feat(subagents): 为每个备用模型单独设置思考强度 - #1013

Open
inorilzy wants to merge 9 commits into
vastsa:mainfrom
inorilzy:feat/subagent-fallback-thinking-inherit-pr
Open

inorilzy wants to merge 9 commits into
vastsa:mainfrom
inorilzy:feat/subagent-fallback-thinking-inherit-pr

Conversation

@inorilzy

@inorilzy inorilzy commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

背景

子智能体可以配置多个备用模型,但目前只能为子智能体整体设置思考强度。

改动

  • 为每个备用模型独立选择 inherit 或标准思考强度档位;默认显示 inherit。
  • 备用模型菜单不再提供「不传递」。
  • 切换到备用模型时,运行时按该模型支持的档位调整请求强度,不修改已选择的档位。

验证

  • Task candidate: ee31195f0;Base main: 21dcd3ddb。
  • E2E suites: test:e2e:subagent-models 和完整 test:e2e 通过(23/23;无密钥的实时模型用例跳过);test:e2e:subagents 因 Windows 隔离限制未运行。
  • Result: 共享、运行时、桌面与 Rust 针对性测试、构建和类型检查通过;上游基线的 lint / docs / architecture 检查仍有既存失败。
  • Environment: Windows,完整 E2E 使用隔离的本地临时目录,不调用真实模型。

Subagents can list multiple fallback models, but one thinking setting
cannot express the right request for each alternative. Keep the
existing flat pin format and clamp each request to the target model.
@inorilzy

Copy link
Copy Markdown
Contributor Author

补充 CI 排查:#1013 的两项失败均可在当前上游 main(21dcd3ddb)复现,PR 未修改对应文件。

  • Docs checks:docs/zh-CN/spec/04-ux/07-ui-design-system.md 与英文规格的表格结构不一致;上游 Docs check 同样失败。
  • JS checks:apps/desktop/src/styles/ui-kit.css:349 使用了未经令牌化的 border-radius: 4px;上游 CI 同样失败。

这两处均不属于本 PR 的备用模型功能,故未混入无关修改。Rust 检查和最新基线检查已经通过。

Reuse the upstream token-only fix in ui-kit.css; preserve the existing
4px checkbox radius while satisfying the style-token check.
inorilzy and others added 4 commits September 24, 2026 14:32
Integrate upstream main at 35d6903 into the existing subagent fallback thinking feature branch. Preserve PR history and incorporate upstream style-token, documentation-locale, and architecture fixes.
Use the existing unit line-height token and move the light model menu's
three shadow layers into the shared theme tokens. Add regressions for
the unchanged line height and shadow values.
Keep the upstream model-menu shadow token when merging the per-fallback thinking feature. Limit the import-page contract test to its module so unrelated settings cards cannot make the JS gate fail.
GitHub's pull-request webhook base SHA can lag behind the synthetic merge checkout when main advances. Compare newly added source files with the merge candidate's first parent instead, so upstream files cannot block an unrelated PR.

@muzimu217 muzimu217 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

核心功能(每个备用模型独立思考强度档位、默认 inherit、切换时按目标模型能力调整)本身清晰有用,验证段也扎实(e2e 23/23、针对性测试+构建+typecheck、Windows 隔离说明如实)。一个主要意见:

PR 范围与正文严重不符,疑似分支叠加。 正文只描述"备用模型思考强度"一件事,但文件清单里有大量与本功能无关的内容:mid-autumn-egg 整个特性(assets 资源、scene/timeline/sampling、preferences、overlay、store)、taskbar-unread-badge/overlay、generated-images 一族、notification-inbox、ci.yml 改动,以及多份无关 spec(21-image-generation、NAV、ui-design-system 等),合计 +5561/−310。如果这些是其它在飞工作叠进来的:按本仓库"一个 PR 只交一件事"的强惯例(维护者此前对多个关注点的 PR 一律要求拆分),建议把本特性 rebase 到干净 main 上单独出——功能本身不大(SubagentFallbackModels/SubagentEditorSheet + model_fallbacks.rs + ADR 0307 + 23 号 spec),拆出来过审会快很多,叠加的部分各自走各自的 PR。

拆分时记得 spec 只保留真正属于本特性的部分(03-runtime/23 与相关 en/zh 成对项),e2e-plan 条目同步核对。

@inorilzy
inorilzy marked this pull request as draft September 25, 2026 13:09
# Conflicts:
#	apps/desktop/src/components/settings/SubagentFallbackModels.tsx
#	apps/desktop/test/settings-import-page.test.mjs
#	docs/adr/README.md
@inorilzy
inorilzy marked this pull request as ready for review October 10, 2026 03:46
Restore the CI architecture-base change, its doc note and test, and the composer model-menu token test to upstream main; they belong to separate fixes, not per-fallback thinking.
@inorilzy

Copy link
Copy Markdown
Contributor Author

感谢 review @muzimu217,之前的 diff 确实混进了无关的改动。我已经合并了最新的 main,并移除了所有不属于本功能的内容(CI architecture-base 的改动及其测试和文档说明,以及 composer 模型菜单 token 的测试)。现在 PR 是 26 个文件、+262/−29,只包含「每个备用模型单独设置思考强度」:shared 和 host-core 中 |level 后缀的解析、备用模型编辑菜单(默认 inherit,去掉「不传递」选项)、运行时按目标模型能力调整各备用模型的档位,以及对应的测试、ADR 0326 和 spec / i18n 条目。本地的构建、typecheck、lint、shared / agent-runtime / desktop 的针对性测试和 cargo test -p host-core 均已通过。还有其他需要调整的地方欢迎指出。

Bring the per-fallback thinking branch up to date with upstream main so
PR vastsa#1013 no longer conflicts. The only conflict was in
SubagentFallbackModels.tsx, where main now resolves fallback row labels
through subagentModelDisplay() to keep provider names and disabled /
unavailable status. Rows still parse the `pin|level` entry first, then
use main's display resolution for the pin.

The fallback user-path test from main assumed the move-up button was
the first button in each row and that the add-fallback trigger was
already in view. Per-fallback thinking menus add a button and make rows
taller, so the test now finds move-up by its accessible name and scrolls
the add trigger into view before clicking, as a person would.

This branch has not been deployed

No deployments
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.

2 participants