Skip to content

fix: preserve relay cleanup after authority rejection - #183247

Merged
shakkernerd merged 1 commit into
mainfrom
relay-authority-failure-settlement-345
Oct 25, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
relay-authority-failure-settlement-345

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an exec lifecycle failure when source authority expires immediately after a native relay launch is admitted. The command is correctly rejected, but the relay host previously disconnected lifecycle IPC before the native owner could finish its closing-receipt and sequence-ACK handshake. That premature disconnect could replace the expected authority rejection with service child cleanup identity lost: write EPIPE and leave cleanup reported as uncertain.

User Impact

OpenClaw now preserves the original authority rejection while the already-admitted command and its descendants settle through the existing native cleanup lifecycle. Pre-admission failures and genuine transport loss keep their existing fail-closed behavior. Missing or invalid closing evidence still rejects cleanup; this change does not accept lineage EOF as extinction or relax the receipt, ACK, sequence, descendant-reaping, deadline, or cancellation requirements.

There are no configuration, schema, protocol, public API, dependency, or migration changes.

Why This Change Was Made

The relay's ready receipt already establishes the distinction the host needs: before readiness there is no admitted command, while afterwards the host owns a live authenticated cancellation transport. The construction-failure path now passes that existing cancellation operation to the relay retirement owner after admission. The same helper retains its prior direct owner-stop behavior when no command was admitted, so startup and true transport-loss paths are unchanged.

The private-input authority test continues to verify rejection before stdin is written, but no longer requires the obsolete direct-child-kill implementation. The unchanged launch-policy integration suite exercises the real relay, native owner, closing receipt, ACK, extinction join, and final authority error.

Evidence

The retained failing case ran on the unchanged base path and observed lineage EOF while the host was still active, a control-write EPIPE, nongraceful control close, and anchor exit 1 without any accepted closing receipt. Source qualification traced that sequence to the post-readiness catch disconnecting lifecycle IPC before the closing/ACK join.

On exact commit 41eabd6fdf37e5fa688f2e6e3915a7be1862641f (tree 03f12ac16afc139a54c2131cb24c9936be32fa3b), focused Blacksmith Testbox validation passed:

  • changed-file formatting and source lint, with zero warnings or errors;
  • all selected production and test type graphs;
  • 16 relay, supervisor, anchor, and launch-policy test files across four Vitest shards: 191 tests passed;
  • all 11 unchanged launch-policy integration cases, including the native non-PTY authority-retirement recurrence;
  • cancellation, closing/ACK, missing-receipt, deadline, startup, secret/input, output, process-group, and Linux subreaper controls.

Hosted CI, exact-head automated review, and independent engineering review remain pending at initial publication.

@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@shakkernerd shakkernerd self-assigned this Oct 25, 2026
@shakkernerd
shakkernerd merged commit 5d20423 into main Oct 25, 2026
129 of 130 checks passed
@shakkernerd
shakkernerd deleted the relay-authority-failure-settlement-345 branch October 25, 2026 04:36
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: OpenClaw now preserves the authority rejection while admitted relay descendants complete acknowledged cleanup.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Preserves the expected authority rejection while admitted relay descendants settle through the existing acknowledged cleanup lifecycle.
@travellingsoldier85

Copy link
Copy Markdown

Seen in production on 2026.10.7 (Linux, systemd user unit): after one post-admission exec authority rejection (logged as [process/supervisor] spawn failed: runId=… reason=[object Object]), the supervisor latches service child cleanup identity lost: write EPIPE and the next restart exits 1 with gateway.restart_close_failed (PluginRuntimeCloseRetainedError ← global singleton reset ← processSupervisorHolder). v2026.10.8 and v2026.10.10-beta.4 don't contain this fix. Could it be cherry-picked to the stable line? Separately, the spawn-failure log stringifies a non-Error rejection as [object Object].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants