Repository navigation
fix(core): keep locations with running terminals out of eviction - #48730
iyernaveenr wants to merge 1 commit into
Conversation
LocationActivity evicts a location 60 minutes after its last durable session event. Terminals produce no session events, so a location whose only activity is a running terminal is invalidated on schedule and the Pty finalizer kills every terminal in it, disconnecting attached clients and discarding their scrollback. Before evicting an expired location, ask its cached Pty service for running sessions and renew the deadline while any exist. The probe uses contextEffectOption, so it never boots a location that is not cached.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Independent data point supporting this PR's direction. On v2.0.22 a So a retention/exemption rule for "locations with a backgrounded or running shell job" is what preserves the completion notification, not just the process. Requesting the same treatment for backgrounded shells as this PR gives terminals. |
Issue for this PR
Closes #48691
Type of change
What does this PR do?
LocationActivityevicts a location 60 minutes after its last durable session event. Terminals produce no session events, so a location whose only activity is a running terminal is invalidated on schedule and the Pty finalizer kills every terminal in it: blank pane, scrollback gone, and the desktop app recreates empty terminals.Before evicting an expired location, the sweep now asks that location's Pty service for running sessions and renews the deadline while any exist. The probe uses
contextEffectOption, so it only reads the cached graph and never boots a location. A graph that failed to build counts as having no terminals, so failed locations are still cleaned up as before, and running executions are only interrupted when the location is actually going to be evicted.How did you verify your code works?
packages/core/test/location-activity.test.ts: a location built from the realPtynode with a runningcatterminal stays cached when its deadline passes (terminal still running); once the terminal is removed, the next deadline evicts it. The test fails without the fix.LocationActivityeviction tests pass unchanged;packages/coretypecheck, the pty and location suites, oxlint and prettier are clean.Screenshots / recordings
Not a UI change.
Checklist