Client or integration
OpenCodex dashboard
Area
Installation or packaging
Summary
On Windows, ocx tray install registers the entire PowerShell tray invocation
directly under:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
With a normal user-owned global npm prefix, the generated command was 493
characters. Microsoft documents that Run/RunOnce command lines must be no
longer than 260 characters:
https://learn.microsoft.com/windows/win32/setupapi/run-and-runonce-registry-keys
OpenCodex reports the tray as installed and Windows marks the startup entry
enabled, but the tray does not launch after the next Windows sign-in. The proxy
service starts normally; only the tray process/icon is missing.
Expected: ocx tray install creates a Windows startup registration that
reliably starts the tray at sign-in.
Reproduction
-
Install OpenCodex globally in the standard per-user npm prefix:
npm install -g @bitkyc08/opencodex@2.7.41
-
Install the tray:
-
Inspect the generated HKCU Run value. In this environment it was:
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -STA -ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Users\[user]\.opencodex\opencodex-tray.ps1" -BunPath "C:\Users\[user]\AppData\Roaming\npm\node_modules\@bitkyc08\opencodex\node_modules\bun\bin\bun.exe" -CliPath "C:\Users\[user]\AppData\Roaming\npm\node_modules\@bitkyc08\opencodex\src\cli\index.ts" -CodexHome "C:\Users\[user]\.codex" -OpenCodexHome "C:\Users\[user]\.opencodex" -Mode Run
Length: 493 characters.
-
Restart Windows and sign in.
-
Observe that the OpenCodex proxy service is healthy, but the tray icon is
absent and ocx tray status --json reports:
{"supported":true,"installed":true,"running":false,"stale":false,"summary":"installed, not currently running"}
-
The HKCU Run value still matches tray-state.json, and
Explorer\StartupApproved\Run contains the enabled value
020000000000000000000000. No tray PowerShell process exists, and the
heartbeat is left over from the previous session.
-
Starting the tray manually works, confirming that the tray script itself is
functional and the failure is specifically login persistence.
Version
opencodex 2.7.41
Operating system
Windows 10 Pro x64, build 19045
Provider and model
Not provider-specific.
Logs or error output
Tray API: installed=true, running=false, stale=false
Run command length: 493
StartupApproved: 020000000000000000000000
Heartbeat PID: no longer running
Matching opencodex-tray.ps1 process count: 0
Proxy /healthz: healthy
Suggested fix / validated mitigation
Register a short owned launcher instead of the full PowerShell command. For
example:
"C:\WINDOWS\System32\wscript.exe" //B //NoLogo "C:\Users\[user]\.opencodex\opencodex-tray.vbs"
This replacement was 94 characters. The VBS launcher invoked the existing
PowerShell command invisibly. After adding launcherPath and the matching short
runCommand to tray-state.json, launching through the actual registered VBS
path produced a fresh heartbeat and ocx tray status --json reported:
{"supported":true,"installed":true,"running":true,"stale":false,"summary":"installed and running"}
The current tray state schema already supports an optional launcherPath, and
the installer contains cleanup logic for an older owned VBS launcher, so this
may be a regression from an earlier launcher-based design.
It would also be useful for the installer/tests to assert that a generated
HKCU Run command does not exceed 260 characters under long Windows user/npm
paths.
Checks
Client or integration
OpenCodex dashboard
Area
Installation or packaging
Summary
On Windows,
ocx tray installregisters the entire PowerShell tray invocationdirectly under:
With a normal user-owned global npm prefix, the generated command was 493
characters. Microsoft documents that Run/RunOnce command lines must be no
longer than 260 characters:
https://learn.microsoft.com/windows/win32/setupapi/run-and-runonce-registry-keys
OpenCodex reports the tray as installed and Windows marks the startup entry
enabled, but the tray does not launch after the next Windows sign-in. The proxy
service starts normally; only the tray process/icon is missing.
Expected:
ocx tray installcreates a Windows startup registration thatreliably starts the tray at sign-in.
Reproduction
Install OpenCodex globally in the standard per-user npm prefix:
Install the tray:
Inspect the generated HKCU Run value. In this environment it was:
Length: 493 characters.
Restart Windows and sign in.
Observe that the OpenCodex proxy service is healthy, but the tray icon is
absent and
ocx tray status --jsonreports:{"supported":true,"installed":true,"running":false,"stale":false,"summary":"installed, not currently running"}The HKCU Run value still matches
tray-state.json, andExplorer\StartupApproved\Runcontains the enabled value020000000000000000000000. No tray PowerShell process exists, and theheartbeat is left over from the previous session.
Starting the tray manually works, confirming that the tray script itself is
functional and the failure is specifically login persistence.
Version
opencodex 2.7.41Operating system
Windows 10 Pro x64, build 19045
Provider and model
Not provider-specific.
Logs or error output
Tray API: installed=true, running=false, stale=false Run command length: 493 StartupApproved: 020000000000000000000000 Heartbeat PID: no longer running Matching opencodex-tray.ps1 process count: 0 Proxy /healthz: healthySuggested fix / validated mitigation
Register a short owned launcher instead of the full PowerShell command. For
example:
This replacement was 94 characters. The VBS launcher invoked the existing
PowerShell command invisibly. After adding
launcherPathand the matching shortrunCommandtotray-state.json, launching through the actual registered VBSpath produced a fresh heartbeat and
ocx tray status --jsonreported:{"supported":true,"installed":true,"running":true,"stale":false,"summary":"installed and running"}The current tray state schema already supports an optional
launcherPath, andthe installer contains cleanup logic for an older owned VBS launcher, so this
may be a regression from an earlier launcher-based design.
It would also be useful for the installer/tests to assert that a generated
HKCU Run command does not exceed 260 characters under long Windows user/npm
paths.
Checks