Skip to content

Avoid repeated session copies when deleting project groups - #26230

Merged
nwparker merged 2 commits into
mainfrom
nwparker/perf-project-group-session-batch
Oct 8, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/perf-project-group-session-batch

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Deleting a project group containing many folder workspaces repeatedly copied the same saved terminal and browser sessions. Orca now removes those folders together, copying each host session once.

What Changed

Collect the deleted subtree’s folder workspace keys and apply the existing batch session remover to the local session and every remote host partition. Repositories remain registered and become ungrouped; unrelated workspaces, lineage cleanup, mobile selections and the scheduled save keep their existing results.

Why

Reusing the existing batch remover removes repeated copies without introducing a cache or changing session ownership. Eleven alternating warmed pairs measured the complete synchronous production deletion action with generated scrollback, local spill and two disjoint remote partitions:

Deleted folders Before After Session copies
8 2.322 ms 0.376 ms 24 → 3
24 12.150 ms 1.068 ms 72 → 3

These fixtures used 32 KiB of generated scrollback per leaf plus eight unrelated owners per partition. Final state and callback results matched in every pair and 34 additional parity controls. The one-folder control remained sub-millisecond (0.227 → 0.294 ms); this targets multi-folder deletion. Measurements cover Node on macOS and save admission, excluding scheduled disk writes. This is not evidence for the intermittent Codex typing pause.

Linked Issue

Internal performance audit; no pre-existing issue.

Visual Proof

N/A — deletion has the same resulting workspace and session state; this changes backend copying only.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

The new regression failed before the fix with 72 copies instead of three; all four new tests pass afterward. They check subtree cleanup across local, SSH and runtime partitions, retained owners, lineage callback order, mobile selections, one save, empty groups and missing groups. The persistence suites passed: 194 files / 2,057 tests, with three files / five tests skipped. pnpm tc:node, formatting and the changed-code quality gate pass. The combined branch containing all 29 audit changes also passed these 2,057 persistence tests, full pnpm tc, and the 96-file changed-code quality gate. Hosted CI will cover additional platforms; no native Windows/Linux or physical SSH timing is claimed.

Review

Independent source review confirmed the production lineage callbacks only delete lineage entries and neither read session state nor emit or schedule saves. Existing owner pruning and topology-revision behavior are reused.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Folder workspaces and every saved execution-host partition are covered. No filesystem, Git, wire protocol, terminal process or readiness behavior changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Hosted CI passes on the corrected head. Regression fixtures use fixed terminal timestamps and pass under both Bun and Node.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed1b9f49-9847-49dc-ac0f-6207f6e4bbb7
📥 Commits

Reviewing files that changed from the base of the PR and between a6584f0 and 5569996.

📒 Files selected for processing (1)
  • src/main/persistence/tracking-repos/project-group-session-batch.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

Project-group deletion now collects keys for matching folder workspaces and removes their session owners from the local workspace session and defined host partitions in one call. A new helper returns without changes when the owner set is empty. Tests cover subtree deletion, retained session owners, reference preservation when no workspaces match, and missing-group behavior.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 55699

The reviewed change removes the intended workspace owners while preserving unrelated session state. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: preventing repeated session copies during project-group deletion.
Description check ✅ Passed The description covers the change, rationale, testing, performance results, scope, and checklist items. It does not provide an actual linked issue, although the template requires one unless the author…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit e97d18d into main Oct 8, 2026
37 checks passed
@nwparker
nwparker deleted the nwparker/perf-project-group-session-batch branch October 8, 2026 06:49
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.

1 participant