Skip to content

fix: keep channel sends on the selected plugin - #134564

Merged
steipete merged 2 commits into
mainfrom
codex/upgrade-outbound-registration-20260831
Sep 1, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/upgrade-outbound-registration-20260831

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users sending or broadcasting through an installed channel plugin could invoke a different implementation with the same channel ID, fail before delivery, or use the wrong action handler. The selected account and its credentials could be correct while no message reached the selected transport.

Why This Change Was Made

Channel registration now keeps the selected implementation, origin, runtime binding, and send capabilities together. Delivery projects both adapters from that registration and retains its registry for later callbacks. Scoped setup activation cannot be replaced by a process-root sender or a previously warmed root cache. Unrelated root channels, bundled discovery, and the shipped installed-plugin bootstrap contract remain available.

The change removes the independent message-adapter fallback search. It adds no configuration option, SDK contract, database schema, or persistent store.

User Impact

Installed channel plugins receive their own sends and actions. Missing capabilities remain missing on the selected implementation, and a prepared delivery continues to use the same plugin when invoked later.

Evidence

  • 74 focused tests in seven files pass. Before-fix failures cover registration, action provenance, adapter/durable capabilities, scoped bootstrap, warmed cache, and prepared callback ownership. The warmed-cache fixture was corrected and its actual pre-fix failure recaptured.
  • Rebuilt CLI: both outbound-only and action-based broadcasts changed from exit1 with no receipt to exit0 with the selected plugin's local transport receipt; directory control stayed green. Credentials resolved correctly throughout. This uses synthetic local transport, not Twilio/provider network delivery.
  • Canonical sourcePerformance build passed; the exact ten-file source hashes remained unchanged through build and replay.
  • Independent Codex review through P3 is clean. Production delta is +74/−77 (net−3); regression tests +327/−7 after CI fixture cleanup; docs +6.
  • Cold missing-SMS Gateway: all eight diagnostics succeed; liveness/UI return200; readiness identifies only the blocked SMS owner; healthy SMS/control plugins stay running; strict manual start reports UNAVAILABLE; Gateway exits0. Candidate runtime served byte-identical pinned UI assets.
  • A fresh isolated install resolves locked pako3.0.1 and passes core, core-test, plugin and plugin-test typechecks plus repository guards. The original shared install had obsolete pako1.0.11; no dependency/type shim changes were made.
  • Initial CI exposed a redundant test import and two existing promotional-pricing fixtures that read the real clock after September1 UTC. Removed the duplicate import and scoped the historical fixture clocks with automatic cleanup. All27 resolver tests and94 affected provider tests pass; production pricing and the explicit standard-pricing cutover tests are unchanged. Fresh exact-head CI is required before landing.

The broader upgrade retest passed on source 1c9770a: 791 existing focused tests; 21 native macOS and 21 native Linux Gateway turns with nine-agent migration/repeat repair; Windows installer and actual package-upgrade workflow 33452237126 with live OpenAI replies. Those results establish the retest baseline, not this candidate's proof.

Regression provenance: exact introducing commit is not established. The installed-plugin CLI contract in 4c52d3f is reachable from stable v2026.8.1 and is preserved.

Related follow-up: the source CLI compile-cache respawn wrapper intermittently exited1 during a synthetic Gateway teardown after channel assertions passed. The paired direct-launch control exited0; this separate launcher lifecycle issue is outside the registration repair.

Compact actual-runtime verdict (candidate production hashes remain unchanged through the test-only CI fixes):

{"builtCli":{"outboundOnly":{"beforeExit":1,"afterExit":0,"intendedLocalReceipt":true},"action":{"beforeExit":1,"afterExit":0,"intendedLocalReceipt":true},"directoryControl":"pass"},"coldGateway":{"diagnosticCommandsPassed":8,"liveness":200,"controlUi":200,"readiness":{"status":503,"failing":["sms"]},"healthySiblingsRunning":true,"strictStart":"UNAVAILABLE","exit":0},"externalTransport":"synthetic local sink"}

ClawSweeper follow-through: selected-registration ownership is intentional for this repair. A selected plugin without a capability must report it as unavailable; it must not borrow another registration's adapter or provenance. The stable installed-plugin addressability contract and root/bundled overlay for unrelated scoped IDs remain preserved. No supported same-ID cross-adapter fallback contract was found. The review's remaining rank-up item is exact-head green CI; the follow-up changes only tests and leaves the reviewed production bytes unchanged.

Final CI: run 33455972821 completed successfully for exact head d69f770fc683002da1fa3b5ce96772810e49a7fb, including the repository CI gate. The reviewed ownership decision and exact-head CI rank-up items are satisfied.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M maintainer Maintainer-authored PR labels Sep 1, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 8:27 PM ET / September 1, 2026, 00:27 UTC.

ClawSweeper review

What this changes

This PR prevents channel actions and outbound sends from borrowing a same-ID plugin’s adapter by retaining the selected plugin registration and request-scoped registry through delivery.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The patch consistently makes the selected plugin registration own its actions, adapters, capabilities, bootstrap result, and deferred callbacks; the protected maintainer label and intentional fallback change require maintainer confirmation plus exact-head CI.

Priority: P1
Reviewed head: 9671a44b6f7e43070b589040c50fd21e0faf927f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with coherent regression coverage; exact-head CI and the intended compatibility change still need maintainer handling.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless describes a synthetic local-transport after-fix run, while the reviewed source and focused tests cover the selected-registration path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless describes a synthetic local-transport after-fix run, while the reviewed source and focused tests cover the selected-registration path.
Evidence reviewed 7 items Introduced owner-boundary repair: The introduced resolution path consults the request-scoped registry before root lookup, so a same-ID selected plugin remains authoritative rather than borrowing a root registration.
Delivery keeps one plugin’s surfaces together: Handler construction obtains one plugin from the registry and passes both its outbound and message surfaces to the handler; deferred handler methods re-enter the captured registry scope.
Pre-change main could mix registrations: At the pinned current-main base, handler creation loaded outbound separately and independently resolved the message adapter, which allowed the mismatched same-ID fallback described by the PR.
Findings None None.
Security None None.

How this fits together

Outbound delivery resolves a channel plugin, prepares its transport handler, and sends through its outbound or message adapter. The registry scope carries the selected plugin’s identity and capabilities across asynchronous delivery callbacks.

flowchart LR
  A[Channel send or action] --> B[Selected plugin registration]
  B --> C[Request-scoped registry]
  C --> D[Prepared delivery handler]
  D --> E[Selected transport adapter]
  E --> F[Delivery receipt or unavailable result]
Loading

Decision needed

Question Recommendation
Should same-ID selected plugins without a send surface intentionally fail as unavailable rather than borrow the process-root plugin’s adapter? Keep selected-plugin ownership: Confirm the fail-closed behavior and land once the exact-head checks are green.

Why: This removes an accidental fallback that could have become relied upon by unusual installed-plugin configurations; the compatibility contract needs explicit maintainer confirmation.

Before merge

  • Resolve merge risk (P1) - An existing same-ID installed plugin that silently depended on a root plugin’s send surface will now report the selected plugin as unavailable instead; that fail-closed upgrade behavior is intentional but needs maintainer confirmation.
Agent review details

Security

None.

PR surface

Source -3, Tests +317, Docs +6. Total +320 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 74 77 -3
Tests 4 319 2 +317
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 399 79 +320

Review metrics

Metric Value Why it matters
Production versus regression-test delta production +74/−77 (net −3); tests +319/−2; docs +6 The repair reduces production code overall while adding focused coverage for registration ownership, bootstrap caching, and deferred sends.

Merge-risk options

Maintainer options:

  1. Confirm selected-plugin fail-closed behavior (recommended)
    Accept the intentional upgrade change that stops a selected plugin from borrowing another plugin’s adapter after exact-head CI passes.
  2. Retain a supported fallback contract
    Pause the change if cross-plugin fallback is a required compatibility promise, then redesign and test that promise explicitly.

Technical review

Best possible solution:

Keep one selected registration authoritative from dispatch through deferred delivery, with absent capabilities reported for that plugin instead of borrowing another plugin’s transport.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: pinned main independently selected outbound and message surfaces, while the new same-ID registry tests exercise the resulting mismatch. This read-only review did not execute the contributor’s stated local transport run.

Is this the best way to solve the issue?

Yes. Selecting the whole registration at the registry owner and carrying its scoped handle into deferred delivery removes the mixed-owner path without adding configuration or a parallel transport flow.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5dd4c6e3b087.

Labels

Label changes:

  • add P1: A wrong same-ID transport can cause an agent’s requested channel send or action to fail or reach the wrong implementation.
  • add merge-risk: 🚨 compatibility: The PR intentionally removes cross-plugin adapter fallback for existing same-ID installed-plugin configurations.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless describes a synthetic local-transport after-fix run, while the reviewed source and focused tests cover the selected-registration path.

Label justifications:

  • P1: A wrong same-ID transport can cause an agent’s requested channel send or action to fail or reach the wrong implementation.
  • merge-risk: 🚨 compatibility: The PR intentionally removes cross-plugin adapter fallback for existing same-ID installed-plugin configurations.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless describes a synthetic local-transport after-fix run, while the reviewed source and focused tests cover the selected-registration path.

Evidence

What I checked:

  • Introduced owner-boundary repair: The introduced resolution path consults the request-scoped registry before root lookup, so a same-ID selected plugin remains authoritative rather than borrowing a root registration. (src/channels/plugins/registry.ts:48, 9671a44b6f7e)
  • Delivery keeps one plugin’s surfaces together: Handler construction obtains one plugin from the registry and passes both its outbound and message surfaces to the handler; deferred handler methods re-enter the captured registry scope. (src/infra/outbound/deliver-channel.ts:58, 9671a44b6f7e)
  • Pre-change main could mix registrations: At the pinned current-main base, handler creation loaded outbound separately and independently resolved the message adapter, which allowed the mismatched same-ID fallback described by the PR. (src/infra/outbound/deliver-channel.ts:54, 5dd4c6e3b087)
  • Caller and callback boundary inspected: Payload preparation reaches createChannelHandler, and the handler wrapper restores the captured registry when a prepared send occurs later. (src/infra/outbound/deliver-prepare.ts:50, 9671a44b6f7e)
  • Focused regression coverage: New tests cover scoped same-ID action selection, absent-capability fail-closed behavior, scoped setup activation, durable-capability selection, and deferred handler scope retention. (src/infra/outbound/channel-bootstrap.runtime.test.ts:419, 9671a44b6f7e)
  • Feature-history routing: The present outbound resolution and delivery files date to the recent area change f81afb2; earlier channel action-policy work includes fcb499a. The checkout lacks enough parent blobs to establish a precise original-line attribution beyond this routing signal. (src/infra/outbound/deliver-channel.ts:1, f81afb28435b)

Likely related people:

  • ruel225: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the selected-plugin fail-closed upgrade behavior and wait for exact-head CI to complete successfully.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 9d2f277 into main Sep 1, 2026
271 of 272 checks passed
@steipete
steipete deleted the codex/upgrade-outbound-registration-20260831 branch September 1, 2026 00:55
@steipete

steipete commented Sep 1, 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

docs Improvements or additions to documentation extensions: amazon-bedrock-mantle extensions: anthropic maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant