Skip to content

feat(cli): add session prune command to v2 - #51255

Closed
DEAD1nsane wants to merge 3 commits into
anomalyco:devfrom
DEAD1nsane:session-prune-v2
Closed

DEAD1nsane wants to merge 3 commits into
anomalyco:devfrom
DEAD1nsane:session-prune-v2

Conversation

@DEAD1nsane

@DEAD1nsane DEAD1nsane commented Sep 25, 2026 •

Copy link
Copy Markdown

Issue for this PR

N/A — feature request.

Type of change

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

What does this PR do?

Adds opencode session prune <duration> to the v2 CLI. It previews eligible session families, supports confirmation or --force, protects active and recently-updated families, supports --include-archived, and rechecks roots before deletion. The handler paginates the complete session inventory and tolerates sessions already removed by another process.

How did you verify your code works?

  • bun test test/session-prune.test.ts — 5 tests passed.
  • Targeted Prettier and Oxlint checks passed.
  • Node-targeted handler bundle succeeded (1124 modules).
  • git diff --check passed.
  • The full package typecheck could not complete in this Android/Termux environment because Node exhausted its heap; CI remains the authoritative check.

Screenshots / recordings

Not applicable; this is a CLI-only change.

Checklist

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

Add a project-scoped session prune command for the v2 CLI with dry-run preview, explicit confirmation, family-safe age filtering, and focused tests.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@DEAD1nsane DEAD1nsane mentioned this pull request Oct 6, 2026
3 of 6 tasks
@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:17
@opencode-agent opencode-agent Bot mentioned this pull request Oct 14, 2026
1 task done
@DEAD1nsane

Copy link
Copy Markdown
Author

hey — tiny ci thing. i pushed an empty commit to poke it and pr-standards went green, but test/check/nix-eval are all stuck at action_required and i can't approve them from my side since i only have read access here.

fwiw i ran the same suite against this exact commit in my fork and linux was totally clean — the only red was a couple of windows tests timing out on git/npm over the network, nothing to do with this pr. could someone with write access hit approve and run? thanks

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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