Skip to content

Codex standalone shim: ln -sfn won't replace a real 'current' directory #95

Description

@defangdevs

Follow-up to PR 94 (merged). The start-script shim does:

ln -sfn agent-box-current $HOME/.codex/packages/standalone/current

ln -sfn replaces current only when it's a symlink or plain file. If a curl-installed Codex ever leaves current as a real directory, the command silently creates current/agent-box-current inside it and remote-control pairing keeps resolving the stale copy. The sessions VM test can't catch this because a fresh VM never has a pre-existing directory there.

Fix: guard with [ -d ... ] && [ ! -L ... ] && rm -rf ... before linking, or use atomic replace (temp symlink + mv -T).

Low priority: the standalone installer uses a symlink-based layout in practice, so this only bites on unusual manual layouts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions