Repository navigation
Conversation
Assisted-by: Cindy (https://cindy.app) Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
zqchris
left a comment
There was a problem hiding this comment.
Auto-approved by Chris’s trusted-author rule for makecindy/cindy. This is an automated approval.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a17143a5c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const applied = await pluginEngineOptions.onSelect({ | ||
| providerId: routedProviderId, | ||
| modelId: wireModelId, | ||
| }); |
There was a problem hiding this comment.
Preserve host-routed identities through new-session creation
When a user selects a host-routed harness from the new-task picker, this passes an acp-plugin:…@provider identity and a concrete model into a consumer that cannot preserve them. In app/sessions/new.tsx, activePluginEngineRaw resolves the base engine and replaces models absent from its standalone catalog with default; pluginEnginePick then uses engine.providerId, dropping the @provider suffix. For a pure host-routed harness (models: []), selecting an xAI model therefore creates a standalone/default selection instead, losing the required proxy provider and concrete model. Update the new-session normalization and creation path to retain both before exposing this option.
Useful? React with 👍 / 👎.
| providerId: value.providerId, | ||
| effort: value.effort || '', | ||
| fastMode: value.fast, | ||
| modelGroup: null, |
There was a problem hiding this comment.
Serialize route changes for bound automations
For an automation with targetSessionId, choosing a concrete model sets modelGroup: null here, but buildMobileScheduleInput returns from its bound-session branch before copying draft.modelGroup into the payload. The host's update path preserves an omitted route, so an existing smart route remains saved despite the picker showing the newly selected concrete model; the scheduler can consequently ignore that explicit model while the saved route exists. Selecting another smart route has the same serialization problem. Ensure the bound-session payload includes explicit route selections and clears.
Useful? React with 👍 / 👎.
Confidence Score: 3/5
[Medium impact] The PR changes model selection across several mobile workflows and syncs route favorites with desktop. 暂不建议合并,需要先修复新任务插件来源丢失和绑定自动化漏存路由的问题。 FindingsFix with agent prompt### Issue 1
apps/mobile/src/session/UnifiedModelPickerSheet.tsx:3138-3140
新建任务从「更多设置 → 引擎」选择宿主路由插件时,这里传出的 `providerId` 带有 `@<hostProviderId>`。但 `new.tsx` 随后通过 `findPluginEngine` 找回基础引擎,并用基础引擎的 `providerId` 构造提交参数,丢掉刚选的模型来源。对于 `models` 为空的纯宿主路由插件,具体模型还会被改成 `default`,无法按用户所选的组合运行。
请让新建任务链路保留完整的绑定来源和具体模型,再开放这个入口。
### Issue 2
apps/mobile/src/scheduler/AutomationModelPickerSheet.tsx:168-173
绑定已有任务的自动化也能选择这里的智能路由,但保存时 `buildMobileScheduleInput` 在 `targetSessionId` 分支提前返回,不会写出 `modelGroup`。只有解析出的具体模型、来源和强度被保存。执行端因此把它当作明确的模型选择,而不会进入「有路由时沿用绑定任务当前选择」的分支,可能把目标任务切回选路时的模型。
请在绑定任务场景隐藏路由入口,或先补齐该场景的路由保存契约,避免把路由悄悄保存成固定模型。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
|
| const applied = await pluginEngineOptions.onSelect({ | ||
| providerId: routedProviderId, | ||
| modelId: wireModelId, |
There was a problem hiding this comment.
新建任务从「更多设置 → 引擎」选择宿主路由插件时,这里传出的 providerId 带有 @<hostProviderId>。但 new.tsx 随后通过 findPluginEngine 找回基础引擎,并用基础引擎的 providerId 构造提交参数,丢掉刚选的模型来源。对于 models 为空的纯宿主路由插件,具体模型还会被改成 default,无法按用户所选的组合运行。
请让新建任务链路保留完整的绑定来源和具体模型,再开放这个入口。
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile/src/session/UnifiedModelPickerSheet.tsx
Line: 3138-3140
Comment:
**新任务丢掉所选来源**
新建任务从「更多设置 → 引擎」选择宿主路由插件时,这里传出的 `providerId` 带有 `@<hostProviderId>`。但 `new.tsx` 随后通过 `findPluginEngine` 找回基础引擎,并用基础引擎的 `providerId` 构造提交参数,丢掉刚选的模型来源。对于 `models` 为空的纯宿主路由插件,具体模型还会被改成 `default`,无法按用户所选的组合运行。
请让新建任务链路保留完整的绑定来源和具体模型,再开放这个入口。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| agentKind: mappedAgent, | ||
| model: mappedAgent === 'acp' ? (route.model || PLUGIN_ENGINE_DEFAULT_MODEL) : route.model, | ||
| providerId: route.providerId, | ||
| effort: route.effort ?? overrides?.effort ?? '', | ||
| fastMode: mappedAgent === 'acp' ? false : (route.fastMode ?? overrides?.fastMode ?? false), | ||
| modelGroup: id, |
There was a problem hiding this comment.
绑定已有任务的自动化也能选择这里的智能路由,但保存时 buildMobileScheduleInput 在 targetSessionId 分支提前返回,不会写出 modelGroup。只有解析出的具体模型、来源和强度被保存。执行端因此把它当作明确的模型选择,而不会进入「有路由时沿用绑定任务当前选择」的分支,可能把目标任务切回选路时的模型。
请在绑定任务场景隐藏路由入口,或先补齐该场景的路由保存契约,避免把路由悄悄保存成固定模型。
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile/src/scheduler/AutomationModelPickerSheet.tsx
Line: 168-173
Comment:
**自动化把路由存成模型**
绑定已有任务的自动化也能选择这里的智能路由,但保存时 `buildMobileScheduleInput` 在 `targetSessionId` 分支提前返回,不会写出 `modelGroup`。只有解析出的具体模型、来源和强度被保存。执行端因此把它当作明确的模型选择,而不会进入「有路由时沿用绑定任务当前选择」的分支,可能把目标任务切回选路时的模型。
请在绑定任务场景隐藏路由入口,或先补齐该场景的路由保存契约,避免把路由悄悄保存成固定模型。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a17143a. Configure here.
| const saved = await runControlAction( | ||
| async () => { | ||
| const staged = await stageHostSessionModelGroup(maker, sessionId, activeSessionModelGroupBinding.selection.id, { location }); | ||
| if (!staged) throw new Error('STAGE_MODEL_GROUP_FAILED'); |
There was a problem hiding this comment.
Follow route clears staged speed
Medium Severity
Choosing "follow route" on a pending custom route restages the binding with only a location. stageHostSessionModelGroup replaces deferSelection, so a fast mode already staged for that switch is dropped, and an SSH task also loses sshHostId.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a17143a. Configure here.
| modelGroup: id, | ||
| }, | ||
| { routeName, modelName: route.model }, | ||
| ); |
There was a problem hiding this comment.
Automation route shows model id
Medium Severity
After a smart route resolves, the automation form stores route.model as the display name. automationDraftModelLabel prefers that override, so the row shows the wire model id instead of the resolved modelName.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a17143a. Configure here.
| } | ||
| const chosenEffort = (deferred && efforts.includes(deferred) ? deferred : null) | ||
| ?? (defaultEffort && efforts.includes(defaultEffort) ? defaultEffort : null) | ||
| ?? (efforts[0] ?? null); |
There was a problem hiding this comment.
Pending route offers unsupported efforts
Medium Severity
For a pending merged source, a stored deferredEffort replaces the model's effort list with all five levels whenever that model advertises fewer than two. The composer menu can then apply an effort the model does not support.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a17143a. Configure here.


这次改了什么
摘要
对照桌面端模型选择器,为手机端(iOS 原生 SwiftUI / Android 同构视图)重排模型选择器与输入框模型胶囊,并补齐自动化页面的统一选模入口和自定义路由收藏的跨端同步:
lucide-react-native图形、品牌标、智能路由角标和远程标记,不再用 SF Symbol 替代。quotaBarSpare配色)移至分组标题右侧,点开就地展开账号明细,去掉二级「来源」页。AutomationModelPickerSheet(支持自定义路由、插件引擎、远端电脑目录、遵循MobileScheduleDraftwire 契约);桌面端modelGroupFavorites.ts改为读写跨端同步的modelFavorites通道,并在确认落盘后再一次性清理旧本机键,解决手机取消收藏后桌面复原的问题。--mock示例主机的选模、换路由与改档接口。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
apps/mobile模型选择器视图(iOS/Android)、数据层、输入框连体胶囊、自动化选模弹窗、协作团队选模、13 语言models.json文案及--mock示例主机补齐packages/device-link/src/modelFavorites.ts自定义智能路由收藏哨兵常量与兼容读写apps/desktop/src/renderer/features/model-groups/modelGroupFavorites.ts与apps/desktop/src/renderer/state/modelFavorites.ts跨端路由收藏同步及一次性安全迁移UI 变化
docs/design-rules/DESIGN.md(双模式与语义 Token:iOS/Android 全部颜色走useTheme().colors,通过pnpm check:design-colors与designTokenDiscipline.test.ts;五档中性字色通过textColorDiscipline.test.ts;视觉克制:来源栏选中态仅用colors.cta/colors.ctaText反色方块加额度条,不堆冗余文字标签;所有文案走useTranslation()并通过 13 语言与术语表校验)docs/design-rules/DESIGN.md(额度双层条与「尽情用」quotaBarSpare配色规则,与桌面端UnifiedModelRail/MixedBalanceCard保持一致)apps/mobile/src/theme/tokens.ts(图标尺寸iconSize、描边iconStroke、圆角radius、字号/行高/字重严格走 token 阶梯)怎么验证的
自动验证
新增/改写测试价值说明(按
engineering-conventions.md§3.2):apps/mobile/src/__tests__/AutomationModelPickerSheet.test.tsx(单文件 ~12ms,3 条):经真实AutomationModelPickerSheet与automationDraftModelLabel入口验证跟随任务/默认文案、清除遗留 ACPagentKind、绑定任务保留modelAgentKind及编辑清远端modelAgentDeviceId的 wire 契约。apps/mobile/src/__tests__/unifiedMobilePickerView.test.tsx(单文件 ~1.6s,54 条):覆盖 iOS/Android 双端来源栏无名选中态与额度条、子页签图标、行尾快捷菜单去掉「· 推荐」、自定义路由行尾强度菜单及收藏/折叠/详情页回退。apps/mobile/src/__tests__/unifiedMobilePicker.test.tsx(单文件 ~245ms,113 条):覆盖真实UnifiedModelPickerSheet下收藏页签中自定义路由可点击与取消收藏、合并来源与插件引擎子页签及sroute:不泄漏到收藏存储。apps/mobile/src/__tests__/androidModelPickerParity.test.tsx(单文件 ~148ms,26 条):覆盖 Android 来源栏无名选中态、保留额度条与子页签图标。apps/desktop/src/renderer/components/new-chat/__tests__/ModelGroupsPickerSection.test.tsx(单文件 ~100ms,7 条):覆盖桌面端旧本机路由收藏一次性迁移、跨窗/跨端同步取消收藏以及QuotaExceededError写盘失败时保留旧键不丢收藏。packages/device-link/src/__tests__/modelFavorites.test.ts(单文件 ~8ms,7 条):覆盖MODEL_GROUP_FAVORITE_PROVIDER_ID跨端收藏 wire 往返兼容。读写与订阅开销核对(
engineering-conventions.md§8):modelGroupFavorites.ts订阅modelFavorites(不新增轮询/定时器);已迁移账号每次通知仅做 1 次本地localStorage.getItem空读,零写盘与零网络往返;卸载时退订。useDeviceProviders/useHostModelGroupsPayload/usePluginEngines打开即读、关闭即停的生命周期,不新增后台轮询。手工验证
Cindy 模型选择器演示(iPhone Air, iOS 27.3,com.xd.cindy,--mock),分支feat/mobile-model-selector-parity,worktree/Users/dash/Code/Cindy/cindy/.cindy-worktrees/mobile-model-selector-parity,Metro 运行在:8081。origin/main后重启 App 验证正常。未执行的验证
androidModelPickerParity.test.tsx与unifiedMobilePickerView.test.tsx单测覆盖。--mock协议对齐与单元测试覆盖)。xcrun: getpwuid_r did not find a match for uid 501),未能再次读取系统日志(此前多轮实测日志 0 错误,最终收起/重开验证无闪退)。风险
风险分类
影响与回滚
modelGroupFavorites.ts)。未触及移动端原生代码、依赖或 runtime fingerprint,支持热更发布。MODEL_GROUP_FAVORITE_PROVIDER_ID复用既有modelFavorites通道与兼容agent: 'cc',旧端忽略该条目不拒绝整表。modelFavorites的路由收藏在新旧格式间互不破坏,无数据迁移不可逆风险。提交前检查
git commit -s,见 DCO)apps/docs或说明自动同步会从哪些来源更新(本次移动端交互重构未改动apps/docs文档,待合入后视需要补充面向用户的移动端说明)Assisted-by: Cindy (https://cindy.app)
Note
Medium Risk
Touches cross-device favorite wire format, smart-route session binding/staging, and large mobile composer/picker surfaces; desktop migration is designed to be safe on write failure but still changes where route favorites are stored.
Overview
Mobile model selection is reworked to match desktop: a horizontal icon-only source rail with quota bars, in-list sub-tabs (including smart-routing tabs with Sparkles/branded marks), row-end effort/speed menus instead of separate settings chips, and a split model | effort composer capsule via
ComposerModelEffortPill. Session and new-task flows gain pending smart-route display, per-task effort on custom routes (including unselected route rows), disconnected-source warnings, fork handoff model groups, and composer transitions that avoid animating while model sheets close.Desktop custom route favorites no longer live only in per-account
localStorage; they read/write the existing syncedmodelFavoritesstream (providerId = model-group-favorite:), with one-time legacy migration, durable-read before deleting old keys, and tests for quota failures andfavoritesOverridedrafts.Automation gets
AutomationModelPickerSheet(follow default/task, smart routes, catalog device label). Visual mock implements bind/unbind, pending switch, and agent-switch intent parity for demos. i18n adds picker copy (warnings, favorites empty, follow route labels).readDurableModelFavoritessupports desktop migration safety.Reviewed by Cursor Bugbot for commit a17143a. Bugbot is set up for automated code reviews on this repo. Configure here.