Repository navigation
fix: prune runtime binding owner tombstones when panes close - #24
Merged
Merged
Conversation
shuv1337
force-pushed
the
issue/19-prune-binding-tombstones
branch
from
October 11, 2026 08:58
1c2c471 to
86ee44f
Compare
shuv1337
force-pushed
the
issue/19-prune-binding-tombstones
branch
from
October 11, 2026 09:04
86ee44f to
582c795
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.
refs #19
runtime_binding_ownersentries (bound or unbound) are retained exactly as long as their public pane ID resolves to a live pane. No timers, no count cap.Behavior change to review
This gives up the #16 guarantee tested by
native_runtime_attachment_closed_owner_reserves_identity_after_empty_restart(renamed to..._closed_owner_is_released_after_empty_restart): a binding whose pane was closed could never be bound again (runtime_binding_conflict) and its workspace public ID stayed reserved after an empty restart. Keeping both would mean remembering every binding forever, which is the growth #19 is about. After this change, an empty restart can hand out a workspace ID a closed owner used before; a stale client could bind a new pane under its oldbinding_id, but it starts withseq: nulland no carried entry. If that reservation should be preserved, the alternative is persisting a single next-workspace-ID floor instead of per-binding tombstones.Change
src/app/actions.rs:AppState::runtime_binding_owner_is_liveandAppState::prune_runtime_binding_owners, run at the end ofremove_unattached_terminal_ids(shared cleanup for pane/tab/workspace close, pane death, layout replacement). Pane moves re-point entries rather than drop them.pane.unbind_runtime: keeps the entry for the pane being unbound (seq continuity), prunes entries for panes that no longer exist, schedules a save if anything was pruned.src/app/mod.rs): prune after restore without marking the session dirty, so a failed empty restore cannot triggerClear.assert_invariants_for_test: every owner entry points to a live pane.capture_session_save_jobcan returnClearagain once the last pane closes.restore.rsstill reserves IDs for owners in older session files or panes that fail to restore.Tests
runtime_attachment_owner_is_pruned_when_owning_pane_closes,runtime_attachment_unbind_prunes_owners_of_missing_panes,session_save_clears_after_last_runtime_binding_owner_pane_closes,restore_keeps_live_runtime_binding_owners_and_reserves_their_identity;runtime_attachment_identity_sequences_and_unbind_preserve_topologyunchanged and passing.Validation
cargo fmt,cargo clippy --all-targets --locked -- -D warnings,cargo nextest run --locked --no-fail-fast(3834 passed, 8 skipped). One unrelated flake on the firstjust ci-testsrun (agent_start_rejects_a_shell_replaced_by_a_foreground_programreturnedtimeout; passed 3/3 alone).just checknot run locally (Windows cross-lint not set up); CI covers it.