Skip to content

[Bug]: Codex's command activity displays shell-wrapper quoting instead of the executed command #11362

Description

@xsqu1znt

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open any project in T3 Code using the Codex provider.
  2. Ask Codex to run this exact command:
pwd && rg --files -g 'AGENTS.md' -g '!node_modules'
  1. Wait for the command to complete successfully.
  2. Expand the command activity row.
  3. Copy the displayed command and run it in zsh.

The copied command contains altered quoting around !node_modules and fails with a zsh error. The command originally submitted to the shell succeeds.

Expected behavior

The command activity row should display the exact command Codex executed. Copying it should produce a valid command with the original quoting preserved.

Here I tested it using the Claude provider, it shows correctly:
Image

Actual behavior

The command runs successfully, but the activity row displays the shell launcher's escaped version instead of the command Codex executed. Single-quoted arguments are altered, so copying the displayed text produces an invalid command that fails in zsh.

Here I tested it using the Codex provider with the same prompt, it produced '"'!node_modules'"':
Image

Impact

Cosmetic issue

Version or commit

v0.0.41-nightly.20260911.1520

Environment

Linux desktop AppImage, zsh, Codex provider

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

No response

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 12, 2026
  2. juliusmarminge commented on Sep 12, 2026

    @juliusmarminge
    Member

    Triage

    Confirmed as a display-only Codex bug. The command runs correctly; the activity row shows the login-shell launcher’s escaped quoting instead of the command Codex executed. Copying that text fails in zsh (especially around !). Claude is unaffected because it already sends the raw command.

    What’s going on

    Codex commandExecution items carry two strings:

    • item.command — the wrapper, e.g. /bin/zsh -lc '…'
    • item.commandActions[].command — the inner command that actually ran

    T3 currently:

    1. Drops commandActions when slimming the activity payload (ActivityPayloadProjection.projectCommandData), so clients only see the wrapper.
    2. Unwraps zsh|bash|sh -c/-lc by stripping one matching outer quote pair (session-logic.unwrapKnownShellCommandWrapper, duplicated on mobile). POSIX quote-concatenation ('"'"', '"'!node_modules'"') is left in the copyable text.

    That matches the screenshot: '!node_modules' becomes '"'!node_modules'"'.

    Related

    No open PR. Same derivation on web/desktop; mobile has the same unwrap.

    Suggested fix

    Prefer commandActions[].command for the displayed command (project just that short string). Keep wrapper unwrap as fallback, and unescape POSIX quote-concatenation after stripping -c/-lc. Add a regression for rg --files -g 'AGENTS.md' -g '!node_modules'.

    Severity: cosmetic / low. Leaving this accepted.

  3. added
    acceptedfeature request accepted
    via-triageFiled through npx t3 triage
    and removed
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 12, 2026
  4. Andrew-Forster commented on Sep 12, 2026

    @Andrew-Forster
    Contributor

    I'll take this. I'll check the command payload and shell unwrapping on web and mobile, then add regression tests for the quoted glob example. Command execution will stay unchanged.

  5. xsqu1znt commented on Sep 12, 2026

    @xsqu1znt
    Author

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions