fix: reconcile CLI and Desktop messages by canonical identity - #3803
fix: reconcile CLI and Desktop messages by canonical identity#3803Astro-Han wants to merge 4 commits into
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Update on bda2eccf2d:
[P2] busy-race fallback leaves ghost transient row
When renderer thinks idle but host is busy (another window/Bot/Goal continuation holds root), startTurn throws session_busy and falls back to submitMessage({messageId: renderer turnId}). Host then creates a new turnId for the turn while the durable message id stays as renderer turnId. The IPC returns host turnId without messageId, and renderer uses host id for optimistic row — never matches durable id → permanent duplicate (transient ghost).
Fix: return messageId on the turn_started branch and prefer it as transient key; add test for busy→turn_started path.
Note: PR is still draft; this review is preparatory and pending re-review after head stabilizes.
简体中文
busy 情况下回退导致重复行。Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
bda2ecc to
f5ff581
Compare
Summary
Refs #3633
This is replacement PR 2 after #3721 and #3716 landed on
main.messageIdbefore ordinary send or Follow Up admission, render that LocalIntent immediately, and submit the same identity throughturn.message.submit.turn_started,steering, orfollowup; the Host subscription introduces the real Turn, while queue projection describes only the live queue.messageId. Sparse historical ranges omit latest transients without deleting them; latest replacement, reconnect, remount queue echo, and terminal refresh preserve or deterministically replace them.turn.start; Side Conversation keeps its independent fix(desktop): bind Side Conversation events to Host admission #3716 admission and event ownership.steer/queueMessagefallback outcome, CLI delivery retry ownership, and six obsolete fallback-only skipped tests are removed.Before: optimistic rows and Host rows could have different identities, stale transcript replacement could erase the tail, and ordinary admission could create an empty pseudo Turn. After: the submitted message is immediately visible once, stays at one timeline position, and is replaced only by the canonical row with the same identity.
Verification
origin/mainate9d314fd8a15a906d1323c599a1bd300a312d174.@maka/core,@maka/storage,@maka/runtime,@maka/runtime-host,@maka/ui,@maka/desktopmain, andmaka-agent.git diff --checkpassed. Repository-wide tests were not run locally; CI owns that coverage.Authority boundaries
AI use
Tool(s) and scope: Codex authored the implementation, tests, simplification audit, and PR text under human review. Claude was consulted for an independent architecture critique. Material commits retain
Generated-by: Codextrailers.Checklist
Does this PR entail a change in behavior?