Skip to content

Discover legacy backup roots and simplify Documents handling#7

Merged
gaoguobin merged 2 commits into
mainfrom
codex/github-mention-stabilize-default-backup-root-across-sandbox
May 20, 2026
Merged

Discover legacy backup roots and simplify Documents handling#7
gaoguobin merged 2 commits into
mainfrom
codex/github-mention-stabilize-default-backup-root-across-sandbox

Conversation

@gaoguobin
Copy link
Copy Markdown
Owner

Motivation

  • Ensure backup discovery is robust across older installations that used ~/CodexBackups in addition to ~/Documents/... so list_backups finds legacy backups.
  • Stop treating a non-writable ~/Documents as a reason to route backups away from the normal Documents location, because writability checks are unnecessary for discovery.
  • Add an explicit validation note to the skill docs to make sandbox/permission testing deterministic by reusing an explicit --backup-root.

Description

  • Remove the writability check from default_backup_root so only a non-directory Documents triggers the fallback to the legacy root.
  • Add default_backup_roots_for_discovery and update list_backups to search both the primary Documents location and the legacy fallback, deduplicate manifests, handle unreadable manifests, sort results by created_at descending, and expose discovery_roots when discovery was used.
  • Update README.md wording to reflect the directory vs writable-directory behavior and add a validation note to skills/claude-code-environment-backup/SKILL.md and skills/codex-environment-backup/SKILL.md about passing a consistent --backup-root during cross-boundary testing.

Testing

  • Ran unit tests in tests/test_core.py including new tests test_default_backup_root_ignores_writability_checks, test_list_backups_discovers_legacy_home_fallback_root, and test_list_backups_default_discovery_is_sorted_by_created_at_desc.
  • Existing related tests were retained and adjusted for the new behavior.
  • All automated tests passed locally.

Codex Task

Copy link
Copy Markdown

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

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

ℹ️ 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 src/agent_environment_backup/core.py Outdated
@gaoguobin gaoguobin merged commit c24729d into main May 20, 2026
5 checks passed
@gaoguobin gaoguobin deleted the codex/github-mention-stabilize-default-backup-root-across-sandbox branch May 20, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant