Skip to content

fix(snapshot): optimize cleanup with stale pack removal and conditional gc#77

Open
riatzukiza wants to merge 2 commits intofix/snapshot-phase2-hardeningfrom
fix/snapshot-phase3-gc
Open

fix(snapshot): optimize cleanup with stale pack removal and conditional gc#77
riatzukiza wants to merge 2 commits intofix/snapshot-phase2-hardeningfrom
fix/snapshot-phase3-gc

Conversation

@riatzukiza
Copy link
Copy Markdown
Owner

Issue for this PR

Closes #74

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This phase replaces unconditional heavy cleanup with threshold-driven maintenance. It removes stale tmp_pack_* artifacts under lock, runs gc --auto only when loose objects are high, and only escalates to prune when pack count remains elevated.

How did you verify your code works?

  • Ran bun test test/snapshot/snapshot.test.ts from packages/opencode.
  • Verified stale tmp_pack_* cleanup and low-loose-object behavior tests pass.

Screenshots / recordings

N/A (non-UI change).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 25, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/snapshot-phase3-gc

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 and usage tips.

@riatzukiza riatzukiza force-pushed the fix/snapshot-phase3-gc branch from 11f6f7e to d3b4751 Compare February 25, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant