Repository navigation
refactor: clarify message channel validation - #120872
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
August 9, 2026 04:12
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
isDeliverableMessageChannelremains the strict canonical delivery predicate. The permissive pre-registration check is now explicitly namedisNormalizedMessageChannel, 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 fakeDeliverableMessageChannel/GatewayMessageChanneltype 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 sosubagent-announce.tsremains 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 (
-25lines), 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.node scripts/check-changed.mjsgate passed on Testboxtbx_01kzjaja2ed96kc7p4hfgxtppj: https://github.com/openclaw/openclaw/actions/runs/31293440461