Repository navigation
Description
Client or integration
Other. This is the ocx CLI service lifecycle (ocx update, ocx stop, ocx service stop), not a model provider.
Area
Service lifecycle, on Windows Task Scheduler. WinSW is not installed (sc query opencodex-proxy-native returns 1060).
Summary
On zh-CN Windows, ocx update, ocx stop, and ocx service stop fail closed while ocx service status reports the Task Scheduler service as installed and the proxy as running.
The checked stop (#7771) reads schtasks /query /tn opencodex-proxy /fo CSV /nh, then only accepts the English status words Running, Ready, Disabled, and Queued. zh-CN schtasks.exe.mui emits 正在运行, 就绪, 已禁用, and 已排队. Those decode correctly (this is not the #4691 GBK mojibake bug) and parseTaskCsvState returns unknown.
The intended fallback is Windows PowerShell Get-ScheduledTask, whose .State is the locale-independent enum. That fallback cannot finish. taskState is capped by WINDOWS_STOP_CAPS.managerState (1000 ms) via runCapped in stopWindowsServiceChecked. On this machine the CSV query returns in about 35–50 ms, and the same powershell.exe -NoProfile Get-ScheduledTask path then takes about 1.6 s. At 1000 ms, taskState returns unknown. Part A therefore finishes with evidence-unreadable / "the stop could not be verified".
Every state-unknown result is printed as "The Windows Task Scheduler state could not be read" and tells the operator to run ocx service status. That command uses probeWindowsSchedulerTask, which only checks that the task name is present, so it stays green and does not show this failure.
schtasks /end runs before this read. The message still says nothing unverified was stopped and that the proxy was left running. After one failed ocx update here, the task's last result was 267014 (0x41306, SCHED_S_TASK_TERMINATED) and ports 10100/10101 were not listening. The end had already happened. The failure was the follow-up status read.
Reproduction
Windows 10 Pro 26H2, build 26320.9877, UI culture zh-CN. Package installed globally with npm. Service backend is the opencodex-proxy Task Scheduler task. No WinSW service.
ocx service status→ service installed, proxy running on port 10101.ocx update(2.100.3 → 2.100.4),ocx stop, orocx service stop.
Observed output:
❌ The Windows Task Scheduler state could not be read, so this stop cannot tell whether a wrapper would respawn the proxy.
Run 'ocx service status' to see the query error, repair Task Scheduler access, then retry.
The Windows service or process state could not be read (the stop could not be verified); nothing that could not be verified was stopped.
The proxy was left running and the shared teardown skipped: the service could relaunch it.
opencodex: could not stop the running proxy; aborting the update. Run 'ocx stop' and retry.
ocx service stop ends with:
❌ service stop did not take effect: the Windows service could not be proven stopped (unknown).
The Windows service or process state could not be read (the stop could not be verified); nothing that could not be verified was stopped.
The proxy was left running and native Codex was NOT restored.
Direct check, using the installed decodeWindowsTextBytes path and windowsCheckedStopLiveDeps().taskState:
- CSV status field is
就绪while the task is Ready, and正在运行while it is Running.parseTaskCsvStatereturnsunknownfor both. taskState(1000)returnsunknownin about 1016 ms.taskState(5000)returnsnot-runningin about 1582 ms when the task is Ready. The PowerShell fallback works. The 1 s cap is what drops it.- A warm
Get-ScheduledTaskin PowerShell 7 also took 1399 ms and returnedState=Ready, so this is not specific to one PowerShell edition.
The published parseTaskCsvState in 2.100.4 is still English-only. Recognizing the four zh-CN words from schtasks.exe.mui makes taskState(1000) return running in about 50 ms, and ocx update from 2.100.3 to 2.100.4 can then stop the service and finish. The replacement package restores the English-only parser.
Version
Reproduced on @bitkyc08/opencodex 2.100.3. The same parser and 1000 ms cap are in 2.100.4.
Operating system
Windows 10 Pro 26H2 (build 26320.9877), culture zh-CN.
Provider and model
Not provider-specific.
Logs or error output
Relevant code:
src/service/windows-checked-stop-live.ts:parseTaskCsvStateaccepts only/^running$/iand/^(ready|disabled|queued)$/i.taskStatefalls back topowershell.exe -NoProfile -NoLogo -NonInteractive -Command "(Get-ScheduledTask ...).State".src/service/windows-stop-budget.ts:managerState: 1_000.src/service/windows-checked-stop.ts: an unknowntaskStatesetsunreadable, then returnsfinish("unknown", "evidence-unreadable", "the stop could not be verified").src/cli/index.ts: anyserviceStop === "state-unknown"prints the Task Scheduler read error and points atocx service status.src/cli/stop-windows-checked.ts:describeWindowsPartA/windowsPartAHoldsadd the "could not be read" and "proxy was left running" lines.src/service/windows-scheduler.ts:probeWindowsSchedulerTaskis a presence probe, which is why status succeeds.
Related closed reports, not the same bug: #2914 (localized schtasks text plus a timeout), #4691 (GBK decode of schtasks XML), #7771 (the checked stop this path belongs to).
Suggested fix
- Map the zh-CN
schtasksstatus words before returningunknown. FromSystem32\zh-CN\schtasks.exe.mui:正在运行= Running,就绪= Ready,已禁用= Disabled,已排队= Queued. The CSV query already succeeded, so this does not need another process. Other locales still need a working fallback. - Make that fallback able to finish.
runCapped(clock, C.managerState, deps.taskState)bounds the CSV query and the PowerShell startup together. Raising only the time left insidetaskStatedoes nothing whilemanagerStatestays 1000. A coldpowershell.exestart needs more than 1.6 s here. Either raiseWINDOWS_STOP_CAPS.managerStateto cover it (about 4 s) and the admission budget that includes it, or read theTaskStateenum without starting a full PowerShell runspace. - When Part A detail is
"the stop could not be verified", do not tell the operator that Task Scheduler could not be queried or thatocx service statuswill show the query error. Say the post-stop status read was inconclusive.schtasks /endhas already been issued at that point, so the text should not claim that nothing was stopped.
Checks
- I searched existing issues and the docs. Windows (zh-CN): ocx sync always refuses — localized schtasks output breaks the task-absence probe, and the 2s full-listing fallback times out #2914, [Bug]: decodeSchtasksOutput UTF-8 fallback mangles GBK schtasks output on zh-CN Windows — service repair/install fails with CJK account name #4691, and [Bug][Windows]: desktop 2.92.0 stuck at taking-over when an npm package runtime runs under the Task Scheduler service; ocx stop / service stop do not free the port #7771 are related. I did not find an open report of this 1 s
managerStatefailure. - Logs above have no secrets, tokens, account details, or request credentials.
Activity
coderabbitai commentedon Nov 17, 2026
🔗 Related PRs
#8573 - feat(service): wire the checked Windows stop into every stop path (
#7771slice 2) [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
jundev0001 commentedon Nov 17, 2026
Same failure on ko-KR Windows, on two machines with 2.100.3. Adding data that may affect the fix.
ko-KR status words. Inside
taskStatethe CSV status column is준비(Ready) and실행 중(Running). A zh-CN word table does not cover this locale. The child console code page selects the language: under the sameexecFile(..., { windowsHide: true })options,cmd /d /c "chcp 437 >nul & schtasks /query /tn opencodex-proxy /fo CSV /nh"returns"Running"(chcp 65001also returns"Running"). A locale-independent read like this may be more robust than per-locale word lists.The cold PowerShell fallback time varies widely, so a fixed cap near 1-4 s is fragile.
powershell -NoProfile -Command 1Get-ScheduledTask ... .StatetaskState(1000)unknown3/3running10/10, PowerShell 707-760 ms of a 951-966 ms remainderBoth machines have the same November .NET security updates (KB5132061/KB5132688). On the laptop, the .NET NGEN maintenance task has not run since then because it does not start on battery. Its
powershell.exeloadsSystem.Management.Automation,Microsoft.PowerShell.ConsoleHostandMicrosoft.Management.Infrastructureas IL, not.ni.dll, andngen display System.Management.Automationreports "not installed". The desktop regenerated these native images a few hours after the update. So the desktop passes with only about 0.2 s of margin, and any machine can fail between a .NET update and the next NGEN run.Replay of Part A (
stopWindowsServiceCheckedwith live probes;endTask/terminate/winswStopstubbed so nothing changed):unknown/evidence-unreadable/ "the stop could not be verified"parseTaskCsvStateaccepting the ko-KR words: correct verdict in 2.5 sWINDOWS_STOP_CAPS.managerState = 6000only: correct verdict in 7.9 sSide effect after the failed stop. The update had already ended the task and terminated the bound wrappers. Task last result was
0x41306, the same as in this report. The bun proxy kept running without a wrapper. Then:ocx service statusprinted "service installed (Task Scheduler); OpenCodex proxy not running".ocx statusprinted that the proxy was healthy on the same port.ocx restartrefused with "the running proxy identity could not be attested".ocx updatefailed the same way.Only a reboot (the task's logon trigger) restored a supervised proxy.
fix: R5 platform and test-hygiene lane (zh-CN/ko-KR checked stop, Win…
lidge-jun commentedon Nov 17, 2026
Fixed by #8870, merged into dev as b233a8e (2026-11-17 triage round). PRs target dev, so this is closed manually.