Repository navigation
Description
Operating system
macOS
Orca version
v1.4.215
Details
Summary
Codex's app-server daemon is spawned once, detaches (ppid=1), and keeps the ORCA_PANE_KEY of whichever pane first needed it. Every Codex session it serves afterwards reports agent status under that one pane, whatever workspace the session actually belongs to.
One inherited key, three visible faults:
| when the inherited pane is | what happens | observed |
|---|---|---|
| alive | another workspace's row shows this session's reply | a session in sideby answered; the row appeared under snowboarder-app |
| alive, serving several sessions | they overwrite one shared row | one stored row with paneKey → snowboarder-app and providerSession → a plico session |
| gone | every Codex session disappears from the lists | 8 Codex sessions running, last-status.json holds 0 codex entries |
Claude is unaffected in the same store at the same moments — its sessions keep one entry per pane.
Reproduction (desktop only; no mobile needed)
- Open a Codex session in workspace A. This is what spawns the app-server daemon, which inherits A's
ORCA_PANE_KEYand detaches. - Open a Codex session in workspace B and send it one message.
- Look at B's row in the sidebar, in
orca worktree ps, or in the mobile workspace list.
B's reply is attributed to A, and B never gets a row. If A's tab has since been closed, nothing is recorded at all.
Two runs of step 2–3 here:
Run 1 — inherited pane still alive. Sent route test 2 to a Codex session in sideby. orca worktree ps reported it under snowboarder-app:
snowboarder-app
- codex route test 2 수신했습니다. paneKey=65f6c734…:153f3a28…
sideby's tab is a1da984f…:25b4a560… and had no agent row. Grepping every live terminal for the string found it in exactly one place — the sideby session. Delivery was correct; only the attribution was wrong.
Run 2 — inherited pane gone. Opened a Codex session in plico (pane 75551d8a…:5fc0bf4d…, tab titled 테스트 123 실행 | plico) and sent one message. The session holds the exchange; the sidebar shows no agent on plico; and the store holds:
source별: {'claude': 3}
No codex entry at all, while every other Codex session kept running (snowboarder-app ×2, hyeonho ×4, plico ×1, sideby ×1).
The daemon
Every Codex TUI carries the pane key of the pane it was launched in:
pid=13940 ppid=13575 (zsh) cwd=sideby key=a1da984f…
pid=20584 ppid=20250 (zsh) cwd=snowboarder-app key=58aedee0…
pid=56677 ppid=56297 (zsh) cwd=plico key=ab4e6efe…
The daemon does not:
pid=73875 ppid=1 cwd=snowboarder-app key=65f6c734… codex app-server daemon pid-update-loop
pid=73940 ppid=73875 cwd=snowboarder-app key=65f6c734… codex app-server --listen unix:// --managed-daemon
pid=57979 ppid=73940 cwd=snowboarder-app key=65f6c734… codex-code-mode-host
65f6c734… is one Codex tab in snowboarder-app — the first session that needed the daemon. ppid=1 is the point: it outlived its spawning shell and now serves every session with that key frozen in its environment.
Watching the single stored codex row over a few hours, its providerSession kept changing while paneKey, tabId and worktreeId stayed frozen:
| observed | paneKey / worktreeId |
providerSession → rollout cwd |
|---|---|---|
| 17:32 | snowboarder-app | the reply belonged to the sideby session |
| 22:06 | snowboarder-app | 01a0e6f6… → /Users/hyeonho/Develop/plico |
| 22:35 | snowboarder-app | 01a0e83a… → /Users/hyeonho/Develop/snowboarder-app |
| 23:25 | snowboarder-app | 01a0e865… → a session started in a different workspace |
The 22:06 row is the clearest: a single stored status whose pane says one workspace and whose provider session, resolved through its own transcriptPath, says another.
Why the existing guard does not catch it
src/shared/agent-status-identity.ts already knows about inherited pane keys — its comment says "child agent CLIs inherit ORCA_PANE_KEY from their parent terminal" — but the check is an agent-type comparison:
if (!args.existing || !existingAgentType || existingAgentType === incomingAgentType) {
return { agentType: incomingAgentType, inheritedFromActivePane: false }
}A Codex daemon reporting onto a Codex pane passes straight through, so shouldSuppressInheritedTerminalStatus never sees it. The guard was built for a different agent nesting inside a pane, not for one shared daemon serving many panes of the same agent.
The disappearing case follows from the same key: once the inherited pane is retired, the rows are addressed to something that no longer accepts them — ingestTerminalStatus returns early on getAgentStatusDisposition(paneKey) !== 'accept', and indexAgentStatusRowsByPaneKey drops rows it cannot address.
Where a fix could sit
The payload already carries what is needed to re-bind: providerSession.id and its transcriptPath. The server also has a precedent for re-keying a row by a stronger identity — ingestTerminalStatus follows terminalHandle through getStatusPaneKeyForTerminalHandle and calls transferPaneAuthority when it disagrees with the reported pane (server/server-ingest-terminal.ts, server/server-row-ownership.ts). #11158 applies the same principle in automations: attribute by agent session, not only by paneKey.
So: index providerSession.id → paneKey where Orca still knows both — it stamps exactly that pair when it launches a structured session (orca-runtime-structured-agent-session-launch-tui.ts passes providerSession: { key: 'session_id', id } alongside the terminal's paneKey/tabId/handle) — and prefer that binding over a reported pane key that contradicts it.
One case that does not cover: a session started by typing codex in a terminal, where Orca never learns the session id except from the first status event, which is itself mis-keyed. The rollout file's cwd identifies the workspace and could seed the binding, but that is a design call rather than something the data forces.
Related
- [Bug]: Claude Code >=2.1.206 shared daemon breaks agent-status pane attribution — hooks inherit the daemon's stale ORCA_PANE_KEY #9236 / fix(agent-status): follow daemon-hosted Claude sessions to their true pane (spawn pin + fork lineage + prompt-time rebind) #9237 — the same mechanism reported for Claude's daemon, and the fix attempt for it. [Bug]: Claude Code >=2.1.206 shared daemon breaks agent-status pane attribution — hooks inherit the daemon's stale ORCA_PANE_KEY #9236 is closed and its mechanism stopped reproducing there; this is the Codex instance, which reproduces on v1.4.215 today.
- fix(mobile): keep the foreground transcript when a nested CLI inherits the pane #22866 — a nested CLI inheriting the foreground pane's key. Adjacent, but that is one CLI spawning another inside a pane, not a detached daemon serving many.
- Mobile: Codex conversation transcript does not display #13494 — Codex chat view renders empty on mobile. Possibly downstream of the same session/pane confusion; filed separately.
I have this reproducing on a live host and am happy to open the PR for the binding described above if that scope looks right.
Activity
maxmilian commentedon Sep 28, 2026
This looks like the same mechanism #23411 (OrcaWin, open) addresses — the shared Codex app-server daemon runs Orca's hook script while still carrying the first pane's env, and #23411 makes the hook detect the shared daemon and re-attribute by session cwd / live Codex panes instead. #23517 reports the same symptom on Windows + WSL with Codex 0.157. Linking so they can be verified together.
AmethystLiang commentedon Sep 28, 2026
looking into it
jrmougan commentedon Sep 29, 2026
Also reproducing on Linux with the latest versions — here the daemon carries no Orca env at all, so it's the "gone" row of the table: no Codex session reaches Orca.
Environment
codex app-server --listen unix:// --managed-daemon)Observations
~/.codex/hooks.jsonpoints every event at~/.orca/agent-hooks/codex-hook.sh, and all hooks are trusted inconfig.toml.ORCA_*variables (tr '\0' '\n' < /proc/<daemon-pid>/environ | grep -c ^ORCA_→0).~/.config/orca/agent-hooks/last-status.jsonholds onlyclaudeentries and nocodexentries, even though there were 3 Codex sessions that day (3 rollout files under~/.codex/sessions/).~/.config/orca/agent-hooks/spool/doesn't exist, so the hook exits early (noORCA_PANE_KEY) without even spooling.This matches the mechanism described here and in #11941 / #23767. Workaround I'm about to try: launch Codex in Orca panes with
codex --no-daemon, so hooks inherit the pane env. I'll report back if it doesn't help. Looking forward to #23411.maxmilian commentedon Sep 30, 2026
A caveat on my earlier link to #23411, since your Linux case is the one it doesn't reach. At #23411's current head (
e6fc5ab), the shared-daemon detection incodex-hook-script.tsis gated on the stamp being present —[ -n "${ORCA_PANE_KEY:-}" ] && orca_ancestor_depth=0 || orca_ancestor_depth=4— and the existing early exit is unchanged: ifORCA_AGENT_HOOK_PORT,ORCA_AGENT_HOOK_TOKENorORCA_PANE_KEYis empty, the script spools and exits before posting. The endpoint-file refresh doesn't help either, since it's only read whenORCA_AGENT_HOOK_ENDPOINTis set, and it doesn't carry a pane key. So a daemon with noORCA_*env at all, like yours, still exits there with the PR applied.#23411 fixes the "alive" rows (a daemon carrying the wrong pane's stamp); the "gone" row with an env-less daemon needs a separate way for the hook to find the Orca endpoint. cc @OrcaWin @AmethystLiang in case that's worth covering in the same PR or tracking separately.
nwparker commentedon Nov 26, 2026
This looks fixed on current main by #23900, #23907, #23933. Hooks were misattributed because the shared Codex app-server daemon kept the first pane's ORCA_PANE_KEY. Orca now launches Codex with --no-daemon, so each pane runs its own server; sharing only happens if the user opts in (#23929) or passes agents/queue/--remote.
Closing as fixed. If you still see this on the latest release, please reopen with your Orca version and steps, and we'll take another look.