Skip to content

fix(discord): honor statusReactions.enabled=true in tool-only guild channels - #76514

Closed
Marvinthebored wants to merge 2 commits into
openclaw:mainfrom
Marvinthebored:fix/discord-status-reactions-tool-only-channels
Closed

Marvinthebored wants to merge 2 commits into
openclaw:mainfrom
Marvinthebored:fix/discord-status-reactions-tool-only-channels

Conversation

@Marvinthebored

Copy link
Copy Markdown
Contributor

Root cause

The 5.2 "allow explicit ack reactions in tool-only guild channels" change (#74922/#58986) made the initial queued emoji (👀) appear in guild channels with message_tool_only source delivery, but it did so via the raw reactionAdapter.setReaction() fallback path.

statusReactionsEnabled in message-handler.process.ts was still gated on !sourceRepliesAreToolOnly:

const statusReactionsEnabled =
  !sourceRepliesAreToolOnly &&      // <-- kills the state machine for guild channels
  shouldSendAckReaction &&
  cfg.messages?.statusReactions?.enabled !== false;

Guild channels are message_tool_only by default (unless groupChat.visibleReplies: "automatic"), so users with statusReactions.enabled: true got the queued 👀 but no subsequent transitions — thinking, tool, error, done never fired.

Fix

Allow statusReactions.enabled: true to override the !sourceRepliesAreToolOnly guard:

const statusReactionsExplicitlyEnabled = cfg.messages?.statusReactions?.enabled === true;
const statusReactionsEnabled =
  shouldSendAckReaction &&
  cfg.messages?.statusReactions?.enabled !== false &&
  (!sourceRepliesAreToolOnly || statusReactionsExplicitlyEnabled);

Default behavior is unchanged: guild channels in tool-only mode still get no statusReactions unless the user explicitly opts in.

Test

Added a test case: guild channel (default message_tool_only delivery) with statusReactions.enabled: true — verifies the thinking emoji fires in addition to the initial queued emoji.

Fixes #75458 regression introduced in #74922.

🤖 Generated with Claude Code

Peetiegonzalez and others added 2 commits May 3, 2026 11:14
The gateway model catalog refresh calls loadModelCatalog without
readOnly, triggering ensureOpenClawModelsJson (60-70s), full PI SDK
registry instantiation, auth storage discovery, and live provider
plugin augmentation on every Control UI list/refresh. None of this
is needed for a read-only UI listing.

Three changes:

1. Gateway catalog refresh now passes readOnly: true to loadModelCatalog.
2. In readOnly mode, skip augmentModelCatalogWithProviderPlugins — live
   provider discovery is explicit admin/background work, not a UI list
   operation.
3. Add a persisted models.json fast path: when readOnly is true, first
   try reading the existing models.json directly and converting
   providers.<provider>.models[] to catalog rows. Falls back to the
   full PI registry path if the file is missing or unreadable.

Observed improvement on a production install:
  loadGatewayModelCatalog: 967 entries / 4651ms → 89 entries / 8ms
  Live models.list during startup: ~18s → ~2s

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…hannels

The 5.2 "allow explicit ack reactions in tool-only guild channels" change
(#74922) wired the initial queued emoji via the raw reactionAdapter fallback
path, but left statusReactionsEnabled gated on !sourceRepliesAreToolOnly.
Guild channels with message_tool_only source delivery (the default when
groupChat.visibleReplies is not "automatic") therefore got the queued 👀
but no subsequent state transitions (thinking, tool, error, done).

Allow the statusReactions state machine to run in tool-only channels when
statusReactions.enabled is explicitly true, matching the user's intent.
Default behavior (no statusReactions in tool-only channels) is unchanged.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord gateway Gateway runtime agents Agent runtime and tooling size: S labels May 3, 2026
@clawsweeper

clawsweeper Bot commented May 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

Summary
The PR enables explicit Discord lifecycle status reactions in message-tool-only guild channels, adds a focused regression test, and also carries gateway model-catalog read-only fast-path changes.

Reproducibility: yes. from source inspection: a current-main Discord guild context defaults to message_tool_only, and statusReactionsEnabled is still gated off by !sourceRepliesAreToolOnly. The proposed test path should reproduce this by enabling messages.statusReactions.enabled: true and triggering onReasoningStream.

Next step before merge
A narrow repair can rebase or replace the PR with only the Discord fix, add the required changelog entry, and preserve current main's already-landed model-catalog work.

Security
Cleared: The diff adds no dependencies, workflow changes, package resolution changes, or new secret-handling surface; the stale model-catalog changes are functional cleanup concerns, not a concrete security regression.

Review findings

  • [P2] Drop the already-merged model-catalog changes — src/gateway/server-model-catalog.ts:43
  • [P3] Add the required changelog entry — extensions/discord/src/monitor/message-handler.process.ts:177-183
Review details

Best possible solution:

Rebase or replace the branch so it contains only the Discord status-reaction change, its regression test, and a changelog entry while preserving current main's model-catalog implementation.

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

Yes, from source inspection: a current-main Discord guild context defaults to message_tool_only, and statusReactionsEnabled is still gated off by !sourceRepliesAreToolOnly. The proposed test path should reproduce this by enabling messages.statusReactions.enabled: true and triggering onReasoningStream.

Is this the best way to solve the issue?

No as submitted. The Discord boolean change is the narrow maintainable fix and matches Slack's explicit opt-in pattern, but the PR also carries stale model-catalog work and lacks the required changelog entry.

Full review comments:

  • [P2] Drop the already-merged model-catalog changes — src/gateway/server-model-catalog.ts:43
    This PR still carries the older model-catalog fast-path commit even though current main already landed fix(gateway): read-only persisted fast path for models.list catalog #76406 with additional fixes for read-only/full cache separation and persisted-row defaults. Please rebase or replace the branch so these files stay as they are on main and only the Discord status-reaction fix remains.
    Confidence: 0.9
  • [P3] Add the required changelog entry — extensions/discord/src/monitor/message-handler.process.ts:177-183
    This is a user-facing Discord behavior fix, so repo policy requires an Unreleased CHANGELOG.md entry before merge. Add a single-line Fixes entry for explicit messages.statusReactions.enabled: true in tool-only Discord guild channels, with appropriate human attribution.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.86

Acceptance criteria:

  • pnpm test extensions/discord/src/monitor/message-handler.process.test.ts
  • pnpm exec oxfmt --check --threads=1 extensions/discord/src/monitor/message-handler.process.ts extensions/discord/src/monitor/message-handler.process.test.ts CHANGELOG.md
  • pnpm check:changed via Testbox if the maintainer promotes the repair branch

What I checked:

Likely related people:

  • Peter Steinberger: Local blame in this grafted checkout attributes the current Discord status-reaction gate in processDiscordMessage to the current-main history, making this a reasonable routing candidate with limited confidence. (role: current-main maintainer; confidence: low; commits: 0135071833; files: extensions/discord/src/monitor/message-handler.process.ts)
  • @thewilloftheshadow: The changelog credits the original Discord/Telegram lifecycle status-reactions feature to @thewilloftheshadow and @wolly-tundracube, which is the behavior this PR adjusts. (role: adjacent feature-history owner; confidence: low; files: src/channels/status-reactions.ts, extensions/discord/src/monitor/message-handler.process.ts)
  • @wolly-tundracube: The changelog credits the original Discord/Telegram lifecycle status-reactions feature to @wolly-tundracube and @thewilloftheshadow, which is the behavior this PR adjusts. (role: adjacent feature-history owner; confidence: low; files: src/channels/status-reactions.ts, extensions/discord/src/monitor/message-handler.process.ts)
  • Marvinthebored: Current main includes the already-merged fix(gateway): read-only persisted fast path for models.list catalog #76406 model-catalog fast path authored by Marvinthebored, which is the stale unrelated work still carried by this PR branch. (role: recent adjacent maintainer; confidence: high; commits: 73a95d3af4ef; files: src/agents/model-catalog.ts, src/gateway/server-model-catalog.ts)

Remaining risk / open question:

  • The PR head is currently not mergeable and includes stale model-catalog changes already landed on main; conflict resolution must preserve main's fix(gateway): read-only persisted fast path for models.list catalog #76406 implementation.
  • No tests were run because this was a read-only review; the Discord regression test and targeted formatter check still need to pass before merge.
  • The user-facing Discord fix needs an Unreleased changelog entry before landing.

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

@steipete

steipete commented May 3, 2026

Copy link
Copy Markdown
Contributor

Superseded by #76733.

@steipete steipete closed this May 3, 2026
@steipete

steipete commented May 3, 2026

Copy link
Copy Markdown
Contributor

A little more context on the close: #76733 is the clean maintainer replacement for this PR. It keeps the Discord status-reaction boolean fix, the regression coverage, and the changelog entry, while omitting the stale model-catalog files that had already landed separately on main.

Thanks again for the root-cause write-up and focused test idea; I carried that credit forward in #76733 and the changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord status reactions can leave permanent thinking emoji after completion

3 participants