Skip to content

fix: resume native parents when saved channel aliases fail - #188063

Open
foxsky wants to merge 2 commits into
openclaw:mainfrom
foxsky:fix/native-completion-private-parent-20261030
Open

foxsky wants to merge 2 commits into
openclaw:mainfrom
foxsky:fix/native-completion-private-parent-20261030

Conversation

@foxsky

@foxsky foxsky commented Oct 30, 2026 •

Copy link
Copy Markdown

Related: #166022

What Problem This Solves

Fixes native worker results failing to resume their parent when the parent's saved channel alias no longer resolves.

User Impact

Parents can consume completed worker results and continue their tasks. Sending a visible reply still requires the parent's permitted messaging tools. No configuration or schema migration is introduced.

Why This Change Was Made

Route native completions through the existing private parent-input owner instead of resolving an external destination first. Keep current session-controller custody and exact host-issued source/requester authority. Bind runtime completion facts to the durable processing identity so replay reuses a consumed result and rejects a changed result under the same identity. Processing receipts do not count as external delivery.

This is a separate pre-admission routing failure from the interrupted-input recovery reported in the linked issue; it does not claim to resolve that broader report.

Evidence

  • Reproduced through the actual SDK and isolated Gateway on upstream 8e0ae0da7bd5: a throwing saved-alias resolver ran once, no parent command started, and delivery failed. With the correction, the resolver is not called and the parent runs once.
  • 97 focused cases pass across seven files: the three changed test files passed all 40 cases after the CI correction; 57 unchanged sibling cases retain their passing proof. Coverage includes durable replay after clearing warm dedupe, changed-result rejection, forged-source refusal, strict external routing, current/revoked/replaced ownership during compaction, incognito actor admission, and registered completion siblings.
  • Removing only the new runtime-event fingerprint reproduced the changed-result replay defect; the reviewed production bytes were then restored.
  • Fresh independent P0–P2 review of the production and test changes completed with no actionable findings. Core and affected test types, targeted typed lint, formatting, docs checks, import cycles, assertion safety, line and mock-export ratchets, and git diff --check passed.
  • The unused-file scan passed for production but failed for one full-tree path, scripts/perf/update-state-io-measure.ts. That file, its documented command, the Knip registrations/runner, and package/lock/workspace inputs are byte-identical to the pinned base; neither snapshot registers this maintained command. No changed path was flagged. The original aggregate failure is retained; a pristine-base scan was not rerun, and no unrelated fix or suppression was added.

The Gateway fixture uses real isolated session storage and controlled parent execution. It does not establish a live Codex thread identity or delivery of an external final message. Hosted CI on the corrected head is pending.

The retired-caller success cases use the real Gateway. A separate restart-drain negative verifies that a fabricated warm-cache result cannot claim private consumption or leave an input, transcript, queued controller, or retained root. This preserves the existing restart guard. The CI correction changes tests only; production bytes remain unchanged. The origin mock now preserves real exports, and its one obsolete grandfathered baseline entry was removed through the native guard.

The 172-line test allocation covers these distinct boundary regressions using existing fixtures; the prior compaction table was adapted rather than duplicated. No sleeps, retries, timeout increases, or new production test seams were added.

Changed-test costs from separate single-worker canonical wrapper invocations:

File Tests Wrapper wall
src/agents/agent-harness-completion-authority.test.ts 14 passed 107.983 s
src/gateway/server.native-completion-authority.test.ts 10 passed 110.191 s
src/plugin-sdk/agent-harness-completion.test.ts 16 passed 20.874 s

The original authority fixture reproduced the CI failure locally: 13 passed, one failed, 109.131 seconds. These wrappers include worker preparation; transformation accounts for most of their time. The Gateway suite exercises actual SDK dispatch, controller serialization, SQLite processing receipts, and compaction admission; helper-only tests cannot prove that wiring. The earlier six-file batch took 390.580 seconds, including 96.333 seconds of shared worker preparation; its unchanged sibling proof is retained.

node scripts/run-vitest.mjs src/agents/agent-harness-completion-authority.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/gateway/server.native-completion-authority.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/plugin-sdk/agent-harness-completion.test.ts --maxWorkers=1

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime plugin: file-transfer size: M labels Oct 30, 2026
@foxsky
foxsky marked this pull request as ready for review October 30, 2026 03:21
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 98a3ae3f735ff7bd5bd5f69ca020b27404ca20c7, but the PR head is now c6a56a535cfa9835dd7bf51e9c641edd07c1c2bf. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-10-30T03:40:44.474Z sha 98a3ae3 :: needs real behavior proof before merge. :: [P2] Preserve real exports in the changed origin-module mock | [P2] Update retained-custody replay coverage for private input receipts

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 30, 2026
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 30, 2026

This branch has not been deployed

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. plugin: file-transfer size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant