Repository navigation
fix(macos): prevent discovery startup from crashing on transient bundles - #169884
Conversation
Discovery's private test detector enumerated loaded bundle URLs on every access before checking runner markers. A native onboarding replay and a forced missing-URL bundle both trapped in that scan during discovery start. Move the existing cached app detector to OpenClawKit and share the result with Discovery. Both targets already depend on that module. Preserve runner recognition and the one-time fallback, remove the competing detector, and keep the app's existing convenience property. Audit found no other hot loaded-bundle enumeration in apps. The real Discovery start/stop regression traps on the old owner with the fault injected. With the fix, all 21 Discovery/Nix tests pass in 0.045s with the same fault. Native compilation, scoped Swift lint/format and P2 pass. The full native default replay and PR CI provide the remaining broad proof.
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR shares the cached native test-process detector between the macOS app and Gateway discovery. Example: Discovery starts inside swiftpm-testing-helper while a transient loaded bundle has no URL.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a concrete native discovery crash still present on main, consolidates test detection under one owner, and introduces no identified correctness defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togethermacOS onboarding starts Gateway discovery, which uses process identity to decide whether background discovery fallbacks should run. flowchart TD
A[Onboarding monitoring] --> B[Gateway discovery]
B --> C[Shared cached test detector]
D[App ProcessInfo accessor] --> C
E[Environment process and arguments] --> C
F[Bundle fallback] --> C
C --> G[Fallback scheduling decision]
Technical reviewBest possible solution: Keep one cached test-process detector in OpenClawKit and have both native consumers use it. Do we have a high-confidence way to reproduce the issue? Source confirms the bundle-first Discovery path, and the author reports a failing-base/passing-head missing-URL reproduction; this read-only review executed no target code. Is this the best way to solve the issue? Sharing the existing cached detector removes the competing implementation while preserving runner recognition, bundle fallback, and normal discovery scheduling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 30b2ef35d02b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -8, Tests +16. Total +8 across 5 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label 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 HistoryReview history (1 earlier review cycle)
Reviewed October 12, 2026, 8:41 AM ET / 12:41 UTC (Revision 2). |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…les (openclaw#169884) Discovery's private test detector enumerated loaded bundle URLs on every access before checking runner markers. A native onboarding replay and a forced missing-URL bundle both trapped in that scan during discovery start. Move the existing cached app detector to OpenClawKit and share the result with Discovery. Both targets already depend on that module. Preserve runner recognition and the one-time fallback, remove the competing detector, and keep the app's existing convenience property. Audit found no other hot loaded-bundle enumeration in apps. The real Discovery start/stop regression traps on the old owner with the fault injected. With the fix, all 21 Discovery/Nix tests pass in 0.045s with the same fault. Native compilation, scoped Swift lint/format and P2 pass. The full native default replay and PR CI provide the remaining broad proof.
First-parent upstream f956a18..9d9761d (openclaw#169879 database worker ownership docs, UI retired render adapters, openclaw#169884 macOS discovery). No conflicts; the one file both sides touched (agent-schema-history.md, upstream reworded the snapshot paragraph) keeps our schema-27 rows and section byte-for-byte. Stops before openclaw#169646 (fp#722), which is step 69 on its own. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Fixes a macOS discovery startup crash in native test processes when concurrent bundle loading exposes a bundle without a URL.
User Impact
Onboarding and discovery can determine test mode without repeatedly walking transient bundles. Normal discovery behavior, runner recognition, configuration and dependencies are preserved.
Why This Change Was Made
Discovery duplicated the app's test detector but scanned
Bundle.allBundlesbefore checking runner markers. A full native replay trapped inURL._unconditionallyBridgeFromObjectiveCfrom this detector duringOnboardingView.updateDiscoveryMonitoring.The existing cached detector now lives in
OpenClawKit, which both consumers already depend on. The app property delegates to that one owner, and Discovery's duplicate is removed. This adds one source file, not a module or dependency. Theapps/audit found no other hot global bundle enumeration; the remaining fallback scan runs once, after environment/process/argv recognition. Explicit main/module/class bundle lookups are unchanged.Follow-up to 94940fb. The existing resolver and concurrent-reader tests remain. A touched Nix test's inherited five-field tuple lint finding is fixed with an equivalent local struct, preserving all rows and assertions.
Evidence
The focused command uses the compiled SwiftPM testing helper;
pnpm testdoes not run Swift targets. The new regression adds no sleep, polling, timeout, skip, or extra process boot within the suite. No rendered UI changed.