Skip to content

[Bug]: Codex Channel panes fail to reopen after restart — "could not verify the originating Codex session file" on macOS #36487

Closed as not planned

Description

@silentbalanceyh

Operating system

macOS

Orca version

1.4.242+mxt.0216

Details

Short summary

On macOS, Codex Channel panes fail to reopen after an Orca restart. The pane spawn rejects with:

Orca could not verify the originating Codex session file, so automatic resume was stopped to avoid using a different account.

Affected panes show as failed in MXT Terminal grids; other (non-channel) terminals open normally.

Environment

  • Orca: 1.4.242+mxt.0216 (lang branch with the Codex channel launch/resume pipeline)
  • OS: macOS 27.2.0 (arm64), Darwin 27.2.0
  • Shell: /bin/zsh

Root cause analysis

Two mismatches compound in the spawn path (resolvePtySpawnHostEnv → resolveCodexResumeLaunch):

  1. Channel transcript homes are not trusted for resume verification.
    trustedCodexResumeHomes() returns only the system home (~/.codex), the Orca managed home, and per-account managed homes. A channel pane's providerSession.transcriptPath lives under
    ~/Library/Application Support/Orca/codex-channel-runtime/<channelId>/<executionId>/sessions/YYYY/MM/DD/rollout-*.jsonl,
    which is in none of those homes. resolveCodexSessionResumeProvenance therefore always returns outcome: 'fresh' with claimedCodexProvenance: true (the path matches the sessions/YYYY/MM/DD/rollout-* layout regex).

  2. The unverified-resume fallback cannot strip the channel resume command.
    buildCodexChannelResumePlan launches orca codex-channel --restore-channel <ref> --resume <id>. dropAgentResumeArgvFromCommand only recognizes suffixes resume <id> / 'resume' '<id>' / "resume" "<id>". Stripping resume <id> from ... --resume <id> leaves a base ending in --, which fails the whitespace-boundary check (/\s$/), so every candidate returns null → status unrecognized.

With claimedCodexProvenance: true + unrecognized, dropUnverifiedCodexResumeArgv throws UNVERIFIED_CODEX_RESUME_ERROR. The throw propagates through prepareRuntimePtySpawn → the pty:spawn IPC handler rejects → the renderer marks the pane start failed → the terminal never opens.

Deterministic reproduction: any Codex pane bound to a launch channel (MXT grid panes on this branch), quit Orca, reopen — the channel panes fail with the error above on every startup.

Why the guard should not apply here

The channel reference pins the exact sealed revision (command, env, resolved config) and the channel home carries its own credentials. There is no cross-account ambiguity for a channel resume: orca codex-channel --restore-channel replays the sealed revision as a whole. The unverified-resume guard (designed for plain codex resume <id> commands whose transcript provenance is doubtful) should skip channel-bound sessions entirely — e.g. early-return in prepareCodexResumeHome/dropUnverifiedCodexResumeArgv when providerSession.codexChannel is set, or teach the drop logic the --resume flag shape as defense in depth.

Suggested fix

In src/main/ipc/pty/host-env/codex-resume.ts (prepareCodexResumeHome) or src/main/codex/codex-unverified-resume-launch.ts, bypass the trusted-home verification + argv-drop path when providerSession.codexChannel != null, since the sealed channel already pins account and configuration. Optionally extend dropAgentResumeArgvFromCommand to recognize --resume <id> / --fork <id> suffixes so future flag-shaped resume commands degrade to a fresh launch instead of refusing.

Related

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

Metadata

Metadata

Assignees

Labels

os:macosIssues affecting macOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions