Repository navigation
feat(desktop): edit and resend user messages - #1287
Merged
likun666661 merged 6 commits intoJul 22, 2026
Merged
Conversation
Hxnxe
force-pushed
the
feat/desktop-edit-resend-user-messages
branch
from
July 20, 2026 23:35
9a2bdff to
2442af7
Compare
Astro-Han
approved these changes
Jul 21, 2026
Astro-Han
left a comment
Contributor
There was a problem hiding this comment.
Approving edit-and-resend. Two things:
- The
MAKA_RUNTIME_SAFE_BOUNDARY_RESUMEflip inapp-lifecycle.ts/main.ts(opt-in to opt-out) changes startup behavior for every desktop session and isn't mentioned in the PR body. Either split it into its own PR or add a line to the body so it's visible to reviewers. prepareRevisionSendrelies onnextAnimationFrame()to wait for the composer's draftKey swap beforesetText, with the safety margin coming from therefreshMessagesIPC round-trip. A deterministicsetDraft(key, text)primitive would remove that timing coupling later.
likun666661
reviewed
Jul 21, 2026
likun666661
left a comment
Member
There was a problem hiding this comment.
审计结论
1. 解决了什么问题
把 runtime 的 branchBeforeTurn 接到 Desktop,形成非破坏性的“编辑并重发”:点击时只改本地草稿,发送时才创建分支;原会话不改写,并对运行中/自动化回合、附件历史、显式技能变换文本和 /compact fail-closed。
2. 模块图
flowchart LR
Turn["ChatTurn 编辑入口"] --> Shell["AppShell revision actions"]
Shell --> Composer["Composer 草稿隔离"]
Shell --> Preload["Preload bridge"] --> IPC["branchBeforeTurn IPC"]
IPC --> Runtime["SessionManager.branchBeforeTurn"] --> Child["子会话"] --> Send["普通 sessions.send"]
3. 时序图
sequenceDiagram
actor U as 用户
participant UI as Desktop UI
participant IPC as IPC/Main
participant RT as Runtime
U->>UI: 点击编辑并修改草稿
Note over UI,RT: 点击阶段不创建分支
U->>UI: 发送
UI->>IPC: branchBeforeTurn(source, turnId)
IPC->>RT: 校验后创建子会话
RT-->>UI: child session
UI->>UI: 切换子会话并迁移文本
UI->>RT: 正常发送 edited prompt
4. 有无明显 blocker
有。 PR 同时把 MAKA_RUNTIME_SAFE_BOUNDARY_RESUME 从 opt-in 改成默认开启;这是影响所有 Desktop 启动恢复的全局行为,与 edit-and-resend 边界无关且未写入 Summary。建议拆 PR,或单独说明并取得明确 sign-off。
非阻塞项:prepareRevisionSend 依赖 refreshMessages + requestAnimationFrame 等待 draft key;后续宜改为确定性的 setDraft(key, text)。
验证:本地全依赖构建及 7 个相关 Desktop 定向测试文件通过;GitHub Actions 为 action_required,尚未启动 job。
Hxnxe
force-pushed
the
feat/desktop-edit-resend-user-messages
branch
from
July 21, 2026 17:53
be30cd7 to
5e283bb
Compare
Contributor
Author
|
Addressed the review feedback and rebased this branch onto current
Validation on the rebased head
|
Keep the edit-and-resend notice compact and aligned with the existing composer UI, split the banner copy for clearer styling, and add the missing focus/cursor affordances.
Hxnxe
force-pushed
the
feat/desktop-edit-resend-user-messages
branch
from
July 22, 2026 00:15
352395f to
d6122e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #700.
Implement Desktop Edit & resend as a durable, non-destructive version of the same conversation — not as an ordinary derived/sidebar conversation.
reviseBeforeTurn(ReviseBeforeTurnInput)runtime/IPC path; Desktop no longer exposes or callsbranchBeforeTurnrevisionRootSessionId, parent, turn, immutable index, preparing/committed state)Persisted history is never rewritten. Old versions stay available through the in-conversation version navigator.
Verification
Current commit
d6122e36(rebased onto1ca46327):npm run build:test— passed across Core, Storage, MCP, Runtime, Runtime Host, Computer Use, Headless, CLI, UI, and Desktopnpm --workspace @maka/desktop test(clean dist) — 2782 passed, 0 failednpm --workspace @maka/desktop run typecheck— passednpm --workspace @maka/desktop run test:checks— console, accessibility, and copy checks passednpx biome lint <changed files>andgit diff --check— passedReview focus
preparing→committedhappens only afterAgentRun.begin()durably appends the edited user turn