Skip to content

Conversation

@jif-oai
Copy link
Collaborator

@jif-oai jif-oai commented Jan 13, 2026

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, ...)

@jif-oai
Copy link
Collaborator Author

jif-oai commented Jan 13, 2026

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Copy link
Collaborator

@dylan-hurd-oai dylan-hurd-oai left a 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

@jif-oai
Copy link
Collaborator Author

jif-oai commented Jan 14, 2026

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines +320 to +325
if now
.duration_since(modified)
.ok()
.is_some_and(|age| age >= SNAPSHOT_RETENTION)
{
remove_snapshot_file(&path).await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@jif-oai jif-oai merged commit 6fbb89e into main Jan 14, 2026
32 checks passed
@jif-oai jif-oai deleted the jif/shell-snapshot-leaks branch January 14, 2026 09:05
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants