Confirmed current-dev regression
Current dev 64b994c includes #2918. On Windows, a localized nonzero targeted schtasks query falls back to the full task listing with a 20 second ceiling.
startServer currently calls inspectStartupOwnership before startup cache invalidation at src/server/index.ts around line 609 and again before native-main lifecycle preparation around line 788. Both calls reach the same synchronous service-manager probe.
On the reported zh-CN host, the full listing measured about 12.3 seconds for 401 tasks. With no installed OpenCodex task, one proxy start can therefore spend about 25 seconds in two identical listings before Bun.serve starts, with a 40 second worst-case ceiling.
The second ownership check is intentional. It prevents startup work between the cache decision and native lifecycle preparation from widening the service-install race. The fix must not simply delete final revalidation, lower the listing timeout back to 2 seconds, add guessed absence, or convert an unknown result into absent.
Required scope
- Keep each final ownership decision fail-closed.
- Keep the targeted scheduled-task query bounded and revalidated.
- Avoid repeating the expensive full-machine enumeration during one startup when the targeted recheck still provides the race-sensitive evidence.
- Do not broaden this into service installation or GUI changes.
Regression coverage
Add an injected Windows startup probe that:
- makes the targeted query return a localized unreadable nonzero result,
- makes the full listing take the fallback path,
- proves one start does not run the full listing twice,
- proves the targeted ownership recheck still occurs, and
- proves a task that becomes present between checks is not reported absent.
Original review evidence: #2920 (comment)
Confirmed current-dev regression
Current dev 64b994c includes #2918. On Windows, a localized nonzero targeted schtasks query falls back to the full task listing with a 20 second ceiling.
startServer currently calls inspectStartupOwnership before startup cache invalidation at src/server/index.ts around line 609 and again before native-main lifecycle preparation around line 788. Both calls reach the same synchronous service-manager probe.
On the reported zh-CN host, the full listing measured about 12.3 seconds for 401 tasks. With no installed OpenCodex task, one proxy start can therefore spend about 25 seconds in two identical listings before Bun.serve starts, with a 40 second worst-case ceiling.
The second ownership check is intentional. It prevents startup work between the cache decision and native lifecycle preparation from widening the service-install race. The fix must not simply delete final revalidation, lower the listing timeout back to 2 seconds, add guessed absence, or convert an unknown result into absent.
Required scope
Regression coverage
Add an injected Windows startup probe that:
Original review evidence: #2920 (comment)