You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(windows): recognize Japanese Task Scheduler states - #8959
On Japanese Windows, schtasks /query /fo CSV /nh reports a ready task as 準備完了. The checked stop treats that value as unknown and falls back to Get-ScheduledTask, which can exceed the 1 s manager-state budget. On 2.100.5 this caused ocx service install to roll back its new Task Scheduler registration.
Recognize the four status values observed in the Japanese Windows CSV output and System32/ja-JP/schtasks.exe.mui. 準備完了 (Ready) and 無効 (Disabled) prove inactivity. 実行中 (Running) and キューに登録済み (Queued) remain active because a queued task can start after the check.
bun test tests/windows/windows-checked-stop-live.test.ts -t 'ja-JP task state' on the unpatched dev parser: all four new regression cases reproduced the unwanted PowerShell fallback.
bun test tests/windows/windows-checked-stop-live.test.ts tests/windows/windows-checked-stop.test.ts tests/windows/windows-scheduler-install-verification.test.ts: 102 passed, 0 failed on Windows with Bun 1.4.4.
bun run typecheck and git diff --check: passed.
On ja-JP Windows, read the live CSV through this branch's windowsCheckedStopLiveDeps().taskState(1000). A ready task returned not-running in 842 ms and the running OpenCodex task returned running in 676 ms, both via schtasks alone. The earlier local package fix also allowed ocx service install to complete with /healthz returning 200.
bun run structure:check and bun run privacy:scan: passed.
bun run test:changed was stopped after 281 s without a completed result. Its output showed a Bun worker waiting on the test run's user lock. The full suite was omitted as disproportionate for a locale-only parser change. The focused Windows suites above cover the changed post-stop status check and the related stop and install checks. Broader import-graph and cross-platform coverage remains with repository CI.
Checklist
Scope stays focused and avoids unrelated cleanup.
Docs or release notes were updated when needed.
Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
Bug Fixes
Windows task status checks now recognize additional Japanese and Korean status labels, improving running-state detection on localized systems.
Documentation
Updated guidance to describe supported localized status labels and when status checks may use an alternate method.
No actionable comments were generated in the recent review.
Walkthrough
The checked-stop status parser now recognizes Japanese running, queued, ready, and disabled Task Scheduler statuses. Tests cover the four Japanese values. Documentation describes the locale fallback behavior and cites the cold-query timing.
Changes: Localized Task Scheduler statuses
Layer / File(s)
Summary
Japanese status recognition src/service/windows-checked-stop-live.ts, tests/windows/windows-checked-stop-live.test.ts, structure/ops/windows-checked-stop.md
The active and not-running status sets add Japanese values at lines 130–131. Tests at lines 192–207 verify all four classifications and the schtasks CSV query arguments. The documentation at lines 144–146 describes recognized locale words, fallback behavior, and the cold-query timing. The parser comment at lines 125–127 identifies ja-JP and ko-KR as observed status-word sources.
lidge-jun/opencodex#8870: Adds zh-CN and ko-KR status words to the same TASK_CSV_ACTIVE and TASK_CSV_NOT_RUNNING sets.
lidge-jun/opencodex#8573: Wires the checked Windows stop and scheduler probe into stop paths; the classification changed here is consumed by that flow.
Merge Risk: Minimal · up to 40e67
This change lets Japanese Windows systems classify Task Scheduler states from the fast schtasks query instead of falling back to the slower PowerShell path. No concrete merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(windows): recognize Japanese Task Scheduler states" matches the main change: the parser now recognizes Japanese schtasks status words (準備完了, 無効, 実行中, キューに登録済み) and maps them to running …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(windows): recognize Japanese Task Scheduler states" matches the main change: the parser now recognizes Japanese schtasks status words (準備完了, 無効, 実行中, キューに登録済み) and maps them to running or not-running. The raw summary also shows Korean status values and a docs update, which the title does not mention, but this is a secondary aspect and the title does not misrepresent the change. The title is concise, specific, and follows the conventional-commit style.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 1b5f65f and 40e67cc.
Files selected for processing: 3
src/service/windows-checked-stop-live.ts
structure/ops/windows-checked-stop.md
tests/windows/windows-checked-stop-live.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
all PR quality gates passed; the review readiness checklist is complete.
Review readiness checklist
✅ Required local validation passed; commands, results, and any full-suite exception are documented.
✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
✅ I resolved all correct Codex and CodeRabbit findings.
✅ My PR is ready for review.
✅ 4/4 boxes ticked.
This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers: @lidge-jun@Ingwannu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
schtasks /query /fo CSV /nhreports a ready task as準備完了. The checked stop treats that value as unknown and falls back toGet-ScheduledTask, which can exceed the 1 s manager-state budget. On 2.100.5 this causedocx service installto roll back its new Task Scheduler registration.System32/ja-JP/schtasks.exe.mui.準備完了(Ready) and無効(Disabled) prove inactivity.実行中(Running) andキューに登録済み(Queued) remain active because a queued task can start after the check.Related to #8863.
Verification
bun test tests/windows/windows-checked-stop-live.test.ts -t 'ja-JP task state'on the unpatcheddevparser: all four new regression cases reproduced the unwanted PowerShell fallback.bun test tests/windows/windows-checked-stop-live.test.ts tests/windows/windows-checked-stop.test.ts tests/windows/windows-scheduler-install-verification.test.ts: 102 passed, 0 failed on Windows with Bun 1.4.4.bun run typecheckandgit diff --check: passed.ja-JPWindows, read the live CSV through this branch'swindowsCheckedStopLiveDeps().taskState(1000). A ready task returnednot-runningin 842 ms and the running OpenCodex task returnedrunningin 676 ms, both viaschtasksalone. The earlier local package fix also allowedocx service installto complete with/healthzreturning 200.bun run structure:checkandbun run privacy:scan: passed.bun run test:changedwas stopped after 281 s without a completed result. Its output showed a Bun worker waiting on the test run's user lock. The full suite was omitted as disproportionate for a locale-only parser change. The focused Windows suites above cover the changed post-stop status check and the related stop and install checks. Broader import-graph and cross-platform coverage remains with repository CI.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit