Skip to content

fix: deleting several sessions in a row from the phone - #88

Merged
deymosh merged 2 commits into
masterfrom
fix/delete-sessions-in-a-row
Oct 7, 2026
Merged

deymosh merged 2 commits into
masterfrom
fix/delete-sessions-in-a-row

Conversation

@deymosh

@deymosh deymosh commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Checks the "delete several sessions one after another" path through all three layers and fixes the one gap it found.

The gap. A deleted session stays undoable for 4 s, and that window lives only in memory. Each delete commits the one before it, but the last one waits out its window. If Android killed the backgrounded app before that, its close-session was never sent, and the session reappeared once its local dismissal expired (an hour later). The runtime now commits a pending delete as soon as the app is backgrounded (Msg::Pause, already wired from ProcessLifecycleOwner). Its undo toast is out of sight by then anyway.

Tests added:

  • client-runtime: three deletes in a row send exactly one close-session each; a session list the bridge sent before closing the later ones does not bring them back; backgrounding sends the last one well within the window. This test fails without the fix.
  • bridge-core: three running sessions and one still starting, closed in a row. Each is ended in the agent host and acked, the next heartbeat lists none of them, and replies or events the host still had in flight bring none back.
  • agent host (DeepSeek driver): sessions sharing one harness process, ended together. The process is closed only after the last one.

Verified: cargo clippy --workspace --all-targets -D warnings; cargo test for client-core, client-runtime and bridge-core; agent host typecheck and tests.

🤖 Generated with Claude Code

deymosh and others added 2 commits October 7, 2026 17:16
…backgrounded

A deleted session stays undoable for four seconds, and that window lives
only in memory. Deleting several sessions in a row commits each one when
the next is deleted, but the last one waits out its window: if Android
killed the backgrounded app before then, its close-session was never
sent, and the session came back once its local dismissal expired. Going
to the background now commits a pending delete at once; its undo toast
is out of sight by then anyway.

The new runtime test deletes three sessions in a row and checks that
each close-session is sent exactly once, that a session list the bridge
sent before closing the later ones does not bring them back, and that
backgrounding sends the last one.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The bridge test closes three running sessions and one still starting in
a row: each is ended in the agent host and acknowledged, the next list
has none of them, and replies and events the host still had in flight
bring none back. The DeepSeek driver test ends sessions that share one
harness process together and checks that the process is closed only
after the last one.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@deymosh
deymosh merged commit 33a53c8 into master Oct 7, 2026
6 checks passed
@deymosh deymosh mentioned this pull request Oct 7, 2026
@deymosh
deymosh deleted the fix/delete-sessions-in-a-row branch October 7, 2026 15:50
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