Skip to content

fix(service): bound every Windows manager command the guarded stop depends on - #6403

Merged
lidge-jun merged 3 commits into
devfrom
devin/1790861790-win-bounded-service-execs
Oct 1, 2026
Merged

lidge-jun merged 3 commits into
devfrom
devin/1790861790-win-bounded-service-execs

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Bound Windows manager command execution: 15 seconds for schtasks, sc.exe, and ordinary WinSW verbs; 40 seconds for WinSW stopwait, exceeding its generated 20-second stop timeout.
  • Preserve the existing failure classifications. A timeout throws into unknown/failed; it never establishes that a manager stopped.
  • Interactive winsw install /p remains unbounded because it waits for operator password input. No hung manager was observed in the original native timeout; these bounds address a separate indefinite-hang exposure.

Verification

  • Refreshed from dev at 06cc3815c06a10120d89ef986c46be95be37f28a without 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 at e6bf0bae23bcf3ee5715002330bb002df2e61188: zero failed and zero pending checks (platform/path-inapplicable checks remain skipped).

  • bun test tests/windows/: 497/498 passed. The hung-tray-probe test also failed on clean dev on the same machine.

  • bun x tsc --noEmit, bun run structure:check: passed. Source-level regressions pin timeout wiring and the interactive exception.

  • Full test:changed exceeded the local Windows 900-second cap; CI remains the full-suite gate.

  • Real registered-Scheduler CLI lifecycle passed on combined d50be3427 with fix(service): scope Windows scheduler probes to the root task and re-probe deleted registrations #6401 and fix(cli): stabilize guarded-stop re-verification and report the failing guard fact #6402. Starting from absent Scheduler/WinSW registrations, installation and exact runtime approval succeeded; guarded stop completed in 49.4s, returned runtimeDown: true, left the task Ready, and removed its complete approved wrapper/proxy chain. Repair/start succeeded; uninstall plus explicit ocx stop restored the absent-manager baseline.

  • No deliberately wedged SCM/Scheduler was induced. WinSW account/password-dependent lifecycle remains untested.

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.

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.

…pends on

Every execFileSync a Windows verdict or stop relies on ran without a timeout:
all schtasks operations via runFile (/query, /end, /delete, /create, /xml),
WinSW verbs including stopwait, and every sc.exe query/qc/stop/delete. A wedged
Task Scheduler or Service Control Manager service would hang the CLI forever
inside a guarded stop — observed natively as the bundled stop blowing the
desktop takeover deadline while sibling probes (PowerShell, wrapper kill) are
already bounded.

Bounds: 15s for SCM round-trips and schtasks operations (all sub-second on a
healthy system, far under the app's startup budget); 40s for WinSW stopwait so
it outlasts the SCM <stoptimeout> (20s) in the generated service definition.
The interactive install /p call stays unbounded by design — it waits on the
operator's password input. A killed command throws into the same unreadable/
failed/unknown classification a nonzero exit would, so no verdict weakens.

Source-level regressions pin the contract: every execFileSync in winsw.ts is
bounded except the inherited-stdio interactive call, stopwait routes to the
longer bound, and runFile carries SCHTASKS_TIMEOUT_MS.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: da3b0c66-77d3-432c-bdc3-b677fff81f19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

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

What to do

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

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/0 boxes ticked.

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

@github-actions
github-actions Bot marked this pull request as draft October 1, 2026 15:31
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 1, 2026 17:54
@github-actions
github-actions Bot marked this pull request as draft October 1, 2026 17:54
@lidge-jun
lidge-jun marked this pull request as ready for review October 1, 2026 23:51
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration record (MAINTAINERS.md, dev-only)

@lidge-jun
lidge-jun merged commit 89db85f into dev Oct 1, 2026
47 of 50 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T23:54:20.091090Z e6bf0ba 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.

1 participant