orca icon indicating copy to clipboard operation
orca copied to clipboard

[Bug]: WSL OMP status env is injected but the managed extension is not loaded

Open euclodius opened this issue 5 months ago • 4 comments

Operating system

Windows + WSL (Ubuntu 24.04)

Orca version

1.4.114

Details

Follow-up to #6916 / #6974.

Problem or use case: #6974 fixed the WSL environment forwarding part of OMP live status, but OMP still does not appear to load Orca's managed status extension in this WSL UI-launch path. As a result, the OMP row in the sidebar remains neutral/gray while OMP is actively working.

Environment:

  • Windows + WSL / Ubuntu 24.04
  • OMP installed in WSL
  • omp/16.2.12
  • OMP launched from the Orca UI in a WSL worktree

Observed behavior after #6974: The live omp process now has the expected Orca status environment:

ORCA_OMP_STATUS_EXTENSION=/mnt/c/Users/<user>/.omp/agent/extensions/orca-agent-status.ts
ORCA_PANE_KEY=<pane-key>
ORCA_AGENT_HOOK_PORT=<port>
WSLENV=...:ORCA_PANE_KEY/u:...:ORCA_AGENT_HOOK_PORT/u:...:ORCA_OMP_SOURCE_AGENT_DIR/p:ORCA_OMP_STATUS_EXTENSION/p:...

So WSL env injection appears to be working.

However, inspecting the live omp process command line shows that OMP is still launched without an explicit extension argument:

argv0=omp
extension_args=NONE

The managed extension file exists at the ORCA_OMP_STATUS_EXTENSION path and is readable from WSL, but it is under the Windows-side OMP agent directory while the WSL process has a Linux home:

ORCA_OMP_STATUS_EXTENSION=/mnt/c/Users/<user>/.omp/agent/extensions/orca-agent-status.ts
ORCA_OMP_SOURCE_AGENT_DIR=/mnt/c/Users/<user>/.omp/agent
HOME=/home/dev

There is no WSL-side extension directory at:

/home/dev/.omp/agent/extensions

Expected behavior: OMP launched by Orca in a WSL worktree should actually load Orca's managed status extension, and live working/waiting/done status should update in the sidebar while OMP is active.

Possible fix direction: Orca may need to launch OMP with an explicit extension argument, for example:

omp --extension "$ORCA_OMP_STATUS_EXTENSION"

or otherwise ensure that OMP loads that exact managed extension path in the WSL launch path.

Notes: A retest note with the same evidence was added to the closed #6916 and merged #6974, but #6916 remained closed, so opening this as a narrower follow-up focused specifically on the remaining extension-loading gap.

euclodius avatar Jul 02 '26 08:07 euclodius

Additional test case that seems related to this OMP live-status/idle tracking issue.

Retested on v1.4.123 with Windows 11 + WSL2 Ubuntu:

  • OMP launched in a WSL worktree still does not show live working status in the sidebar.
  • Creating an OMP worker via orca-ide terminal create --worktree 'path:<wsl-unc-repo-path>' --command "omp" --json now creates a recognized/native OMP agent tab.
  • Sequential orchestration dispatch --inject calls to that OMP worker work and can return worker_done.

However, plain orchestration inbox delivery does not appear to reach OMP:

orca-ide orchestration send \
  --to <omp-worker-handle> \
  --subject "Inbox smoke" \
  --body "If you see this, reply to this message." \
  --json

A later check --all for the worker handle shows the message still unread and undelivered:

{
  "read": 0,
  "delivered_at": null
}

The OMP agent never sees/reacts to the message. Since push-on-idle delivery depends on Orca observing agent idle/status transitions, this looks like a useful regression test for the same underlying WSL OMP status-extension/load path.

Related: #7377

euclodius avatar Jul 05 '26 08:07 euclodius

Follow-up: I opened a separate v1.4.124 regression issue because the symptom got worse after the update: OMP agents in a WSL worktree no longer appear in the left worktree sidebar at all, even though terminal creation, pane identity, and Orca-managed env injection all look correct. See #7565.

euclodius avatar Jul 06 '26 10:07 euclodius

Correction / narrowed diagnosis from the newer #7565 investigation.

This may not primarily be an "extension not loaded" problem. In the tested Windows + WSL setup:

  • OMP 16.3.10 was launched with --extension /mnt/c/Users/<user>/.omp/agent/extensions/orca-agent-status.ts.
  • The running OMP process had the expected Orca env: ORCA_OMP_STATUS_EXTENSION, ORCA_PANE_KEY, ORCA_TERMINAL_HANDLE, ORCA_AGENT_LAUNCH_TOKEN, ORCA_AGENT_HOOK_PORT, ORCA_AGENT_HOOK_TOKEN, etc.
  • A separate local smoke confirmed that this extension file can emit /hook/omp events when pointed at a reachable HTTP server.

The failing piece appears to be transport: from WSL, posting to http://127.0.0.1:${ORCA_AGENT_HOOK_PORT}/hook/omp fails with connection refused / HTTP 000, while sending the same payload through Windows curl.exe returns 204. After the successful Windows-side POST, OMP appears/updates in the sidebar.

So WSL OMP status can be fully configured but still unable to reach Orca's Windows-side hook receiver because the injected endpoint effectively points at WSL localhost from the agent process's perspective.

Detailed repro/evidence is in #7565.

euclodius avatar Jul 06 '26 12:07 euclodius

More precise follow-up after the #7565 diagnostics: this issue title is still relevant, but the failure mode is now clearer.

In the tested Windows + WSL setup, a normal OMP launch from Orca UI has the expected status env:

ORCA_OMP_STATUS_EXTENSION=<Windows-mounted path>/orca-agent-status.ts
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>

However, the running process argv is:

omp

not:

omp --extension <orca-agent-status.ts>

OMP 16.3.10 exposes --extension / --hook in omp --help, and it also has a persistent config key:

extensions:
  - <path-to-extension>

When I added Orca's status extension to the OMP user config:

# ~/.omp/agent/config.yml
extensions:
  - <Windows-mounted path>/orca-agent-status.ts

new OMP sessions started emitting actual hook events. With a WSL-local relay bridging the loopback transport problem from #7565, the hooks reached Orca and the OMP agent appeared/updated in the sidebar.

The successful hook sequence looked like:

/hook/omp before_agent_start -> 204
/hook/omp agent_start        -> 204
/hook/omp message_end        -> 204
/hook/omp agent_end          -> 204

So there are two separate pieces:

  • This issue: ORCA_OMP_STATUS_EXTENSION being present in env is not enough for OMP to load the extension. Orca likely needs to pass --extension <path> or register the extension in OMP's supported config.
  • #7565: after the extension is actually loaded, WSL still needs a reachable hook endpoint; direct WSL 127.0.0.1:${ORCA_AGENT_HOOK_PORT} does not reach the Windows-side receiver in my setup.

A useful regression test for this issue specifically would be: launch OMP from the Orca UI in a WSL worktree, inspect the process argv/config, and assert that the managed Orca status extension is actually loaded and emits a before_agent_start event before testing transport.

euclodius avatar Jul 06 '26 12:07 euclodius