Files
Trevin Chow 51ecd9b98f refactor(codex): restore legacy alias cleanup for nested agent names
In cleanupLegacyAgentSkillDirs, re-add the branch that extracts the
final segment after `-ce-` from a compound agent name and seeds
`ce-<final-segment>` as a legacy-cleanup candidate. The branch was
removed in 25f1c8b9 as dead code for compound-engineering itself, but
it's load-bearing for nested-layout third-party plugins passed through
the CLI: their agent names keep the `<category>-ce-<name>` shape, and
without the split a stale `~/.codex/skills/<plugin>/ce-<name>/`
directory from a prior flat-alias install is never swept. For
compound-engineering the branch remains inert (names don't contain
embedded `-ce-`), so this is purely additive coverage for other shapes.

Guard the split on `agent.name.includes("-ce-")` so no-op candidates
are not seeded for flat-only layouts. Add a comment naming the
cross-layout-migration intent so the branch isn't flagged as dead code
again. Regression test in tests/codex-writer.test.ts pins the behavior
against a nested-layout bundle.

Addresses PR #621 review feedback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 02:19:43 -07:00
..