手机端用「目标模式」创建的任务,在被控电脑和其他同步了该账号的设备上,任务列表显示为「未命名任务」
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
### 问题描述 / What happened
根因
目标模式的首轮对话走 GoalController 的 session.send,不经过 maker:input:enqueue,所以被控端的自动起名钩子不触发:
普通会话自动起名挂在发送入队上:本机走 maker:auto-title,device-link 远控走 prepareDeviceLinkAutoTitle(apps/desktop/src/main/maker-ipc/register.ts,仅 INPUT_ENQUEUE/INPUT_STEER)。
目标模式绕过了这条路径(NewMakerDraftRoute.tsx 内注释已写明「被控端 deviceLinkAutoTitle 不会触发」)。
maker:goal:set 只调 controller.setGoal,persistUserMessage 只落一条消息,都不写标题。
桌面 GUI「新建目标」为这条缺口做了补偿(本地分支 autoNameSession,远控分支 patch-meta + generate-title),所以桌面创建的目标正常。
但手机端 createGoalSession(apps/mobile/app/sessions/new.tsx:4544)没做补偿:它只把标题合成进本地镜像并 setPendingTitlePreview(乐观预览),从没调 local-db:sessions:patch-meta 或 maker:generate-title 把标题写回被控端。于是被控端 DB 里标题一直是哨兵 'New Maker',各端显示层把它投影成「未命名任务」。
修复建议
apps/mobile/app/sessions/new.tsx 的 createGoalSession 在 goal.set 成功后,把标题写回被控端(对齐桌面远控分支的占位逻辑):
await maker.patchSessionMeta(sessionId, {
title: normalizeAutoTitle(input.objective),
});
mobileMakerTransport 已有 patchSessionMeta(local-db:sessions:patch-meta)。占位这一步即可消除「未命名任务」;智能标题(maker:generate-title)mobile 目前未接线,可作为后续增强。建议补一条测试覆盖「目标模式创建后标题已落库」。
### 环境 / Environment
- Cindy 版本或 commit / version or commit:
- 平台与版本 / platform & OS version:0.1.75
- 安装方式 / install method:
### 复现步骤 / Steps to reproduce
手机 App 连接一台被控电脑(device-link)。
新建任务 → 选择「目标模式」→ 填目标文案(如「修复登录失败」)→ 开始。
观察手机:会话标题显示为目标文案(正常)。
到被控电脑(或另一台同步同一账号的设备)查看会话列表 → 该任务显示「未命名任务」。
(可选)手机上杀掉 App 重进、重拉列表 → 手机端也会退回「未命名任务」,证明之前的正常标题只是本地乐观预览。
### 日志与截图 / Logs & screenshots
Contributor guide
Research direction
Start in apps/mobile/app/sessions/new.tsx at createGoalSession around line 4544, then inspect mobileMakerTransport.patchSessionMeta and the desktop remote goal flow for comparison. Verify the goal-session title is persisted to the controlled device rather than only shown in the local preview, and add or run a test covering the stored title after creation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100