Skip to content

Avoid overwriting symlinked migration targets - #36051

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/13c78e7458d1c02abdb22b38ba88ed66bb5a154b
Jul 30, 2026
Merged

Avoid overwriting symlinked migration targets#36051
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/13c78e7458d1c02abdb22b38ba88ed66bb5a154b

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 30, 2026

Copy link
Copy Markdown

Avoid overwriting symlinked migration targets

Why

External-agent migration treated symlinked empty text targets as overwritable files. Writing migrated configuration through such a target could modify a file outside the repository.

What changed

  • Use symlink metadata when checking whether a migration target is missing or empty, so only regular files are considered overwritable.
  • Preserve symlinked AGENTS.md and .codex/hooks.json targets during both detection and import.

Testing

Added Unix regression coverage for existing and dangling symlink targets for both guidance and hooks migration.

See #26021.

## Why

External-agent migration treated symlinked empty text targets as overwritable files. Writing migrated configuration through such a target could modify a file outside the repository.

## What changed

- Use symlink metadata when checking whether a migration target is missing or empty, so only regular files are considered overwritable.
- Preserve symlinked `AGENTS.md` and `.codex/hooks.json` targets during both detection and import.

## Testing

Added Unix regression coverage for existing and dangling symlink targets for both guidance and hooks migration.

See #26021.

GitOrigin-RevId: 13c78e7458d1c02abdb22b38ba88ed66bb5a154b
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/13c78e7458d1c02abdb22b38ba88ed66bb5a154b branch from 7cba831 to b1ccaa0 Compare July 30, 2026 00:50
@copyberry
copyberry Bot merged commit b1ccaa0 into main Jul 30, 2026
32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/13c78e7458d1c02abdb22b38ba88ed66bb5a154b branch July 30, 2026 00:51
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants