-
Notifications
You must be signed in to change notification settings - Fork 7.2k
fix: shell snapshot clean-up #9155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a79a81902
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dylan-hurd-oai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to provide some mechanism to update the shell snapshot for a session? either when resuming or allowing the model to request it somehow
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6e8e8b060
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if now | ||
| .duration_since(modified) | ||
| .ok() | ||
| .is_some_and(|age| age >= SNAPSHOT_RETENTION) | ||
| { | ||
| remove_snapshot_file(&path).await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid deleting snapshots for still-active sessions
This cleanup removes snapshots solely based on the rollout file mtime being older than the 7‑day retention window, except for the currently active session. If another session is still open but has been idle (no rollout writes) for >7 days, its snapshot will be deleted the next time any session creates a snapshot. That breaks subsequent shell commands for the idle session because the runtime sources the snapshot file (see tools/runtimes/mod.rs), leading to command failures despite the session being active. Consider tracking active sessions (or a heartbeat) rather than pruning based only on rollout mtime.
Useful? React with 👍 / 👎.
Clean all shell snapshot files corresponding to sessions that have not been updated in 7 days
Those files should never leak. The only known cases were it can leak are during non graceful interrupt of the process (
kill -9,panic`, OS crash, ...)