Skip to content

feat(checkpoint): add -g/--global to list checkpoints across all projects#42

Merged
madarco merged 2 commits into
mainfrom
feat/checkpoints-ls-global
Jun 1, 2026
Merged

feat(checkpoint): add -g/--global to list checkpoints across all projects#42
madarco merged 2 commits into
mainfrom
feat/checkpoints-ls-global

Conversation

@madarco
Copy link
Copy Markdown
Owner

@madarco madarco commented Jun 1, 2026

What

Adds -g/--global to agentbox checkpoints (the ls subcommand), mirroring agentbox list -g. The scoped default is unchanged; -g enumerates every project's checkpoints (docker + all cloud backends), grouped and labeled by project.

$ agentbox checkpoints -g
express-server  (/Users/marco/Projects/AgentBox/express-server)
  setup  docker (layered)   from express-server-ba7bc3538  2026-06-01T07:16:34Z *default
  setup  hetzner (snapshot) from express-server-ba51dd4d7  2026-06-01T07:33:51Z *default
  setup  vercel (snapshot)  from express-server-b3f170ad3  2026-06-01T10:56:35Z *default

optima  (/Users/marco/Projects/Evinto/optima)
  setup  docker (layered)   from optima-7924e919  2026-05-26T09:19:13Z *default

How

  • The checkpoint dirs are the source of truth — a checkpoint can outlive its project's config dir, so the global path scans CHECKPOINTS_ROOT / CLOUD_CHECKPOINTS_ROOT/<backend> directly. listProjectsConfigured() only supplies the human-readable root (for the label and per-project *default resolution). Orphan segments with no config are labeled by their dir segment with no marker.
  • New listAllCheckpoints() (docker) and listAllCloudCheckpoints(backend) (cloud) scan helpers, each sharing the per-dir manifest reader with the existing scoped lister (listCheckpointsInDir / listCloudCheckpointsInDir refactor).
  • The *default markers in the global view match the scoped view exactly (verified against express-server).

Tests

  • New checkpoint-list-all.test.ts in both sandbox-docker and sandbox-cloud: assert grouping by segment, items sorted by createdAt, bad-schema manifests skipped, empty segment dirs dropped, and cloud listings scoped per backend. Pure fs (stub-HOME dynamic import), no docker/network.
  • pnpm build, pnpm lint, and full suites green (docker 277, cloud 62, cli 378).

Note

Low Risk
Read-only listing and filesystem scans; no changes to checkpoint create, restore, or delete behavior.

Overview
Adds -g / --global to agentbox checkpoints (ls), aligned with agentbox list -g. The default project-scoped listing is unchanged; the global path prints docker and all cloud backends (daytona, hetzner, vercel) grouped by project, with labels, paths, and the same *default markers as the scoped view.

Library support: listAllCheckpoints() and listAllCloudCheckpoints(backend) scan ~/.agentbox/checkpoints and ~/.agentbox/cloud-checkpoints/<backend> directly; scoped listers now share internal listCheckpointsInDir / listCloudCheckpointsInDir helpers. listProjectsConfigured is only used for display names and default resolution—orphan checkpoint segments still appear when project config is gone.

The CLI refactors row formatting into dockerRow / cloudRow for both modes. New filesystem tests cover grouping, createdAt sort, invalid manifests, empty segments, and per-backend cloud isolation.

Reviewed by Cursor Bugbot for commit dd12614. Configure here.

…ects

`agentbox checkpoints` only listed the current project's checkpoints. Add a
-g/--global flag (mirroring `agentbox list -g`) that enumerates every
project's docker + cloud checkpoints, grouped and labeled by project.

The checkpoint dirs are the source of truth (a checkpoint can outlive its
project's config dir); listProjectsConfigured() supplies the human-readable
root for the label and per-project *default resolution. New listAllCheckpoints
/ listAllCloudCheckpoints scan helpers share the per-dir reader with the
existing scoped listers.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentbox-web Ready Ready Preview, Comment Jun 1, 2026 5:14pm

Request Review

@madarco
Copy link
Copy Markdown
Owner Author

madarco commented Jun 1, 2026

bugbot run

Comment thread apps/cli/src/commands/checkpoint.ts
loadEffectiveConfig in checkpoints -g's per-project loop could throw on a
corrupt config and abort the whole listing. The *default marker is cosmetic,
so fall back to empty defaults (.catch(() => null)) per project — matching the
best-effort listing the scan helpers already provide.
@madarco
Copy link
Copy Markdown
Owner Author

madarco commented Jun 1, 2026

Fixed in dd12614 — wrapped loadEffectiveConfig per project in .catch(() => null) so a single corrupt config falls back to empty *default markers instead of aborting the whole global listing.

bugbot run

@madarco
Copy link
Copy Markdown
Owner Author

madarco commented Jun 1, 2026

bugbot run

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit dd12614. Configure here.

@madarco madarco merged commit 95d2587 into main Jun 1, 2026
4 checks passed
@madarco madarco deleted the feat/checkpoints-ls-global branch June 1, 2026 17:53
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