Skip to content

install.sh --cmd clobbers the shared Codex shim (~/.agents/bin/codex) #553

Description

@fujibee

Found during the plain-remote doc dogfood (2026-07-30).

What happens

install.sh --cmd <other-name> unconditionally (re)writes ~/.agents/bin/codex, and the generated shim hardcodes the skill dir of the install that wrote it:

export AGMSG_CODEX_SHIM_SCRIPT_DIR=~/.agents/skills/<other-name>/scripts/drivers/types/codex
exec ~/.agents/skills/<other-name>/scripts/drivers/types/codex/codex-shim.sh

The shim path is shared across installs, so the last install wins: after installing a test copy under --cmd agmsg-dfr, every Codex agent launched through the shim dispatches into the test install's drivers (and whatever storage they resolve), while the user believes they are on their production install. Nothing warns at install time — the output says "refreshed Codex monitor shim" as if it were a routine update.

Why it matters

--cmd exists precisely so a second install cannot touch the real one. This is the one place the isolation leaks, and it leaks silently in the most confusing direction (production sessions running test-install code).

Expected

One of:

  • per-command shim (~/.agents/bin/codex only for the default install; --cmd installs either skip the shim or write a name-suffixed one and say so), or
  • refuse to overwrite a shim owned by a different install without an explicit flag, stating which install owns it.

Recovery today is manual: re-point the two paths in the shim back at the production skill dir (verified working).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions