Skip to content

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

Merged
lidge-jun merged 3 commits into
lidge-jun:devfrom
grayfoxey:codex/windows-ja-task-state
Nov 21, 2026
Merged

lidge-jun merged 3 commits into
lidge-jun:devfrom
grayfoxey:codex/windows-ja-task-state

Conversation

@grayfoxey

@grayfoxey grayfoxey commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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 status labels, improving task-state detection on Japanese-language systems.
  • Documentation
    • Updated guidance to describe Japanese status labels and when checks may use an alternate method.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

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 these classifications and the schtasks CSV query arguments. Documentation describes the locale fallback and 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. Tests verify all four classifications and the schtasks CSV query arguments. The parser comment identifies ja-JP and ko-KR as observed status-word sources. The documentation describes recognized locales, fallback behavior, and cold-query timing.

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

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · previous review 7ae09

This change lets Windows checked-stop recognize Japanese Task Scheduler states without the slower PowerShell fallback. The edit is small and the fallback behavior for unrecognized statuses is unchanged, so merge risk is minimal.

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 changeset adds Japanese Task Scheduler status words (準備完了, 無効, 実行中, キューに登録済み) to the CSV status mapping …
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 changeset adds Japanese Task Scheduler status words (準備完了, 無効, 実行中, キューに登録済み) to the CSV status mapping in src/service/windows-checked-stop-live.ts, adds tests for them, and updates the related documentation. The title is specific, concise, and follows the conventional-commit style. It does not cover the Korean and zh-CN additions or the documentation timing note, which is expected for a title.

  • 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 40e67cc and 7ae0918.

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

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

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.

0/4 boxes ticked.

Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as ready for review November 19, 2026 12:01
# Conflicts:
#	src/service/windows-checked-stop-live.ts
@github-actions
github-actions Bot marked this pull request as draft November 21, 2026 06:23
@lidge-jun
lidge-jun marked this pull request as ready for review November 21, 2026 06:59
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (per MAINTAINERS.md; maintainer integration, not an independent approval)

  • Exact head: 5c1f9e41f60af589f220fb8546ef549139eaf0cd
  • Checks on this head: 19 passed, 13 skipped, none pending or failing (Ubuntu PR CI; Windows/macOS are covered by the next dev batch gate).
  • Review threads: none unresolved.
  • Review: gpt-6.1-terra, two rounds (reviewed together with fix(windows): recognize Korean disabled and queued task states #8976), final verdict PASS. Queued words stay in the active set; ready and disabled words prove inactivity.
  • Regression: tests/windows/windows-checked-stop-live.test.ts 31 pass on the PR head and 4 fail with src/service/windows-checked-stop-live.ts restored from dev.
  • Reconciled in-house with fix(windows): recognize Korean disabled and queued task states #8976 (merged as c9e9d54ce), which added Korean words to the same two sets: this head (7ae091835 + dev merge 5c1f9e41f) keeps the union of the zh-CN, ko-KR and ja-JP words in the one shared parseTaskCsvState parser, plus both tests and doc paragraphs. On this tree: typecheck clean, structure:check passes, checked-stop and stop-boundary suites 63 pass / 3 skip / 0 fail.
  • Marked ready by the maintainer: the readiness gate moved this back to draft because of those in-house commits.

@lidge-jun
lidge-jun merged commit e97f816 into lidge-jun:dev Nov 21, 2026
34 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T07:03:02.532486Z 5c1f9e4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants