Skip to content

[Bug]: Discord final replies can still lose outbound adapter on 2026.6.1 #90162

Closed

Description

@hoyanhan

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

On stable 2026.6.1 (2e08f0f), Discord inbound handling and the agent turn completed, but final reply delivery failed with:

Error: Outbound not configured for channel: discord

The gateway was otherwise healthy, Discord status was OK, config validation passed, and @openclaw/discord@2026.6.1 was loaded. After a gateway restart, delivery recovery replayed the single pending Discord reply successfully.

This looks related to closed issues #77254, #84147, and especially #84568. I am filing a new issue because those reports are closed as fixed, while the current stable 2026.6.1 install and current main source still show the same risky active-registry fallback path in src/channels/plugins/registry-loader.ts.

Steps to reproduce

  1. Run OpenClaw 2026.6.1 with the official Discord plugin enabled and connected.
  2. Use Discord as an inbound channel and send a normal message that should produce a final assistant reply.
  3. Observe that the agent turn completes, but the final Discord reply is not posted.
  4. Check gateway logs for Outbound not configured for channel: discord.
  5. Restart the gateway and observe delivery recovery replay the pending Discord delivery.

Expected behavior

If Discord inbound is connected and the Discord plugin is loaded, final assistant replies should continue resolving the Discord outbound adapter and post to the originating Discord channel without requiring a gateway restart.

Actual behavior

The agent run completed, but final reply delivery failed:

[plugins] openclaw-mem0: skills-mode agent_end (no auto-capture)
[discord] final reply failed (target=<redacted> session=<redacted>): Error: Outbound not configured for channel: discord

After a gateway restart, the pending delivery recovered:

[delivery-recovery] Found 1 pending delivery entries — starting recovery
[delivery-recovery] Recovered delivery <redacted> on discord
[delivery-recovery] Delivery recovery complete: 1 recovered, 0 failed, 0 skipped (max retries), 0 deferred (backoff)

OpenClaw version

2026.6.1 (2e08f0f)

Operating system

Ubuntu 24.04 LTS, Linux x86_64

Install method

npm global, gateway launched as a systemd service

Model

gpt-5.5

Provider / routing chain

OpenClaw gateway -> OpenAI Codex runtime

Additional provider/model setup details

The model/provider path appears healthy. The failure happened after an agent turn had already produced output, and the failed surface was Discord final-reply delivery.

openclaw status --deep after restart showed Discord OK and the active session runtime as OpenAI Codex.

The Discord plugin was loaded as @openclaw/discord@2026.6.1 from the npm-project install. plugins inspect discord also reported a duplicate plugin-id warning from an older install/copy, but the active selected runtime was the npm-project Discord plugin.

Logs, screenshots, and evidence

Sanitized live checks:

openclaw --version
OpenClaw 2026.6.1 (2e08f0f)

curl /health
{"ok":true,"status":"live"}

openclaw config validate
Config valid: ~/.openclaw/openclaw.json

Current source inspection on main shows src/channels/plugins/registry-loader.ts still falls back from the channel registry to getActivePluginRegistry() after a channel-registry miss. That matches the root-cause family described in #84568.

Current src/infra/outbound/deliver.ts calls loadBootstrappedOutboundAdapter(), then resolveOutboundChannelMessageAdapter(), and throws Outbound not configured for channel: ${params.channel} when neither path yields a send-capable handler.

Current src/infra/outbound/channel-bootstrap.runtime.ts records a per-channel/per-registry bootstrap attempt before verifying that the resulting registry has a send-capable channel entry. Inference: if bootstrap resolves without making Discord send-capable, later retries can be skipped for the same registry version until process restart clears the attempt state.

Impact and severity

Affected: Discord users relying on final assistant replies.

Severity: High for Discord deployments because inbound messages can be processed and agent turns can complete, but the user-visible final response is not delivered until restart recovery.

Frequency: Observed once on stable 2026.6.1; the source path matches previously reported closed regressions.

Additional information

Related closed issues: #77254, #84147, #84568.

This report intentionally redacts Discord channel IDs, session keys, delivery IDs, message content, tokens, hostnames, IPs, file paths containing usernames, and local config details.

