Skip to content

fix(windows): recognize Japanese Task Scheduler states - #8959

Open
grayfoxey wants to merge 1 commit into
lidge-jun:devfrom
grayfoxey:codex/windows-ja-task-state
Open

grayfoxey wants to merge 1 commit into
lidge-jun:devfrom
grayfoxey:codex/windows-ja-task-state

Conversation

@grayfoxey

@grayfoxey grayfoxey commented Nov 19, 2026 •

Copy link
Copy Markdown

Summary

  • 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.

Related to #8863.

Verification

  • 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.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • 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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

Commits

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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • 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

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as ready for review November 19, 2026 12:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant