webui: re-exec a relative Console launch with its absolute script path (#1873) #1876

Merged
jason.woltje merged 2 commits from org-reqget-2 into refactor 2026-11-09 18:57:29 +00:00
Owner

Fixes "Request status unavailable" when the Console is started as node packages/webui/src/cli.mjs serve ... with a relative script path.

Cause: packages/bus/src/principal.mjs checks that the parent cmdline argv[1] is the absolute same-tree Console path. A relative launch kept the relative spelling, so every request read against an org bus came back human-required.

Fix: on Linux, packages/webui/src/cli.mjs reads /proc/self/cmdline at load; a relative script re-execs once with the same node, execArgv, arguments and environment, and the absolute path. PID, parent, uid and the agent marker are unchanged. The second commit skips Node's -- delimiter (Sol review P3).

Proof:

  • console-relative-launch.test.mjs red on edec4e1d0, green here (2/0). The delimiter case is red on 744753d7e (2 loads vs 1) and green on 791791360.
  • Sol review: APPROVE 0/0/1, 115/0 across 14 files plus a 19-case launch matrix. The P3 is fixed in 791791360.
  • principal.test.mjs 5/0 on the head.
Fixes "Request status unavailable" when the Console is started as `node packages/webui/src/cli.mjs serve ...` with a relative script path. Cause: `packages/bus/src/principal.mjs` checks that the parent cmdline argv[1] is the absolute same-tree Console path. A relative launch kept the relative spelling, so every request read against an org bus came back human-required. Fix: on Linux, `packages/webui/src/cli.mjs` reads `/proc/self/cmdline` at load; a relative script re-execs once with the same node, execArgv, arguments and environment, and the absolute path. PID, parent, uid and the agent marker are unchanged. The second commit skips Node's `--` delimiter (Sol review P3). Proof: - `console-relative-launch.test.mjs` red on edec4e1d0, green here (2/0). The delimiter case is red on 744753d7e (2 loads vs 1) and green on 791791360. - Sol review: APPROVE 0/0/1, 115/0 across 14 files plus a 19-case launch matrix. The P3 is fixed in 791791360. - `principal.test.mjs` 5/0 on the head.
jason.woltje added 2 commits 2026-11-09 18:57:17 +00:00
Node leaves the -- option delimiter out of process.execArgv, so
'node -- /abs/cli.mjs' picked '--' as the script and re-executed an
already absolute launch, running preloads twice. Review P3 on #1873
reqget-2.
jason.woltje merged commit 7917913606 into refactor 2026-11-09 18:57:29 +00:00
Sign in to join this conversation.