Skip to content

Add permanent deletion for archived panes#335

Merged
parsakhaz merged 2 commits into
mainfrom
fix/archived-pane-delete
Jul 15, 2026
Merged

Add permanent deletion for archived panes#335
parsakhaz merged 2 commits into
mainfrom
fix/archived-pane-delete

Conversation

@parsakhaz

Copy link
Copy Markdown
Member

Summary

  • add permanent delete actions for individual archived panes and all visible archived panes
  • require confirmation before destructive archived-pane cleanup
  • remove leftover worktrees/artifacts/files before dropping archived pane history
  • add archived-only database deletion helpers and focused coverage

Closes #333

Testing

  • PATH=/opt/homebrew/opt/node@22/bin:/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path:/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path:/Users/parsas/.codex/tmp/arg0/codex-arg0A9D7rH:/Users/parsas/.composio:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/parsas/.composio:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Users/parsas/.local/bin:/Users/parsas/.yarn/bin:/Users/parsas/.config/yarn/global/node_modules/.bin:/Users/parsas/.local/bin pnpm --filter main typecheck
  • PATH=/opt/homebrew/opt/node@22/bin:/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path:/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path:/Users/parsas/.codex/tmp/arg0/codex-arg0A9D7rH:/Users/parsas/.composio:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/parsas/.composio:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Users/parsas/.local/bin:/Users/parsas/.yarn/bin:/Users/parsas/.config/yarn/global/node_modules/.bin:/Users/parsas/.local/bin pnpm --filter frontend typecheck
  • PATH=/opt/homebrew/opt/node@22/bin:/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path:/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path:/Users/parsas/.codex/tmp/arg0/codex-arg0A9D7rH:/Users/parsas/.composio:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/parsas/.composio:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Users/parsas/.local/bin:/Users/parsas/.yarn/bin:/Users/parsas/.config/yarn/global/node_modules/.bin:/Users/parsas/.local/bin pnpm --filter main exec vitest run src/database/database.hidden-sessions.test.ts src/ipc/daemonRegistryBindings.test.ts

@parsakhaz

Copy link
Copy Markdown
Member Author

@codex please review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: d66ea4bdb6

ℹ️ 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 thread main/src/ipc/session.ts Outdated
@parsakhaz

Copy link
Copy Markdown
Member Author

@codex review

@parsakhaz parsakhaz merged commit 5dac54a into main Jul 15, 2026
16 checks passed
@parsakhaz parsakhaz deleted the fix/archived-pane-delete branch July 15, 2026 01:10
@parsakhaz parsakhaz mentioned this pull request Jul 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 193a353670

ℹ️ 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 thread main/src/ipc/session.ts
await cleanupPermanentDeleteFiles(session as unknown as DatabaseSession);
}

const deletedCount = databaseService.deleteArchivedSessionsPermanently();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Delete only the archived snapshot that was cleaned

In sessions:permanent-delete-archived, the loop above snapshots archived panes and cleans files/worktrees for those IDs, but this call re-queries the database and deletes every pane that is archived at that later moment. If another pane is archived while the async cleanup is running, it can be removed from history without cleanupPermanentDeleteFiles ever running for it, leaving its worktree/artifacts behind and deleting something outside the confirmed set. Reuse the archivedSessions IDs for the final database delete instead of deleting a fresh archived set.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot Delete A Pane

1 participant