Client or integration
Codex CLI
Area
Service lifecycle
Summary
On Windows, a fresh ocx service install can create the opencodex-proxy Scheduled Task, then reject it as unhealthy and roll it back when the Windows user-profile path contains non-ASCII characters.
Expected: the valid task passes post-create verification and remains registered.
Actual: the install command rolls back the new task.
Reproduction
- Use a Windows account whose profile directory name contains non-ASCII characters.
- Install OpenCodex globally with
npm install -g @bitkyc08/opencodex.
- Run
ocx service install.
- Observe that
opencodex-proxy is created and then rolled back.
Diagnostic result: querying the task with schtasks /query /tn opencodex-proxy /xml returns the expected launcher path when its native output bytes are decoded directly. In contrast, the runFile() path used by src/service.ts supplies text that has already undergone code-page conversion, corrupting the non-ASCII part of <Arguments>. The subsequent task-registration health comparison fails.
A narrowly scoped code change that resolves the issue is to use Bun.spawnSync({ cmd: [windowsSchtasks(), ...args] }) only for /xml task queries, then pass Buffer.from(result.stdout) to decodeSchtasksOutput(); retain the existing runFile() fallback for all other queries.
Version
2.37.0
Operating system
Windows 11 24H2 (x64)
Provider and model
Not applicable; this occurs before any provider request.
Logs or error output
ocx service install
Service install cleanup failed: Task Scheduler registration was created but failed the OpenCodex action/trigger or attempt-ownership verification. The invalid registration was rolled back.
The exact local profile path has been intentionally redacted.
Screenshots and supporting files
None.
Redacted configuration
No provider or routing configuration is required to reproduce. This is a default global npm installation followed by ocx service install.
Checks
Client or integration
Codex CLI
Area
Service lifecycle
Summary
On Windows, a fresh
ocx service installcan create theopencodex-proxyScheduled Task, then reject it as unhealthy and roll it back when the Windows user-profile path contains non-ASCII characters.Expected: the valid task passes post-create verification and remains registered.
Actual: the install command rolls back the new task.
Reproduction
npm install -g @bitkyc08/opencodex.ocx service install.opencodex-proxyis created and then rolled back.Diagnostic result: querying the task with
schtasks /query /tn opencodex-proxy /xmlreturns the expected launcher path when its native output bytes are decoded directly. In contrast, therunFile()path used bysrc/service.tssupplies text that has already undergone code-page conversion, corrupting the non-ASCII part of<Arguments>. The subsequent task-registration health comparison fails.A narrowly scoped code change that resolves the issue is to use
Bun.spawnSync({ cmd: [windowsSchtasks(), ...args] })only for/xmltask queries, then passBuffer.from(result.stdout)todecodeSchtasksOutput(); retain the existingrunFile()fallback for all other queries.Version
2.37.0
Operating system
Windows 11 24H2 (x64)
Provider and model
Not applicable; this occurs before any provider request.
Logs or error output
The exact local profile path has been intentionally redacted.
Screenshots and supporting files
None.
Redacted configuration
No provider or routing configuration is required to reproduce. This is a default global npm installation followed by
ocx service install.Checks