Repository navigation
improve: avoid Windows task imports during Linux service discovery - #206777
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesDefer Windows task-inspection imports until deep Windows service discovery needs them. Example: Discover Gateway services on Linux with deep discovery enabled.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused, useful import-boundary improvement that current main still needs; no actionable code or security defects were found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared daemon inventory serves Doctor, Gateway status, and managed-service discovery, translating platform service definitions into service findings and inspection errors. flowchart TD
A[Doctor and Gateway status] --> B[Shared service discovery]
B --> C[Platform selection]
C --> D[Linux systemd inventory]
C --> E[macOS launchd inventory]
C --> F[Deep Windows inventory]
F --> G[Lazy task and Startup readers]
D --> H[Services and inspection errors]
E --> H
G --> H
Technical reviewBest possible solution: Keep the existing discovery owner and load Windows dependencies only inside its deep-Windows branch. Do we have a high-confidence way to reproduce the issue? Current-main static imports establish the unnecessary Windows dependency loading; the PR reports baseline failure and head success, but this read-only review ran no target code. Is this the best way to solve the issue? This is a small, complete improvement using existing owners, with no new cache, discovery path, configuration, or public contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ebabd17b7d79. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests +29. Total +31 across 2 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 27, 2026, 11:05 AM ET / 16:05 UTC. |
|
Merged via squash.
|
…penclaw#206777) * improve: avoid Windows task imports during Linux service discovery * test: explain Windows discovery import isolation
What Problem This Solves
Linux and macOS service discovery loads Windows Scheduled Task inspection and launcher-encoding code before selecting its platform. Even shallow Windows discovery pays this cost without inspecting tasks.
User Impact
Service discovery avoids those unused Windows modules. Deep Windows inventory retains its existing task and Startup-folder inspection, errors, and native-operation deadline. No configuration or migration is required.
Why This Change Was Made
Keep the shared discovery owner and its public exports; load task modules only after the Windows/deep guard. Dependency loading still precedes the existing native inspection deadline. This is a small platform boundary change (+2 production lines, +29 test lines), with no additional cache or alternate discovery flow.
Evidence
d41719aa71fbat the eager task-layout import, then passed on signed03e1931ffcc6for Linux, macOS, and shallow Windows.pnpm check:test-mock-exports --base d41719aa71fband all three boundary cases. Production and test assertions are unchanged, so the prior focused-suite/build proof is retained.pnpm tsgo:core, and ordinarypnpm buildpassed.iconv-lite/safer-bufferfiles (13,145 bytes) before, zero afterward; codec tables were already lazy.findSystemGatewayServicesfunction. The systemd-scope entry itself is unchanged; its dynamic discovery path benefits. Full service management still has independent Windows callers and grows by two small chunks / 684 bytes.d41719aa71fb..03e1931ffcc6: no actionable findings; the requested execution and red→green proof is supplied above.These are entry-specific module/file measurements, not latency or device-memory claims. Native Windows service operations and physical-device timings were not run.