Skip to content

[WRONG BRANCH] fix(windows): refresh startup ownership listing - #395

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-windows-ownership-check-issue
Draft

[WRONG BRANCH] fix(windows): refresh startup ownership listing#395
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-windows-ownership-check-issue

Conversation

@luvs01

@luvs01 luvs01 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent a startup-scoped TOCTOU where a cached full Task Scheduler listing from the first ownership check could be reused by the second check and incorrectly prove absence, enabling unauthorized native-main startup work.

Description

  • Stop reusing the startup fallback listing for the second, race-sensitive ownership inspection by omitting the shared startupWindowsTaskListingCache from the later inspectStartupOwnership call in src/server/index.ts and update the explanatory comment.
  • Add a focused regression test in tests/codex-service-manager-probe-hardening.test.ts that models a task being registered after the second localized targeted /xml snapshot and asserts the code performs a fresh full listing (two listings) and returns the safer unknown verdict on the second inspection.
  • Keep runtime retry behavior unchanged (retries intentionally omit the startup-local memo) and preserve the earlier guard that only caches successful full listings during the initial startup decision.

Testing

  • Ran the focused regression: bun test tests/codex-service-manager-probe-hardening.test.ts --timeout 30000, which passed the modified probe hardening tests (all tests in that file passed).
  • Ran typecheck with bun run typecheck, which succeeded.
  • Ran bun run privacy:scan, which succeeded.
  • Ran the repository-wide test driver; the focused regression behaved correctly during the full run but the full-suite run remains noisy due to unrelated environment/concurrency failures (the unrelated failures were observed outside the touched subsystem).

Codex Task

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 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-08-31T01:05:43.808179Z 47fa9d7 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bd3a3c37-d4dc-4c76-be99-2012ed5f4f34


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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47fa9d72cf

ℹ️ 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".

Comment thread src/server/index.ts
Comment on lines +605 to +608
// #2923: retain a successful fallback listing only within the first startup
// ownership decision. A targeted query's bytes are not a Task Scheduler state
// generation, so the later race-sensitive decision must take a fresh listing.
// Runtime ownership retries below intentionally omit this startup-local memo too.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep startup within the service health window

On the documented localized Windows path where the targeted /xml response requires a full listing, this now runs two sequential listings before the listener binds. The measured host recorded in structure/04_transports-and-sidecars.md:22-34 takes 12.3 seconds per listing, so startup takes roughly 25 seconds, while confirmServiceServing gives ocx service install, start, and repair only 20 seconds (src/service.ts:655,687,708-720). Those commands will therefore report failure and exit 1 even though the service is still starting; the update path explicitly interprets that exit as reason to fall back to a direct start (src/service.ts:699-702). Preserve the fresh second ownership evidence, but adjust the corresponding service readiness budget or otherwise avoid exceeding it.

AGENTS.md reference: src/AGENTS.md:L10-L11

Useful? React with 👍 / 👎.

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

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot changed the title fix(windows): refresh startup ownership listing [WRONG BRANCH] fix(windows): refresh startup ownership listing Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft August 31, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant