Skip to content

fix(agent): preserve live Cursor message projections - #2336

Open
mt-hub8 wants to merge 1 commit into
tutti-os:mainfrom
mt-hub8:codex/cursor-message-streaming-fix
Open

fix(agent): preserve live Cursor message projections#2336
mt-hub8 wants to merge 1 commit into
tutti-os:mainfrom
mt-hub8:codex/cursor-message-streaming-fix

Conversation

@mt-hub8

@mt-hub8 mt-hub8 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

修复 Tutti 使用 Cursor 时执行中消息投影不稳定的问题:同一思考块曾因无关的部分 canonical 更新丢失追加锚点,工具消息则可能因消息版本缺口被拒绝实时投影,直到 turn 结束或主动停止后的权威历史同步才重新出现。

  • 将普通 inline/incremental canonical 更新改为按稳定 messageId 合并;批次遗漏不再被解释为删除,从而保留活动 Turn 中思考消息的 append_text 锚点
  • 为已缓存 Session 的结构合法、但存在版本缺口的消息增加独立 canonical preview lane;工具行可立即显示并承接后续 tool-output delta,同时不推进 Engine 的 durable message cursor
  • 在 continuous/authoritative canonical 确认、Turn 结束或历史移除时清理 preview/optimistic 状态,按 messageId 原位完成或取消,避免补回和重复
  • Mobile live lane 在 inline preview 变化时触发刷新;Desktop 继续通过 workspace coordinator 订阅投影变化
  • 补充思考连续追加、版本缺口工具预览、正常完成、主动取消、旧快照竞争和权威历史替换的回归测试
  • 更新 activity-core README 与 agent activity 架构文档,固化 partial merge、preview 和 authoritative cleanup 边界

Verification

  • pnpm check:changed -- --push-ready --base upstream/main(14/14 通过)
  • go test ./packages/agent/daemon/runtime -run 'TestStandardACPNormalizerSegmentsAssistantAndThinkingAroundToolCalls|TestStandardACPToolCallLifecycleReusesStableEventID|TestCursorGlobAndGrepToolCallsPreserveIdentityAndInput'
  • Cursor 实机冒烟:正常完成与执行中主动停止路径;思考在执行中持续合并,工具消息持续可见,结束时无补回、消失或重复

Reviewer handoff

建议后续贡献者重点复核:

  1. previewCanonical 不得推进 durable cursor,版本缺口仍必须触发消息 reconcile
  2. 普通部分更新的 omission 不具有删除语义;只有 effective-history replacement、Session reset/removal 等权威边界可以清理缺失项
  3. completed/canceled canonical 必须按稳定 messageId 替换 preview,不能形成重复工具行
  4. Desktop 与 Mobile 两个消费端都能在 preview 变化时刷新当前投影

当前 Session Replay 尚不支持 local:cursor;本 PR 的 Cursor E2E 证据来自实机冒烟,自动化覆盖集中在共享 activity-core 事件链路。后续如需无订阅环境的确定性 Cursor UI 回放,应作为独立测试基础设施任务增加 Cursor Replay 支持。

Checklist

  • 本 PR 不修改 Session/Turn/Goal/runtime-operation 生命周期语义,无需 Agent Host conformance 场景
  • 变更聚焦于 Cursor 实时消息投影稳定性
  • 已更新行为和数据流文档
  • 未修改 README/CONTRIBUTING 多语言源文件
  • 已运行变更面对应的 push-ready 检查与 Cursor 实机冒烟
  • 提交包含 DCO Signed-off-by

@tutti-pr-review-bot
tutti-pr-review-bot Bot requested a review from a team August 13, 2026 03:49
@mt-hub8
mt-hub8 force-pushed the codex/cursor-message-streaming-fix branch from e609ee0 to c903c07 Compare August 13, 2026 03:53
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