Skip to content

refactor: clarify message channel validation - #120872

Merged
steipete merged 1 commit into
mainfrom
steipete/kind-wiles-b7f745
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/kind-wiles-b7f745

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Resolves a message-channel validation hazard where two predicates shared the same name while enforcing different semantics. Callers could accidentally use permissive normalization-round-trip acceptance where registry-backed delivery validation was required, or reject a normalized external plugin channel before its plugin registry had bootstrapped.

Why This Change Was Made

The registry-backed isDeliverableMessageChannel remains the strict canonical delivery predicate. The permissive pre-registration check is now explicitly named isNormalizedMessageChannel, preserving unknown normalized external plugin routing before plugin bootstrap without conflating that behavior with deliverability.

The public resolver now honestly returns string | undefined; the normalize pass-through and fake DeliverableMessageChannel / GatewayMessageChannel type chain are removed. Delivery-context callers now import the canonical shared owner directly and the obsolete barrel is deleted. Descendant wake lifecycle ownership was extracted into its own module so subagent-announce.ts remains below the 700-line limit without changing behavior. The generated Plugin SDK hash is updated for the public source/signature cleanup.

Production source is net smaller: 305 insertions and 330 deletions (-25 lines), with tests counted separately.

User Impact

Channel routing now applies clearly named validation contracts. Existing registered delivery channels remain strict, while normalized external plugin channel IDs continue routing correctly before plugin bootstrap. There is no new configuration or operator action.

This PR was AI-assisted. I reviewed the complete patch and understand the resulting ownership and routing behavior.

Evidence

  • node scripts/run-vitest.mjs src/utils/message-channel.test.ts src/utils/delivery-context.test.ts src/infra/outbound/targets.test.ts src/infra/outbound/channel-resolution.test.ts — 132 passed.
  • node scripts/run-vitest.mjs src/cron/delivery-context.test.ts src/gateway/server.agent.subagent-delivery-context.test.ts src/agents/bash-tools.exec.approval-id.test.ts src/agents/bash-tools.exec.script-preflight.test.ts src/agents/bash-tools.test.ts src/agents/subagent-registry-lifecycle.test.ts test/scripts/audit-seams.test.ts — 283 passed, 4 skipped.
  • node scripts/run-vitest.mjs src/plugins/contracts/plugin-sdk-subpaths.test.ts test/scripts/audit-seams.test.ts — 27 passed.
  • node scripts/run-vitest.mjs src/agents/subagent-announce.test.ts src/agents/subagent-announce.requester-settle-wake.test.ts src/agents/subagent-announce.timeout.test.ts src/agents/subagent-registry-lifecycle.test.ts src/infra/outbound/targets.test.ts — 295 passed.
  • Full delegated node scripts/check-changed.mjs gate passed on Testbox tbx_01kzjaja2ed96kc7p4hfgxtppj: https://github.com/openclaw/openclaw/actions/runs/31293440461
  • Mandatory pre-ship autoreview completed with no accepted or actionable findings.

@steipete
steipete marked this pull request as ready for review August 9, 2026 04:12
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Aug 9, 2026
@steipete
steipete merged commit 7b07615 into main Aug 9, 2026
173 of 180 checks passed
@steipete
steipete deleted the steipete/kind-wiles-b7f745 branch August 9, 2026 04:30
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant