[Bug]: Codex launched in a WSL worktree does not appear in agent status/sidebar
Operating system
Windows + WSL (Ubuntu 24.04)
Orca version
1.4.110
Details
Problem or use case:
Codex launched by Orca in a WSL-backed worktree starts successfully and works in the terminal, but it does not appear as a Codex agent in the agent/status sidebar.
Observed behavior:
- Codex TUI launches and is usable.
- The worktree can show terminal activity.
worktree ps --jsoncontinues to reportagents: []for that worktree.- No Codex agent row appears in the sidebar.
- The WSL Orca-managed Codex runtime home did not contain
hooks.json, while the Windows Orca-managed Codex runtime home did. - Fresh Codex processes launched from Orca did not consistently receive the expected Orca/Codex integration env, including
CODEX_HOME,ORCA_CODEX_HOME,ORCA_TERMINAL_HANDLE, andORCA_PANE_KEY.
Expected behavior:
A Codex session launched by Orca in a WSL worktree should appear as a Codex agent row/session and receive status updates through launch metadata or Codex hook/status events.
Notes:
This seems different from “Codex status missing until first user message”. In this case the Codex TUI can be active, but no hook/status entries appear to reach Orca and agents remains empty.
Related issues / PRs:
Related newer WSL agent reports:
- #7563: regular Claude is installed and works inside WSL / Orca-managed WSL terminals, but the GUI agent picker only shows Claude Agent Teams.
- #7565: after v1.4.124, OMP agents launched in WSL no longer appear in the worktree sidebar at all, even though Orca terminal identity and hook env are present.
This Codex issue looks like the same post-launch projection/status side of the broader Windows desktop GUI + WSL runtime problem: the CLI can run inside WSL, but the GUI sidebar/status layer does not reliably recognize or track the agent as a native agent.
It would probably be worth testing Codex, Claude, and OMP in the same WSL-only agent CLI matrix, with the Windows app using WSL as the project runtime.
Additional related finding from the OMP WSL investigation in #7565 / #7091.
For OMP, the sidebar/status failure was narrowed to hook transport: the WSL agent process receives valid Orca hook env, but posting to http://127.0.0.1:${ORCA_AGENT_HOOK_PORT}/hook/omp from inside WSL fails with connection refused. Sending the same payload through Windows curl.exe returns 204, and the agent immediately appears/updates in Orca's sidebar.
If Codex status/sidebar uses the same ORCA_AGENT_HOOK_PORT localhost model for WSL-spawned processes, this issue may have the same root cause: the agent runs in WSL, but the hook receiver is listening on Windows localhost, so agent hook events never reach Orca.
A useful Codex-specific regression test would be: launch Codex in a WSL worktree, inspect the Codex process hook env, then from that WSL shell POST a synthetic Codex hook payload to the injected endpoint and verify that it is reachable and updates the sidebar/status surface without requiring a Windows-side bridge.
Follow-up from additional Codex-specific diagnostics. I was able to make Codex appear in the Orca sidebar in the same Windows + WSL setup, but only after matching Orca's native Codex hook contract and bridging the WSL loopback transport.
Environment:
- Windows desktop Orca app.
- Project runtime: WSL2 Ubuntu.
- Codex CLI installed/running inside WSL.
- Codex launched from Orca's agent picker/combobox in a WSL worktree.
The launched Codex process receives the expected Orca env, for example:
CODEX_HOME=<Orca-managed Codex home>
ORCA_AGENT_HOOK_ENDPOINT=<Orca userData>/agent-hooks/endpoint.cmd
ORCA_AGENT_HOOK_PORT=<port>
ORCA_AGENT_HOOK_TOKEN=<token>
ORCA_PANE_KEY=<tab_uuid>:<leaf_uuid>
ORCA_TERMINAL_HANDLE=<term_handle>
ORCA_AGENT_LAUNCH_TOKEN=<launch_token>
ORCA_WORKTREE_ID=<wsl_unc_worktree_id>
Important payload-format finding
Posting an OMP-like JSON body to /hook/codex can return HTTP 204, but it does not create a Codex status entry in last-status.json and does not update the sidebar.
The working format is Orca's native Codex managed-hook format:
Content-Type: application/x-www-form-urlencoded- form fields:
paneKeytabIdlaunchTokenworktreeIdenvversionpayload=<raw Codex hook JSON>
- the raw payload should keep Codex event names such as
UserPromptSubmit,PreToolUse,PostToolUse, andStop.
For example, the diagnostic hook command that worked was equivalent to posting:
paneKey=<tab_uuid>:<leaf_uuid>
tabId=<tab_uuid>
launchToken=<launch_token>
worktreeId=<wsl_unc_worktree_id>
env=production
version=1
payload={"hook_event_name":"UserPromptSubmit","prompt":"..."}
After switching to that format, Orca wrote a real Codex status cache entry:
{
"hookEventName": "UserPromptSubmit",
"payload": {
"state": "working",
"agentType": "codex"
}
}
and Codex appeared in the worktree sidebar.
Hook installation / CODEX_HOME
For the diagnostic, I placed hooks.json in the Orca-managed Codex home (CODEX_HOME=<Orca-managed Codex home>), not in the user's normal system Codex home. That hook posted the raw Codex hook payload as described above.
If Orca is already supposed to install equivalent managed Codex hooks into the Orca-managed CODEX_HOME, then the remaining failure is likely the WSL transport described in #7565: the Codex hook process runs inside WSL, but the injected endpoint points at Windows localhost.
If those managed Codex hooks are not installed or not trusted in the Orca-managed CODEX_HOME, then Codex can run normally but no native Codex status events will ever be emitted.
Current narrowed conclusion
For Codex to show up as an agent in this Windows desktop + WSL runtime setup, both of these need to be true:
- Codex lifecycle hooks must be installed/active in the Orca-managed
CODEX_HOME, using the native Codex form-encoded hook format and raw Codex hook payload. - The hook endpoint must be reachable from the WSL process. A WSL-local diagnostic relay that forwarded to Windows Orca made the same events work.
This matches the broader WSL hook-transport issue in #7565, but adds a Codex-specific trap: /hook/codex may return 204 for the wrong body shape while still not producing a sidebar/status entry.
Suggested regression test: launch Codex from Orca UI in a WSL worktree, submit a prompt, assert that a native UserPromptSubmit Codex hook reaches the receiver, updates last-status.json with agentType: "codex", and creates/updates the left-sidebar agent row.
Quick cross-link after seeing the new related PRs:
- #7641 and #7642 look like the two OMP-specific fixes: load the OMP status extension in WSL and route loaded OMP/Pi status-extension posts from WSL to the Windows listener.
- #7658 looks like the Codex usage/rate-limit RPC fix for #7567.
I think this issue (#6907) remains a separate Codex agent-status/sidebar case. The local proof from the earlier diagnostics was that Codex only appeared in the sidebar after both conditions were met:
- the payload matched Orca's native Codex hook contract, and
- the WSL -> Windows hook transport was bridged for the Codex hook endpoint.
So fixing OMP's status-extension transport and Codex's usage RPC path may not by itself deliver Codex SessionStart / UserPromptSubmit / Stop hook events to the sidebar when Codex runs inside WSL.
Not asking to block the OMP or usage PRs. I just wanted to make sure this Codex sidebar/status case stays in the Windows desktop + WSL runtime test matrix and is not accidentally considered covered by #7641/#7642/#7658.
Suggested owner proof: Windows desktop app + WSL runtime, Codex installed/running only inside WSL, launch Codex from Orca's agent picker with no local bridge/workaround, then verify that the Codex agent row appears in the worktree sidebar, live status updates, and completion/unread attention works.