Skip to content

chore(skills): remove the legacy Codex home startup cleanup - #329

Open
BlackHole1 wants to merge 2 commits into
mainfrom
chore/remove-legacy-codex-cleanup
Open

chore(skills): remove the legacy Codex home startup cleanup#329
BlackHole1 wants to merge 2 commits into
mainfrom
chore/remove-legacy-codex-cleanup

Conversation

@BlackHole1

Copy link
Copy Markdown
Member

The TODO(codex-removal) routine was a temporary compatibility shim: after the Codex agent moved to the universal ~/.agents skills location, every CLI startup scanned ~/.codex/skills (or $CODEX_HOME/skills) for oo-managed skills to delete and removed the orphaned canonical <config>/skills/bundled/codex storage, so users wouldn't see duplicate skills. Enough releases have shipped since the migration that no user should still have oo-managed copies under the legacy Codex home, so the shim has served its purpose.

This deletes legacy-codex-cleanup.ts with its tests and the call site in run-cli.ts. The OO_SKILLS_SYNC_DISABLED guard test in run-cli.test.ts previously relied on the Codex cleanup to prove that legacy cleanups stay inside the guarded block; it now seeds a legacy @alwaysmavs/gpt-image-2 skill instead, keeping that coverage against the remaining guarded cleanup.

The TODO(codex-removal) routine was a temporary compatibility shim
that deleted oo-managed skills from `~/.codex/skills` (or
`$CODEX_HOME/skills`) and the canonical `<config>/skills/bundled/codex`
storage after the Codex agent moved to the universal `~/.agents`
location. Enough releases have shipped since then, so the startup run
no longer needs to scan or touch the legacy Codex home.

Drop `legacy-codex-cleanup.ts` with its tests and the call site in
`run-cli.ts`. The `OO_SKILLS_SYNC_DISABLED` guard test that relied on
the Codex cleanup now seeds a legacy `@alwaysmavs/gpt-image-2` skill
instead, keeping coverage for the remaining guarded legacy cleanup.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0fcf9b2c-7b39-43b4-80bf-986be4e2529f

📥 Commits

Reviewing files that changed from the base of the PR and between 9b28d91 and 6338a36.

📒 Files selected for processing (1)
  • src/application/bootstrap/run-cli.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/application/bootstrap/run-cli.test.ts

Summary by CodeRabbit

  • Bug Fixes

    • Updated CLI startup skill synchronization to preserve legacy managed skills when OO_SKILLS_SYNC_DISABLED is enabled.
    • Removed the automatic legacy Codex-managed skills cleanup step from CLI startup, preventing unintended deletion of existing skill directories.
  • Tests

    • Updated the bootstrap CLI test coverage to assert that seeded legacy managed skills remain present when OO_SKILLS_SYNC_DISABLED is enabled.

Walkthrough

The CLI startup flow no longer imports or invokes legacy Codex managed-skill cleanup. Bootstrap coverage removes the former legacy Codex-home deletion test and verifies that a universal managed skill, including its SKILL.md and .oo-metadata.json, remains when OO_SKILLS_SYNC_DISABLED is enabled.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required type(scope): subject format and clearly matches the cleanup removal in this PR.
Description check ✅ Passed The description is clearly related to removing the legacy Codex cleanup and updating the guarded test coverage.
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.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/remove-legacy-codex-cleanup

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/application/bootstrap/run-cli.test.ts`:
- Around line 309-314: Strengthen the assertions in the --help test around
managedRegistryPath by verifying that both seeded files, SKILL.md and
.oo-metadata.json, still exist after sandbox.run; preferably capture their
initial contents and assert they remain unchanged, while retaining the existing
directory assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dab71d00-3f51-4107-8dc5-0d9da002fed9

📥 Commits

Reviewing files that changed from the base of the PR and between 99b136f and 9b28d91.

📒 Files selected for processing (4)
  • src/application/bootstrap/run-cli.test.ts
  • src/application/bootstrap/run-cli.ts
  • src/application/commands/skills/legacy-codex-cleanup.test.ts
  • src/application/commands/skills/legacy-codex-cleanup.ts
💤 Files with no reviewable changes (3)
  • src/application/commands/skills/legacy-codex-cleanup.ts
  • src/application/commands/skills/legacy-codex-cleanup.test.ts
  • src/application/bootstrap/run-cli.ts

Comment thread src/application/bootstrap/run-cli.test.ts
Directory existence alone would pass even if the cleanup deleted the
seeded files while leaving the directory behind; assert SKILL.md and
.oo-metadata.json are still present to make the guard test strict.

Signed-off-by: Kevin Cui <bh@bugs.cc>
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