Repository navigation
fix(service): scope Windows scheduler probes to the root task and re-probe deleted registrations - #6401
Conversation
…probe deleted registrations Three probe-scoping defects in the guarded Windows manager proof turned a provable absent verdict into a permanent unknown (approval-changed) or a permanent failed stop: - windowsSchedulerCsvIncludesTask treated a backslash as a name boundary, so a same-named task inside a task folder (\Tools\opencodex-proxy) read as present while every /tn operation resolves a bare name in the root folder only — the bound read/stop then failed on a task nothing could reach. - windowsScheduledTaskState ran Get-ScheduledTask -TaskName without -TaskPath, a folder-agnostic filter that returns foreign task state and arrays. - inspectWindowsSchedulerManager read the registration XML before the state check, so an unreadable registration blocked the absent verdict an inert task does not need; and a task deleted between probes was indistinguishable from an unreadable one. The XML now loads only on the running path, and the unanswerable state/XML reads re-probe presence: proven-gone gets the stray-wrapper inert verdict, persisting or unanswerable stays unknown. observeWindowsGuardedManagerStopped re-probes the same way before failing closed, and proven absence still owes the unreadable former-manager check. Verified live on Windows Server 2022: \DevinProbe\opencodex-proxy exists while schtasks /query /tn, /end and /xml all fail root-scoped, the CSV listing emits "\DevinProbe\opencodex-proxy", and Get-ScheduledTask -TaskName returns the foldered task's state plus arrays for duplicate names. Regression tests pin each failure and the preserved fail-closed cases. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/0 boxes ticked. Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked. |
…90860555-win-scheduler-probe-scope
…90860555-win-scheduler-probe-scope
# Conflicts: # structure/runtime.md
|
Maintainer integration record (MAINTAINERS.md, dev-only)
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 914c05241e
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return io.winTaskProbe().status === "absent" | ||
| ? inertVerdict() |
There was a problem hiding this comment.
Refresh the process snapshot after proving task deletion
When the task starts after the winProcs() snapshot, reports running, and is then deleted before the XML read, this branch returns inertVerdict() using the stale strays array. A deleted registration can still leave its wrapper alive, so the guarded stop can classify the manager as absent, signal only the approved child, and let the surviving wrapper respawn it. Re-read the process list after the absence re-probe before returning absent; the state-unknown re-probe and post-stop paths have the same stale-snapshot issue.
Useful? React with 👍 / 👎.
Summary
\opencodex-proxytask. A same-named task in another folder must not supply presence or state for root-targeted stop operations.Verification
Refreshed from
devat06cc3815c06a10120d89ef986c46be95be37f28awithout rewriting branch history, including the accepted upstream role-route and owner-registry ACL fixture corrections. Targeted verification: role routes 7 passed; owner-registry ACL 6 passed. Required CI passed at3dbd9d8d6ef231729a34113754fbf626008b93b1: zero failed and zero pending checks (platform/path-inapplicable checks remain skipped).Focused Windows tests: 65/65 passed; five regressions failed against the original behavior.
bun run typecheck,bun run structure:check: passed.Full
test:changedexceeded the local Windows 900-second cap; CI remains the full-suite gate.Real registered-Scheduler CLI lifecycle passed on combined
d50be3427with this PR, fix(cli): stabilize guarded-stop re-verification and report the failing guard fact #6402, and fix(service): bound every Windows manager command the guarded stop depends on #6403. On a separate Windows VM with both managers initially absent: installed the root task in an isolated home, verified the wscript → cmd → Bun chain and supported approval, then guarded-stop returnedruntimeDown: truein 49.4s. The task became Ready, the port closed, and all three approved processes exited. Repair/start succeeded; uninstall plus explicitocx stoprestored the absent-manager baseline.WinSW account/password-dependent lifecycle remains untested. This CLI test does not claim native Tauri registered-service takeover coverage.
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.
Link to Devin session: https://app.devin.ai/sessions/a8795b27d4114aa6be37a88565e404b2
Open in Devin Desktop: https://app.devin.ai/desktop/session/a8795b27d4114aa6be37a88565e404b2?variant=devin
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.