Repository navigation
fix(windows): reuse unchanged startup task listing - #2928
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe change adds a startup-local Windows Task Scheduler listing cache. Fresh targeted queries remain race-sensitive, while identical targeted results reuse the expensive full listing. Server wiring, documentation, and regression tests cover this behavior. ChangesWindows startup ownership reuse
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🟡 Moderate · up to The change can reuse an older Task Scheduler listing after a refresh for a different task identity fails, so a Windows startup ownership check may make a decision from stale evidence. Merge should wait for cache invalidation on failed refresh or explicit owner acceptance of this bounded security risk. Sequence Diagram(s)sequenceDiagram
participant startServer
participant inspectStartupOwnership
participant inspectNativeCodexOwnership
participant WindowsTaskListingCache
participant TaskScheduler
startServer->>inspectStartupOwnership: run startup ownership check
inspectStartupOwnership->>inspectNativeCodexOwnership: pass startup cache
inspectNativeCodexOwnership->>TaskScheduler: run fresh targeted /xml query
TaskScheduler-->>inspectNativeCodexOwnership: targeted probe result
inspectNativeCodexOwnership->>WindowsTaskListingCache: getOrRun(targeted result, full listing)
WindowsTaskListingCache->>TaskScheduler: run /fo CSV listing when key changes
TaskScheduler-->>WindowsTaskListingCache: full listing result
WindowsTaskListingCache-->>inspectNativeCodexOwnership: cached or fresh listing
inspectNativeCodexOwnership-->>startServer: ownership decision
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Out of Scope Changes checkExplanation The changes remain within issue
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
리뷰 · 우선순위 64 / 80이 PR도 고치는 방법은 테스트는 점수가 라인 - src/server/index.ts 609행과 788행 - 캐시는 이 두 번의 듣기 전 검사에만 들어간다. 815행 재시도에 안 넣는 선택은 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
|
Reviewed at head Two findings, one blocking. Blocking: a stalled listing is cached, so one transient timeout becomes a sticky refusal
That is the direction that costs a user a working Reproduced against your head: The fixture: same GBK targeted stderr on both passes, Suggested fix — only cache a successful listing: getOrRun(targetedQuery, run) {
const nextIdentity = rawProbeIdentity(targetedQuery);
if (result !== null && identity === nextIdentity) return result;
const next = run();
// A stall or failure is not evidence, and caching it turns one transient
// timeout into an unprovable ownership for the rest of the startup.
if (!next.timedOut && !next.spawnFailed && next.status === 0) {
identity = nextIdentity;
result = next;
}
return next;
}Then retarget the existing test at Non-blocking: one test fails locally in a way CI will not show
Not blocking, because CI runners have no such installation and it passes there — but it makes the test unable to fail for the right reason on a developer machine. Injecting Everything else checks out: 61 pass across |
…failure getOrRun retained every listing result, including a timeout. Because the targeted query is byte-identical on the next inspection, the identity check passed, the listing was never retried, and one transient 20s stall left ownership unprovable for the whole startup — refusing exactly the write #2914 exists to allow. Only a successful listing is retained now. Both inspections stay fail-closed on a stall, and the second one gets a real answer when the machine recovers. Also pin statePaths in the startServer regression: startServer derives them from the sandbox home AND the default homedir() mirror, which no test env moves, so the case read the developer's real installation and reported foreign locally while passing on CI.
|
I pushed the fix to your branch rather than make you round-trip on it — head is now The blocking finding. if (!next.timedOut && !next.spawnFailed && next.status === 0) {
identity = nextIdentity;
result = next;
}I retargeted The non-blocking one, also fixed. 114 pass / 0 fail across The byte-identity keying was the right call and it is why this landed instead of my #2927. |
* fix(windows): reuse unchanged startup task listing * fix(windows): retry a stalled startup listing instead of caching the failure getOrRun retained every listing result, including a timeout. Because the targeted query is byte-identical on the next inspection, the identity check passed, the listing was never retried, and one transient 20s stall left ownership unprovable for the whole startup — refusing exactly the write lidge-jun#2914 exists to allow. Only a successful listing is retained now. Both inspections stay fail-closed on a stall, and the second one gets a real answer when the machine recovers. Also pin statePaths in the startServer regression: startServer derives them from the sandbox home AND the default homedir() mirror, which no test env moves, so the case read the developer's real installation and reported foreign locally while passing on CI. --------- Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com> Co-authored-by: bitkyc08-arch <bitkyc08@gmail.com>
* fix(windows): reuse unchanged startup task listing * fix(windows): retry a stalled startup listing instead of caching the failure getOrRun retained every listing result, including a timeout. Because the targeted query is byte-identical on the next inspection, the identity check passed, the listing was never retried, and one transient 20s stall left ownership unprovable for the whole startup — refusing exactly the write lidge-jun#2914 exists to allow. Only a successful listing is retained now. Both inspections stay fail-closed on a stall, and the second one gets a real answer when the machine recovers. Also pin statePaths in the startServer regression: startServer derives them from the sandbox home AND the default homedir() mirror, which no test env moves, so the case read the developer's real installation and reported foreign locally while passing on CI. --------- Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com> Co-authored-by: bitkyc08-arch <bitkyc08@gmail.com>
Summary
schtasks /query /tn ... /xmlownership checks during startup.structure/04_transports-and-sidecars.md.Closes #2923
Verification
3bcd29770:bun test tests/codex-service-manager-probe-hardening.test.ts tests/codex-service-manager-probe.test.ts tests/native-profile-startup.test.ts --timeout 30000— 112 pass, 0 fail.3bcd29770:bun run typecheck— passed.devrebase:bun run test— 16,144 pass, 16 skip, 0 fail. The only two later base commits changed Codex identity-budget and pool replay tests; focused tests and typecheck were rerun after that rebase.HOME,OPENCODEX_HOME, andCODEX_HOME, with CPU affinity and niceness limits.Checklist
Summary by CodeRabbit
Performance
Bug Fixes
Documentation