Repository navigation
fix: harden gateway recovery credential handoffs - #1076
Conversation
|
Codex review: found issues before merge. Reviewed August 7, 2026, 8:41 PM ET / August 8, 2026, 00:41 UTC. ClawSweeper reviewWhat this changesThis PR adds fail-closed SSH listener checks before gateway credential handoffs and makes direct-connect persistence and rollback transactional. Merge readiness⛔ Blocked by patch quality or review findings - 5 items remain Keep open. The central hardening is not on current main, but the published proof still identifies an earlier commit rather than the current PR head, so it is not yet merge-ready. Priority: P1 Review scores
Verification
How this fits togetherThe tray connects operator and Windows-node clients to a saved Gateway, optionally through an SSH tunnel. This path resolves credentials, establishes the two sessions, and persists gateway and settings state used by later reconnects. flowchart LR
A[Saved gateway record] --> B[Connection manager]
B --> C[SSH listener ownership check]
C --> D[Credential handoff]
D --> E[Operator and node sessions]
B --> F[Direct-connect transaction]
F --> G[Registry settings and identity rollback]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Publish a redacted, inspectable exact-head proof summary or artifact that records commit 59d1301 and the three SSH ownership outcomes, then complete focused maintainer review of the credential and rollback paths. Do we have a high-confidence way to reproduce the issue? Yes. Inspecting the exact-head committed proof summary reproduces the evidence gap: it records 31e1563 instead of the reviewed 59d1301 head. Is this the best way to solve the issue? No. The hardening approach is plausible and covered by focused tests, but the published evidence must be refreshed to prove that the final integrated head retains the claimed behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 20d29e1132c3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (24 earlier review cycles; latest 8 shown)
|
313885c to
0462436
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 |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Reverts the superseded five-file provenance and allocator implementation from 3aa3ba7 before integrating the validated owners from #1120. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Merge current main after #1120 while preserving #1076 credential-handoff behavior and the validated conflict resolutions. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Port the validated acceptance synchronization, mirrored-WSL SSH endpoint, and denied-socket handling from integration commit 4969bbef. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Restore #1120's typed listener-snapshot failure reason after the PR recovery merge while retaining #1076 credential-handoff changes in their owning components. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Restore the two canonical #1120 setup regression tests that were dropped by the #1076 merge conflict resolution. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Route isolated proof SSH through a WSL stdio proxy so mirrored localhost route loss cannot invalidate recovery. Poll complete listener and connection snapshots while preserving real OpenSSH forwarding and fail-closed credential assertions. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Keep bounded preflight readiness retries and continue asserting the visible degraded state alongside fail-closed credential withholding. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Keep the readiness retry within a single 30-second wall-clock deadline and cap each SSH attempt at five seconds. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Cap both SSH attempts and retry backoff against a Stopwatch-based 30-second budget. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Break before constructing an attempt timeout when the monotonic preflight budget is exhausted. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
shanselman
left a comment
There was a problem hiding this comment.
Reviewed the final bb78e54 head after full build/tests, strict MXC 12/12, exact-head SSH/UI proof 3/3, structured autoreview, and rubber-duck review. No actionable findings.
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 84bc73e4-939a-4e25-ba88-26af9f4fc8b5
Summary
main, and preserve the fix: harden gateway recovery credential handoffs #1076 credential-handoff changes.ssh.exeowns the forwarded listener, WSLsshdis the real server, andProxyCommand wsl.exe ... nccarries only the SSH transport across mirrored-WSL route resets.Ownership and ordering
01faa6419b427ef4a4ba9239d2f55901f2c2f126).Validation
Exact PR head:
59d1301c2836e83bc497a44d4f27e2870c6482aaorigin/main(20d29e1132c37a4c37ec4bb24de668fa665b613e) with an ordinary merge commit; no conflict-resolution edits were required../build.ps1: passed../scripts/validate-mxc-e2e.ps1: strict 15/15 passed without-AllowSkip(TestResults\E2E\82613ad8).TestResults\E2E\46d67f3c).bb78e548; exact three-filemainintegration overlap review clean at59d1301c. The helper correctly refused the redundant whole-branch rerun because the committed PNG proof is binary.59d1301c. The broad test lane passed on an unchanged-SHA rerun after the known transientSystemRun_Where_ReturnsExpectedOutputtimeout; all three E2E shards and both architecture builds passed.Real behavior proof
The exact-head proof used real Windows
ssh.exe, real isolated WSLsshd, real port forwarding, and an isolated OpenClaw Gateway/tray profile. It verified:Degradedand node state becomesErrorwith the credential-withholding diagnostic;Proof artifact:
TestResults\E2E\46d67f3c\pr1076-proof\proof-summary.json.The user's existing paired Gateway was not mutated. Earlier read-only paired-path attempts were blocked by unavailable SSH/direct transport; all successful destructive and rollback proof ran only against the isolated test Gateway/profile.