fix(bridge): enforce exclusive socket ownership#187
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 12, 2026, 3:10 AM ET / 07:10 UTC. Summary Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against b873daf790ed. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
steipete
left a comment
There was a problem hiding this comment.
Addressed the valid default-app fallback finding in b1c37377:
- runtime selection now prefers the reusable daemon, then a healthy
.guiPeekaboo.app on the defaultbridge.sock, before daemon auto-start - legacy
.onDemandhosts still migrate replacement-first todaemon.sock - custom daemon sockets remain isolated and do not inherit the app fallback
- diagnostics and permission probing use the same candidate classification
- added focused regression tests and raw live outputs to the PR body
The changelog entries remain intentionally: this is user-visible behavior, and repository maintainer policy requires the maintainer merge entry plus contributor credit.
@clawsweeper re-review
|
Addressed the valid default-app fallback finding in @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Retrying after the targeted review failed with a retryable Codex capacity/transport error. The exact-head local autoreview completed cleanly with no actionable findings at 0.91 confidence, and the PR body contains the live evidence requested by the prior review. @clawsweeper re-review |
|
Maintainer review note: two targeted ClawSweeper re-review attempts on |
Summary
bridge.sock) from the reusable daemon (daemon.sock), migrate legacy daemons replacement-first while preserving lifecycle settings, and keep custom sockets isolatedRoot cause
The app, reusable daemon, and MCP process could contend for one socket without an ownership lease. A failed connection was enough to treat a path as stale, blocking Bridge I/O could strand accepted clients, and daemon migration could retire the serving process before a replacement was proven healthy. Together those paths allowed ungranted processes to replace the granted app host and left shutdown/startup races wedged.
Impact
Bridge hosts can no longer replace a live owner. The reusable daemon has its own socket, abandoned clients are deadline-bound, legacy migration preserves mode/poll/idle settings and keeps the old daemon serving if replacement fails, healthy Peekaboo.app GUI hosting remains the automatic default fallback, and embedded MCP remains process-local.
Validation
pnpm run formatpnpm run lint(0 serious findings)pnpm run lint:docspnpm run test:safe(507 tests, 68 suites)swift test --package-path Apps/CLI --filter CommandRuntimeInjectionTests(28 tests)swift test --package-path Core/PeekabooCore --no-parallel(918 tests, 132 suites; expected automation skips)pnpm run build:cli./scripts/build-mac-debug.shbridge.socktodaemon.sockmigration after the fallback refactor, preserving mode, 425 ms poll interval, and 47.5 s idle timeoutLive Evidence
Healthy Peekaboo.app fallback, selected before daemon auto-start:
Legacy on-demand daemon still migrates after the fallback refactor:
A second listener is rejected while the owner remains usable:
An abandoned client delays replacement until the lease is released:
Embedded MCP publishes no Bridge socket:
Fixes #184