Repository navigation
fix(channels): Slack stops receiving messages while reporting healthy when its plugin is not a trusted install - #114998
Conversation
…enied An untrusted channel plugin cannot open its durable ingress queue, but the shared ingress monitor resolved the queue lazily, so start() armed the poll timer anyway and every tick re-invoked the throwing factory. On a production gateway that produced one INFO-level "slack ingress drain failed" line per second for 26+ hours while Slack reported connected and healthy and every inbound event was silently dropped. Open the queue before arming the poll timer so an unusable monitor fails channel start through the caller instead of spinning. Also report the actual denied capability: openChannelIngressQueue and openSyncKeyedStore both announced themselves as openKeyedStore, and the message named neither the plugin nor its origin.
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 2:36 AM ET / 06:36 UTC. ClawSweeper reviewWhat this changesThe PR opens a channel plugin’s durable ingress queue before polling begins, so a trust-gate denial fails channel startup rather than silently dropping inbound messages and repeatedly logging drain errors. Merge readiness⛔ Blocked until real behavior proof is added - 5 items remain This is a targeted fix for a real message-delivery failure mode: an untrusted channel plugin can appear healthy while its durable ingress queue repeatedly fails. The branch’s fail-fast approach is plausible and preserves the existing trust boundary, but it changes shared channel startup behavior and needs maintainer confirmation plus after-fix runtime proof before merge. Priority: P1 Review scores
Verification
How this fits togetherChannel plugins accept transport events and place them into a durable ingress queue before the shared inbound-reply flow processes them. The plugin runtime grants that queue only to bundled or trusted official installations, so a denied queue must be surfaced to channel startup rather than treated as a usable connected channel. flowchart LR
A[Channel plugin install] --> B[Plugin runtime trust check]
B --> C[Durable ingress queue]
C --> D[Ingress monitor startup]
D --> E[Inbound event drain]
E --> F[Agent reply flow]
B -->|queue denied| G[Actionable channel startup failure]
D -->|queue unavailable| G
Decision needed
Why: The code path is shared across channel plugins and deliberately changes the operator-visible lifecycle for improperly installed external plugins; the repository’s compatibility guidance calls for explicit review of startup and fallback behavior. Before merge
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +36, Docs 0. Total +44 across 5 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep the trust restriction intact, make an unavailable durable ingress queue a clear failed channel state, and add redacted live proof that an untrusted Slack load fails visibly while a properly installed Slack plugin receives an inbound event. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with medium confidence: the supplied regression test models a queue factory that throws during startup and verifies that current monitor behavior would otherwise arm polling. The reported real Slack scenario still needs after-fix runtime evidence in a single-connection setup. Is this the best way to solve the issue? Unclear pending maintainer confirmation. Failing the existing startup path is narrower and safer than weakening the trust gate, but the shared lifecycle change should be explicitly accepted rather than inferred from the Slack case alone. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d6096f36e45f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
@clawsweeper re-review Rank-up moves applied: Add real behavior proof — done. The PR body now carries a before/after/control
Merge risk: startup outcome changes for every channel on the shared monitor — the Merge risk: evidence lacked after-fix runtime output — covered by the same transcript. Decision needed: fail-fast startup vs. an explicit unhealthy channel state — taking Remaining gap, stated plainly: no live Slack round trip. Restoring inbound on the |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
…enied (openclaw#114998) An untrusted channel plugin cannot open its durable ingress queue, but the shared ingress monitor resolved the queue lazily, so start() armed the poll timer anyway and every tick re-invoked the throwing factory. On a production gateway that produced one INFO-level "slack ingress drain failed" line per second for 26+ hours while Slack reported connected and healthy and every inbound event was silently dropped. Open the queue before arming the poll timer so an unusable monitor fails channel start through the caller instead of spinning. Also report the actual denied capability: openChannelIngressQueue and openSyncKeyedStore both announced themselves as openKeyedStore, and the message named neither the plugin nor its origin.
What Problem This Solves
Fixes an issue where operators running a channel plugin that is not a trusted install
would have that channel silently stop receiving messages while the gateway kept
reporting it as connected and healthy, and while the gateway log filled with one
"ingress drain failed" line per second, forever.
Observed on a production gateway (latest
main, Slack over Socket Mode):slack ingress drain failed: openKeyedStore is only available for trusted plugins in this release.logLevelId: 3) despite saying "failed", so nothing could ever alert on it.enabled, configured, running, connected, health:healthy.slack socket mode connectedappears.The apparent 04:00:00.833Z onset was a red herring: the host rotates logs at local
midnight (UTC-4), the first line of the new file is 04:00:00.450Z, and the previous
day's file opens at 04:00:00.333Z with the same error. The condition was continuous.
Why This Change Was Made
openChannelIngressQueueis documented as available only to bundled plugins andtrusted official installs. Slack ships as an official external plugin
(
@openclaw/slack), so a copy loaded throughplugins.load.pathsfrom a sourcecheckout is correctly untrusted and the capability is correctly denied. The denial is
not the defect — the handling of it is.
createChannelIngressMonitorresolved its durable queue lazily, sostart()armed thepoll timer without ever touching the queue. Every subsequent tick called the throwing
factory again, and the shared pump routed the rejection into
onError, which channelswire to their ordinary log. A permanently unusable monitor therefore presented as an
endless stream of low-severity noise instead of a failed channel: no drain, no
admission, no visible failure.
The monitor now opens the queue before arming the poll timer, so a monitor that cannot
work fails channel start through the caller — the existing path for "this channel could
not start" — rather than running a timer that reports the same unrecoverable error
86,400 times a day. This is shared behavior across the 18 channel plugins built on this
monitor; for a bundled or trusted install the factory never throws and nothing changes.
The trust gate itself was also misreporting:
openChannelIngressQueueandopenSyncKeyedStoreboth announced themselves asopenKeyedStore, and the messagenamed neither the plugin nor where it was loaded from — so the log blamed an API Slack
never calls, on an unnamed plugin. It now names the denied capability, the plugin id,
its origin, and the remediation.
Deliberately not changed: the trust classification. Widening it to silence the log
would hand shared-state access to any sideloaded plugin. The correct operator fix is to
install the plugin from its official npm package or ClawHub listing.
User Impact
A channel plugin that cannot open its durable ingress queue now fails to start with an
actionable error naming the plugin, its origin, and how to fix it, instead of appearing
healthy while dropping every inbound message and writing ~86k INFO log lines a day.
Trusted and bundled channels are unaffected.
Operational remedy for anyone already in this state: install the plugin properly so it
carries an install record and a trusted origin — for Slack,
openclaw plugins install @openclaw/slack— then remove the correspondingplugins.load.pathsentry fromopenclaw.jsonand restart the gateway. Inbound delivery resumes once the plugin loadswith a trusted origin. This change makes that state loud rather than silent; it does not
by itself restore a source-linked install.
Known confound when verifying on a live workspace: if several hosts connect with the
same Slack app token, Slack shards Socket Mode events across those connections and
delivers each event to only one of them. The affected gateway logged
slack socket mode reports 9 active connections for this Slack app. A tester can seeevents vanish for reasons unrelated to ingress, so confirm a single active connection
before drawing conclusions.
Evidence
After-fix runtime proof
Real Node process against the production seams —
createPluginRegistrybuilds a pluginrecord with
origin: "config"exactly as the affected host loads Slack, the queuefactory is the same
api.runtime.state.openChannelIngressQueue({ accountId })call theSlack plugin makes at
extensions/slack/src/monitor/ingress.ts:235, and the monitor usesSlack's 1000 ms
pollIntervalMs. IsolatedOPENCLAW_STATE_DIR, no credentials, nonetwork, nothing redacted because nothing sensitive is produced.
Before (this branch reverted to
mainbehavior) — reproduces the production symptom:One line per second,
isRunning=true, inbound silently rejected — the same shape as theproduction log.
After (this branch):
One actionable failure naming the plugin, its origin, and the remedy; zero interval spam.
Trusted path unchanged — same script, same branch,
origin: "bundled":The queue opens, the monitor runs, and an inbound event is admitted. This is the path all
18 channel plugins on the shared monitor take for a bundled or trusted-official install,
and it is byte-identical to
main.Remaining gap: no live Slack round trip. Restoring inbound on the affected host requires
installing
@openclaw/slackas a trusted package on a production gateway, which is aconfiguration change outside this PR.
Other proof
across the full retained window (2026-07-27T04Z through 2026-07-28T05Z) showing a flat
~3,550/hour with no onset boundary, plus the log-rotation timestamps that explain the
apparent 04:00 trigger.
src/channels/message/ingress-monitor.test.ts:start()throws, the monitor does not run, the factory is invoked exactly once across a window
covering 25 poll ticks,
onErroris never called, andadmit()still fails closed.This test fails on
main, wherestart()returns cleanly and the timer spins.src/plugin-state/plugin-state-store.runtime.test.tslockingthe denial message to the actual capability name plus the plugin id and origin; the
existing
openSyncKeyedStoreassertion was corrected fromopenKeyedStore.node scripts/run-vitest.mjs.node scripts/check-changed.mjsgreen on Blacksmith Testbox (typecheck core, typecheckcore tests, lint, format, plugin boundaries, SDK contract manifest).