fix: preserve sessions when pane shells are signaled - #3418
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
Suggested reviewers: Merge Risk: 🟡 Moderate · up to The change preserves sessions after signaled pane exits, but a failed checkpoint can still prevent shutdown from retrying the save and leave stale recovery state. Merge should wait for retryable failure handling or explicit owner acceptance of this bounded data-persistence risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CodeRabbit’s merge-risk note is intentionally handled by the conservative fallback here. Session writes are atomic, so a failed checkpoint leaves the previous session file untouched. Once the signaled panes have been removed, the shutdown path no longer has the intact state to retry; writing then would overwrite the safest available recovery state with the damaged session. |
Greptile SummaryThe PR preserves the last intact session snapshot when a pane shell is terminated by a signal, including panes imported through live handoff. It also ensures normal autosaves and newer durable mutations supersede that checkpoint.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/app/session.rs | Adds the checkpoint lifecycle, replacement rules, and shutdown guard while preserving newer dirty state. |
| src/app/api.rs | Checkpoints eligible tiled panes immediately before pane-death mutation and finalizes the checkpoint afterward. |
| src/pane.rs | Propagates signal status for owned children and conservatively checkpoints imported handoff panes whose exit cause is unknowable. |
| src/server/headless.rs | Uses checkpoint-aware final persistence during headless shutdown. |
| tests/api_ping.rs | Covers signal termination followed by immediate server shutdown. |
| tests/live_handoff.rs | Covers unknown imported-pane exit after live handoff followed by immediate shutdown. |
Sequence Diagram
sequenceDiagram
participant P as Pane runtime
participant A as App
participant D as Session storage
participant S as Shutdown
P->>A: "PaneDied(checkpoint_session=true)"
A->>D: Save intact pre-removal snapshot
A->>A: Remove terminated pane
alt newer durable mutation
A->>A: Mark dirty and invalidate checkpoint guard
S->>D: Save newest session state
else immediate shutdown
S->>D: Retain intact checkpoint
else debounce expires
A->>D: Persist post-removal state
end
Reviews (3): Last reviewed commit: "Merge branch 'master' into issue/3415-pr..." | Re-trigger Greptile
95ac7c2 to
0402939
Compare
0402939 to
60d6a8f
Compare
|
@greptileai please re-review the current head |
Summary
Refs #3415
Testing
just check