Skip to content

fix: one card per conversation - #799

Merged
omartelo merged 4 commits into
mainfrom
fix/one-card-per-conversation
Oct 17, 2026
Merged

omartelo merged 4 commits into
mainfrom
fix/one-card-per-conversation

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Two cards could end up on one provider conversation, both writing into the same transcript. This closes the doors lich owns and warns about the one it does not.

What changes

  • Reopen focuses the card that holds the conversation. store.reopen, behind History, an undone close, an existing worktree and Pulls, hands back the open session that already runs a parked row's conversation instead of reinserting a second card. Both windows already only focus an id that is on screen, so no client change was needed.
  • History lists a conversation once. ClosedSessions keeps the newest park per conversation and hides one a card has open; ForgetSession removes every parked copy, so a forgotten row is not replaced by an older one.
  • Warning for a resume typed inside the agent's own app. A session-start report naming a conversation another open card runs raises session-duplicate {id, heldBy}. The native window shows it in a bottom-right toaster of its own, with Keep both and Switch (closes the card that resumed without parking it, then focuses the holder). Strings in all seven native locales.
  • ui.ToasterStyle.Position: sonner's position, four corners, top-right stays the default. Only the warning uses bottom-right; every other toast is where it was.

Providers

Measured on 2026-10-17 with the installed CLIs (details in docs/ceilings.md, row added to every README's provider table):

Provider Warned
Claude Code, Kiro CLI at the switch
Codex with the next prompt
Crush with the next tool call
Antigravity with the next invocation (read in the binary, not run)
oh-my-pi, Cursor CLI, opencode no (omp emits session_switch, which the plugin does not hear yet)

No change to the hook contract on the plugin side; docs/hooks/session-start.md notes the new server-side event.

Verification

  • New tests: store (reopen hands back the holder through both doors, history lists one row per conversation, Forget drops every copy, ConversationHolder), terminal (event raised / not raised), native (duplicateOf, event dispatch), ui (corner placement, swipe out per corner, dampened pull).
  • Backend go vet / go test ./... and native gofmt / go vet / go test ./... green before the rebase onto feat(native): UI polish: status ring, key caps, Settings scope and a one-line palette #797; the rebase conflicted only in CHANGELOG.md.
  • Real native window on Xvfb, backend and window built from this branch: the warning shows bottom-right above the footer, Switch drops the card and leaves History empty, Keep both keeps both.

…conversation

Reopening a parked row whose conversation an open session already runs now
hands back that open session instead of a second card on the same transcript;
both windows already focus an id that is on screen. History lists each
conversation once, by its newest park, and hides one a card has open; Forget
removes every parked copy of it.
ToasterStyle.Position is sonner's position prop: top-right (the zero value
and the default), top-left, bottom-right or bottom-left. A bottom stack grows
up and enters from below, and a swipe leaves toward the corner's own side and
edge. The gallery takes -toasts-at to shoot each corner.
A session-start report naming a conversation another open card already runs,
which a resume typed in the agent's own app does, raises session-duplicate
{id, heldBy}. The native window shows it in its own bottom-right toaster with
Keep both and Switch; Switch closes the card that resumed without leaving a
parked copy and brings up the one that had the conversation.

Which providers report such a switch, and when, was measured on 2026-10-17
and is written down in docs/ceilings.md and the README provider tables.
@omartelo
omartelo force-pushed the fix/one-card-per-conversation branch from 07de1a9 to 9004a2b Compare October 17, 2026 17:15
@omartelo
omartelo merged commit 33825f0 into main Oct 17, 2026
10 checks passed
@omartelo
omartelo deleted the fix/one-card-per-conversation branch October 17, 2026 17:20
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