Repository navigation
fix(signal): report managed daemon port collisions before startup - #124015
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: passed. Reviewed August 23, 2026, 10:48 AM ET / 14:48 UTC. ClawSweeper reviewWhat this changesThe PR checks a managed Signal daemon’s configured endpoint before starting signal-cli, normalizes bracketed IPv6 hosts, and applies one startup deadline to probing and readiness. Merge readinessKeep open for the existing guarded automerge path. The exact head has no new actionable code finding, and the recorded maintainer decision accepts the intentional early-failure behavior for occupied managed Signal endpoints. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Signal plugin resolves a managed-native account’s bind address, starts its local signal-cli daemon, then waits for its HTTP API before receiving messages. This change adds an availability decision between configuration resolution and daemon spawn. flowchart LR
A[Signal account configuration] --> B[Resolve managed bind host and port]
B --> C[Probe configured endpoint]
C -->|occupied| D[Actionable startup error]
C -->|available| E[Start signal-cli daemon]
E --> F[Deadline-bounded readiness check]
F --> G[Signal message monitor]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +126, Tests +252. Total +378 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the single managed-startup path after exact-head checks complete; retain the actionable collision recovery and do not add a late-failure compatibility fallback. Do we have a high-confidence way to reproduce the issue? No local runtime reproduction was run in this read-only review; the current-main caller and the PR’s focused real-listener tests make the occupied-endpoint path source-reproducible. Is this the best way to solve the issue? Yes. The probe is placed at the managed daemon lifecycle boundary, reuses the shared bind owner, and leaves non-collision bind failures to the operator-selected daemon. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ee6e0251b461. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (23 earlier review cycles; latest 8 shown)
|
8913697 to
b3ada3c
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
b3ada3c to
75d677d
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper approve Maintainer decision: accept the intentional managed-native compatibility change. When the configured Signal endpoint is occupied, OpenClaw should fail before spawning signal-cli and tell the operator to free the endpoint, choose another |
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision for this exact head:
No concrete ClawSweeper code finding remains. Proceed with the repository's normal exact-head validation and guarded landing flow. |
|
@clawsweeper approve Maintainer decision for exact head
Continue the guarded merge gates for this exact head. |
|
Land-ready verification for exact head
Production delta: +163/-43 (net +120). Tests/test support: +263/-5 (net +258). The remaining independent signal-cli/media inspection limitation is accepted; no code or CI gap remains. |
|
Merged via squash.
|
…enclaw#124015) * fix(signal): report managed port collisions before startup * fix(signal): clarify managed port collision recovery Co-authored-by: jesse-merhi <[email protected]> * fix(signal): fence cancelled daemon startup Co-authored-by: jesse-merhi <[email protected]> * fix(signal): normalize aborted probe errors Co-authored-by: jesse-merhi <[email protected]> --------- Co-authored-by: RoboClaw <[email protected]>
New behavior
Managed-native Signal accounts now stop before daemon startup when their configured HTTP endpoint is already occupied. The startup error names the host and port and tells the operator to stop the conflicting service or choose a different
transport.httpPort.signal-cliuse them.signal-cli, which may run with different permissions.Visual proof
Collision proof: A real service occupies the configured loopback endpoint. Managed Signal startup returns the exact collision and remediation before spawning its daemon, while the unrelated listener remains live.
Deadline and dependency proof: A health endpoint delayed by 500ms is rejected in about 136ms under a 120ms startup budget. Installed
signal-cli 0.14.6+morph027+2reaches a listener with both the canonical::1:PORTargument and bracketed[::1]:PORTinput.State: Exact local candidate head; real TCP/HTTP listeners on ephemeral loopback ports; installed
signal-cli; browser captures from sanitized loopback proof pages.How to verify
Start a TCP listener on the configured managed-native Signal endpoint, then start the Signal monitor. Startup should fail before
signal-cliis spawned, name the occupied endpoint, and leave the existing listener available.For the shared deadline, delay the daemon health endpoint past
startupTimeoutMs. OpenClaw should reject before spawn if the probe consumed the budget and otherwise cap each health request to the remaining budget.Focused exact-head checks passed: 54 Signal/port-probe tests, core and plugin production/test typechecks, formatting, lint, and diff validation.
Implementation notes
Previously, managed startup spawned
signal-cli daemon --http HOST:PORTbefore establishing that the configured endpoint was available. An unrelated listener therefore surfaced only as a late daemon exit.The probe now runs at the managed-daemon lifecycle boundary and reuses the shared port-availability owner. It is an early diagnostic, not a reservation: if another process claims the endpoint after the probe closes, the existing daemon-exit path remains authoritative. Daemon readiness lives with the daemon owner, rejects an expired pre-spawn budget, and bounds each health request by the same deadline. External-native transports and persisted configuration are unchanged.
Production delta: +157/-42. Tests and test support: +238/-5. The production growth adds the canonical cancellable bind path, one shared startup deadline, and host normalization; it does not add a fallback daemon path or change any config/default surface.