Client or integration
Codex CLI
Area
Service lifecycle
Summary
On Windows, running ocx service while the Task Scheduler service is ALREADY installed and running fails with WINDOWS_SCHTASKS_CREATE_ACCESS_DENIED instead of refreshing/restarting the existing service. The bare ocx service path unconditionally goes through install (schtasks /create /f), which requires elevation, so a routine dogfooding restart (update source, then ocx service) dies on UAC even though nothing about the registration needs to change.
Expected behavior: when the service is already installed, ocx service (no subcommand) should take the repair/restart path that ocx service repair provides (no admin re-prompt), or at minimum detect the existing registration and fall back to repair instead of failing with an access-denied error. Additionally there is no ocx service restart subcommand, which is the verb an operator reaches for first; the usage line offers install|repair|start|stop|status|uninstall|remove.
Reproduction
- On Windows, install the background service once (elevated):
ocx service -> approve UAC. Service runs fine (ocx service status reports Task Scheduler enabled, proxy on port 10100).
- Update the source checkout the service points at (dogfooding path:
git pull on dev).
- From a NON-elevated PowerShell, run
ocx service to pick up the new code.
- Observe the failure below; the service is not restarted.
ocx service restart is rejected as an unknown subcommand.
ocx service repair is the documented no-admin path, but the bare ocx service invocation (which the CLI describes as "installs/updates and starts the background service") does not route an already-installed service to it.
Version
2.27.0 (local dev checkout, service installed via Task Scheduler)
Operating system
Windows 11
Provider and model
No response
Logs or error output
PS C:\Users\super> ocx service
[X] Service install cleanup failed: Windows access denied while running Task Scheduler. Command: schtasks /create /tn opencodex-proxy /xml C:\Users\super\.opencodex\opencodex-service-task.xml /f Approve the Windows UAC prompt to install the background service, or run `ocx service install` from an elevated PowerShell window.
OCX_ERROR_CODE=WINDOWS_SCHTASKS_CREATE_ACCESS_DENIED
PS C:\Users\super> ocx service restart
Usage: ocx service [install|repair|start|stop|status|uninstall|remove] [--native|--scheduler]
With no subcommand, installs/updates and starts the background service.
repair: refresh assets and restart an already-installed service (no admin re-prompt).
Screenshots and supporting files
No response
Redacted configuration
No response
Checks
Client or integration
Codex CLI
Area
Service lifecycle
Summary
On Windows, running
ocx servicewhile the Task Scheduler service is ALREADY installed and running fails withWINDOWS_SCHTASKS_CREATE_ACCESS_DENIEDinstead of refreshing/restarting the existing service. The bareocx servicepath unconditionally goes through install (schtasks /create /f), which requires elevation, so a routine dogfooding restart (update source, thenocx service) dies on UAC even though nothing about the registration needs to change.Expected behavior: when the service is already installed,
ocx service(no subcommand) should take the repair/restart path thatocx service repairprovides (no admin re-prompt), or at minimum detect the existing registration and fall back to repair instead of failing with an access-denied error. Additionally there is noocx service restartsubcommand, which is the verb an operator reaches for first; the usage line offersinstall|repair|start|stop|status|uninstall|remove.Reproduction
ocx service-> approve UAC. Service runs fine (ocx service statusreports Task Scheduler enabled, proxy on port 10100).git pullondev).ocx serviceto pick up the new code.ocx service restartis rejected as an unknown subcommand.ocx service repairis the documented no-admin path, but the bareocx serviceinvocation (which the CLI describes as "installs/updates and starts the background service") does not route an already-installed service to it.Version
2.27.0 (local
devcheckout, service installed via Task Scheduler)Operating system
Windows 11
Provider and model
No response
Logs or error output
Screenshots and supporting files
No response
Redacted configuration
No response
Checks