Repository navigation
feat(workspace): create conversational Goals with one confirmation - #8780
Conversation
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
68153b4 to
8af6134
Compare
cocolord
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; GPT-6; OpenAI; self_reported (host execution observation unavailable).
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Exact head: 8af6134. 未发现阻断项;以下结论只覆盖本次入口增量。
动机 / Motivation
用户在对话中把一项普通任务整理成完整 Goal 草稿时遇到这个问题。 例如整理财报研究目标,原来先点“预览创建”再确认;现在先看到 Agent 和工作区,点一次“创建并开始”。 真实 API 证明确认前没有 Goal 写入,重复点击只提交一次 apply,丢失响应后可读回和重试原操作。
本 PR 不验收原生模型/App 采用、完整任务成果、compaction 保留或可比完整成本。 完整 R1、V4 任务成果与恢复、D2/D5 闭包、总成本及 C1 默认切换继续开放。 这不是对整个最小内核目标的完成声明。提前准备服务确认的执行范围,减少重复人工往返,同时让用户保留必要的明确确认,符合当前任务方向。
改动思路 / Approach
采用既有 typed owner 的可见预览与明确确认,所需异步状态留在 UI;不能用直接串联 preview/apply 省略范围告知。 本 PR 只交付可见完整草稿的一次确认、原操作读回和恢复入口;模型任务成果与完整最小组合仍由既有 R1 工作继续验证。
我核对了现有 Goal 请求构建、action store、review plan、apply 和首轮恢复路径。草稿继续复用 goalCreateRequest,准备只调用原预览服务;真正写入仍由 confirmGoalDraft 转到既有 applyProposal 和 ChatActionService。与把 preview/apply 直接串在同一次点击后的方案相比,当前方案让用户先看到服务解析的 Agent、工作区,再授权执行。
准备中的 key、单次请求 promise 和草稿到提案的对应关系都是 UI 派生状态,来自原消息内容、上下文及服务返回的 proposal。它们不成为创建、权限、quota 或结算的新事实 owner。显示去重覆盖所有提案渲染分组,且只隐藏可见草稿对应的同一提案;草稿未加载时,原提案仍可通过正常入口访问。C1 #8266 的组合与恢复 owner 没有被重写,检查的改动路径也没有交集。
| 当前触发 | 准备与决策 | 结果 |
|---|---|---|
| 完整且可见的草稿 | 读取原操作,准备原 typed preview | 展示真实范围,等待一次确认 |
| 用户确认 | 当前 canApply 和原服务校验 | 原创建/首轮路径或 typed 失败恢复 |
| 读回不可用、提案陈旧或 Agent 不可用 | 不推断缺失,也不自动执行 | 原重试或处理入口 |
这是 8af6134 的源码流程说明;执行证据来自浏览器和真实 action store 检查。
具体改动 / Changes
规范依据为修改前的 docs/architecture/rfcs/monorepo-distribution-split-v0.md,spec_revision 80c6949。V4 要求真实任务、注入中断、重启、成果校验及读回;R1 要求受支持最小组合的完整受治理 Turn 与恢复。两项均 deferred:当前入口增量不是它们的退出证据,仍由既有 R1 工作继续验证。新双语 checkpoint 记录这个边界,没有把自己改写成通过验收的依据。
关键代码讲解
- GoalDraftCard 只有完整、可见且具有写入回调的草稿才准备预览。准备失败保留重试,用户点击才 apply;“已创建”同时要求 applied 与 completed 的 typed 结果,首轮失败不能冒充成功。
- reviewGoalDraft 保留旧的语言相关操作 ID,在 manager 的原 action store 查找两种语言的既有操作,失败读不能当作“原操作不存在”。同一内容、Agent 和来源的在途准备复用 promise,随后仍使用原 Goal 请求构建。
- confirmGoalDraft 拒绝只读及错误 action kind,复核当前投影的 canApply;不能应用时打开原抽屉,可应用时仅改变呈现方式,执行与恢复仍由原 owner 负责。
- ChannelTimeline 按消息、完整草稿内容及准备上下文绑定返回的 proposal id。presentedItems 同时用于普通提案和历史分组,防止同一确认再出现第二张卡,也不会隐去不相关提案。
完整 diff 为九个文件:生产代码 +136/-23,测试与 fixture +157/-16,双语 RFC +46。新 live 场景使用真实 discovery/action store/registry,覆盖确认前零 Goal、响应丢失、原操作重试与 Agent 不可用;会话输入和 Agent 是合成 fixture。既有 fixture 保留应用返回的 idempotency_key,与真实 store 的读回一致。没有提交截图二进制、原始日志、私有 Goal 状态或 uv.lock。
对主干的风险 / Risks
最强反例是:mock 看起来成功,但真实 registry 重复创建,或者首轮失败被显示为完成。真实服务场景在独立 registry 读回时断言只存在一个原 Goal,并在响应丢失和原操作重试后保留同一身份;stub 首轮失败保持未完成。另一次 HTTP source-read 故障注入证明读回失败时 preview/apply 都为零,恢复后通过同一个真实创建与恢复场景。
同一 live 场景运行在主干 UI 时,仍出现“预览创建”,无法提供一次“创建并开始”的控制,得到预期失败;固定 head 上源与打包版本均通过。已保留先前缺少浏览器/root TypeScript 依赖及重复渲染的失败,当前检查补齐环境并修正 presentedItems,没有删除断言或放宽预算。旧操作 ID 的兼容性必须保留,因为它们已经存在持久 store 中;用一个新 hash 取代旧 ID 会增加重复创建风险。
本 PR 明确改变可见完整草稿的默认准备时机,不宣称新 capability default-off。未完整草稿、只读视图、选项填入而不发送、Edit/取消和原 typed-actions 路径继续校验。没有新公共协议、actor 或权限授予,没有调整任何冻结预算。
| 验证 | 当前结果 |
|---|---|
| Dashboard TypeScript、Vite 与 Chat build | PASS |
| 创建、reviewed-create、Goal draft owner 测试 | 44 PASS |
| 源与打包的四个浏览器场景 | 8 PASS |
| 主干反证与真实 source-read 故障恢复 | 预期失败 / PASS |
| 预合入门 | 4 direct + 13 automated PASS |
| scoped demo-readiness(goal-draft) | PASS |
| 首屏公开 SVG 渲染与字节读回 | 6 PASS |
远端 CI 在采样时仍有排队或运行任务;这是独立的 merge readiness 限制,本结论不把它们宣称通过。原生模型/App、完整任务成果与全量目标回归尚未验收;这里没有用 stub、截图或测试数量代替这些证据。
我的整体评价 / Verdict
long_horizon 为 preserved:原创建身份、结果与失败读回、恢复 owner 保留,且没有新增调度或结算机制。user_experience 为 improved:用户先看到服务确认的范围,普通完整草稿只需一次确认。实际桌面与窄屏显示完整草稿、既有多条历史和恢复状态;可见草稿替代重复提案卡,执行范围在确认前可读。 已安装原生 WebView 与真实模型任务成果不在本轮视觉与回归资格内。
修改表单已在桌面和窄屏实际展开检查,全部目标、范围和权限字段可读,编辑/关闭零 Goal 写入。
主干已推进到 a547d40,包含状态读回与原任务恢复相关修复。本 PR 已 rebase,九个改动路径没有与这批主干修改重叠,UI/scenario 源码与此前已检查版本逐字节相同;真实 backend、owner tests 与预合入门重新执行。公开截图保留原来源 68153b4,按相同 UI 与 fixture 的核验复用,不将它们改记为新的原生模型证据。
原持久语言 ID 的兼容判断为 retain;机制边界为 proportionate,状态和新语义仍是 local UI projection,共享的 Goal/action vocabulary 继续复用。最有价值的简化是复用原 owner、移除可见的重复确认卡并延后未查看历史的准备,而不是另加执行管线。规格 V4 与 R1 继续开放,整体最小内核目标仍需原生任务成果、恢复、闭包和总成本证据。当前固定 head 已通过适用验证,可按已有 maintainer 授权进入独立的合入就绪检查。
English verdict: APPROVE - 8af6134; one explicit Goal-draft confirmation reuses the existing typed creator/recovery owner. Real store/registry failure and replay checks, 44 owner tests, 8 source/packaged browser scenarios and the 4+13 premerge gate passed; native model/artifact and full R1 qualification remain open.
|
Merge decision for 8af6134: exact-head review is valid, required local validation passed (44 owner tests, 8 source/packaged browser scenarios, 4 direct + 13 automated premerge checks), and no review findings/threads remain unresolved. The fresh readiness record is false only for 3 pending checks (inspect-pr-diff, prepare, build), with 7 successful checks and no failed check. Existing explicit maintainer/admin authorization covers this GitHub policy/CI hold; it does not waive review, validation or the unchanged mergeable head. Full R1/native-model/artifact/cost qualification remains open. |
A complete conversational Goal draft previously needed a preview click followed by confirmation in the drawer. The visible draft now prepares the existing typed preview, shows the server-resolved Agent and workspace, and offers one Create and start confirmation. Preparation never creates a Goal or starts a Turn.
Incomplete drafts, Edit/cancel and read-only views retain their existing paths. Preview failures can be retried; stale/unavailable states use the existing review drawer. Repeated clicks, reload and language changes reuse the original operation, including the existing locale-scoped IDs. Collapsed unseen history does not prepare creation, and the visible draft replaces its duplicate confirmation card.
RFC alignment: minimal composition RFC, Chinese RFC checkpoint, and C1 unified contract. This is a V4/R1 entry increment using the existing typed review/apply and creation/recovery owners; it adds no shared schema or authority grant. The touched paths do not overlap C1 #8266 at 6a31d83.
Validation: Dashboard TypeScript/Vite/Chat build; 44 creation, reviewed-create and draft tests; goal-draft, goal-draft-live, typed-actions and first-goal-home-live browser scenarios on the source and packaged surfaces. The premerge gate passed 4 direct and 13 automated checks; source/packaged and owner validation are rerun after rebase onto the latest main.
The real-service scenario verifies no Goal writes before confirmation, resolved scope, lost-response readback, retry of the original operation, one registry Goal and unavailable-Agent refusal. Conversation delivery is synthetic; the stub Agent's first-Turn failure remains explicit. Task-artifact success through this entry, installed native App/model adoption, compaction retention, complete D2/D5 closure, comparable total costs, V1–V5/V10, R1/M3 and C1 default cutover remain unqualified.
Visual evidence
Tested source revision: 8af6134. Baseline: main 80c6949. Captures retain their original source revision 68153b4. UI/scenario bytes are unchanged after rebasing onto a547d40; real backend and owner tests are rerun at the new head. These are actual Chromium viewports with public-safe synthetic conversation data; source and packaged backend checks are separate from installed native-WebView qualification. The SVG artifacts embed the original screenshot PNG bytes. Pinned capture manifest records their digests.
Real action owner: prepared scope and failed first-Turn recovery