Activity

  1. clawsweeper commented on Jun 4, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 4, 2026, 12:44 AM ET / 04:44 UTC.

    Summary
    Keep open: current main and v2026.6.1 still contain the outbound registry fallback and one-shot bootstrap behavior implicated by the report, and the related reports in the provided context are closed rather than a canonical open fix path.

    Reproducibility: unclear. for a live current-main reproduction because this review did not run a Discord gateway, but source inspection verifies the reported registry fallback and delivery error path on both current main and v2026.6.1.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    This is a narrow, source-backed Discord outbound delivery regression with clear likely files and a focused regression-test path.

    Review details

    Best possible solution:

    Make final delivery resolve Discord outbound through a stable send-capable channel registry or loaded runtime plugin, invalidate failed non-send bootstrap attempts, and add a regression for the Discord-style setup/runtime registry split.

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

    Unclear for a live current-main reproduction because this review did not run a Discord gateway, but source inspection verifies the reported registry fallback and delivery error path on both current main and v2026.6.1.

    Is this the best way to solve the issue?

    Unclear as an implementation until a patch exists; the best fix should preserve required setup-shell bootstrap while removing stale active-registry or failed-bootstrap behavior from final delivery.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • I did not run a live Discord gateway reproduction in this read-only review, so the exact race/state transition remains source-reproducible rather than independently live-reproduced here.
    • A fix must preserve the legitimate setup-shell bootstrap case currently covered in src/infra/outbound/deliver.test.ts while preventing stale or non-send-capable active registries from satisfying final delivery.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against d901f85abbb7.

    Label changes

    Label changes:

    • add P1: The report describes a current stable release channel workflow where agent turns complete but final Discord replies are not delivered until restart recovery.
    • add impact:message-loss: The issue is specifically about user-visible Discord final replies being queued or missed instead of posted to the originating channel.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P1: The report describes a current stable release channel workflow where agent turns complete but final Discord replies are not delivered until restart recovery.
    • impact:message-loss: The issue is specifically about user-visible Discord final replies being queued or missed instead of posted to the originating channel.
    Evidence reviewed

    Acceptance criteria:

    • node scripts/run-vitest.mjs src/infra/outbound/deliver.test.ts
    • node scripts/run-vitest.mjs src/infra/outbound/channel-bootstrap.runtime.test.ts src/infra/outbound/channel-resolution.test.ts
    • node scripts/run-vitest.mjs src/channels/plugins/contracts/plugins-core.loader.contract.test.ts

    What I checked:

    • Current main registry fallback: createChannelRegistryLoader first reads the channel registry, then falls back to getActivePluginRegistry() when the channel registry miss returns no value; this matches the risky fallback family described in the issue. (src/channels/plugins/registry-loader.ts:27, d901f85abbb7)
    • Current main final-delivery failure path: createChannelHandler loads the bootstrapped outbound adapter, resolves the message adapter, and throws Outbound not configured for channel: ${params.channel} when neither path supplies a handler. (src/infra/outbound/deliver.ts:223, d901f85abbb7)
    • Current main bootstrap retry guard: bootstrapOutboundChannelPlugin records a per-registry/per-channel attempt before the loaded registry is later re-read by delivery; a non-throwing load that still does not yield a send-capable entry can skip later attempts until the registry version changes. (src/infra/outbound/channel-bootstrap.runtime.ts:41, d901f85abbb7)
    • Shipped v2026.6.1 has same central path: The v2026.6.1 tag still imports both getActivePluginChannelRegistry and getActivePluginRegistry and falls back from the channel registry to the active registry. (src/channels/plugins/registry-loader.ts:20, 2e08f0f4221f)
    • Prior fix history confirms the root-cause family: Commit bc9c074 removed active-registry lookup for outbound adapter resolution and described the same registry replacement failure mode; current source has since reintroduced a fallback form of that behavior. (src/channels/plugins/registry-loader.ts:1, bc9c074b2c17)
    • Adjacent tests intentionally cover a competing fallback case: deliver.test.ts currently expects delivery through a full active plugin when the pinned setup channel has no sender, so the repair must preserve legitimate setup-shell bootstrap behavior while avoiding stale active-registry loss. (src/infra/outbound/deliver.test.ts:338, d901f85abbb7)

    Likely related people:

    • steipete: Current blame for the outbound registry, bootstrap, delivery, channel-resolution, and Discord plugin surfaces in this checkout points to Peter Steinberger, and area shortlog shows heavy recent work across these paths. (role: recent area contributor; confidence: high; commits: 5169d19ce8c0, d901f85abbb7; files: src/channels/plugins/registry-loader.ts, src/infra/outbound/deliver.ts, src/infra/outbound/channel-bootstrap.runtime.ts)
    • GodsBoy: Authored the earlier pinned-channel-registry fix commit that describes the same active-registry replacement failure mode for outbound adapter resolution. (role: prior fix author; confidence: medium; commits: bc9c074b2c17; files: src/channels/plugins/registry-loader.ts)
    • vincentkoc: Area history shows substantial channel/outbound/plugin work and the v2026.6.1 release commit that shipped the currently reported behavior. (role: adjacent area contributor; confidence: medium; commits: 2e08f0f4221f; files: src/infra/outbound, src/channels/plugins, extensions/discord)
    How this review workflow works
    • 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.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 4, 2026
  3. locked as resolved and limited conversation to collaborators on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions