Repository navigation
Description
The TUI's per-keystroke Playbook sync discards the daemon's answer when it is an error:
let Ok(result) = self.client.playbook_edit(params).await else {
return;
};(crates/cli/src/app/editor.rs ~line 1526 @ ad47152)
The edit is anchored (old_string → new_string, playbook_anchored_live_edit), so it fails whenever the daemon's document no longer contains that anchor — after a local undo (#1088), or when an agent rewrites the region you are typing in between two keystrokes. When it fails:
- no status message,
- no retry,
- no re-fetch,
- and
popup.saved_markdownis left stale, soplaybook_popup_has_unsaved_editsis now true andon_playbook_statestops adopting remote changes (crates/cli/src/app.rs~line 10155) — by design, to protect unsaved work.
The net effect is a Playbook that silently stops both publishing and receiving. Every later keystroke fails against the same stale anchor. The only signal is the * modified chip in the pane title, which reads as ordinary "you have unsaved edits", not "your last 40 keystrokes are not in the document".
Repro
- Open a Playbook in the TUI, type a few characters (synced).
- Force an anchor mismatch — press
C-x u(tui: playbook undo (C-x u) never reaches the daemon, then every later keystroke is silently dropped #1088), or have an agent rewrite the line under the caret. - Keep typing.
Observed: the TUI buffer advances, the daemon's document does not, and an agent edit made afterwards does not appear in the TUI.
Expected
A failed live edit is a recoverable conflict, not a terminal state. The merge machinery already exists and works: C-x C-s on the same diverged buffer produced playbook merged with agent edits (version 42) with both sides intact.
Suggested fix
On playbook_edit error, fall back to the save/3-way-merge path (optionally after one retry with a re-fetched base), and surface a short status. That single change also bounds the blast radius of #1088 to one lost character.
Acceptance criteria
- A failed live edit produces a visible status message.
- The client re-converges with the daemon automatically (merge or rebase) rather than staying diverged until a manual
C-x C-s. - Regression test: a live edit whose anchor is missing server-side still ends with client and daemon documents equal.
Found during a hands-on UX audit of the Playbook in the TUI and web UI.
Activity
playbook: publish every client edit, and re-converge when one is reje…
playbook: publish every client edit, and re-converge when one is reje…
edwin-zvs commentedon Aug 1, 2026
Fixed in #1116 (
987a14f). A rejected live edit now falls back to the same three-way mergeC-x C-sperforms: it rebases onto the latest document, keeps both sides, re-armssaved_markdown, and reports the merge, instead of being dropped on the floor. Recorded as spec 0171.playbook: publish undo on its own gesture (#1117)