Skip to content

fix(gateway): normalize false reply mode at config boundary#29640

Closed
wesleysimplicio wants to merge 1 commit into
NousResearch:mainfrom
wesleysimplicio:codex/fix-discord-reply-mode-false
Closed

fix(gateway): normalize false reply mode at config boundary#29640
wesleysimplicio wants to merge 1 commit into
NousResearch:mainfrom
wesleysimplicio:codex/fix-discord-reply-mode-false

Conversation

@wesleysimplicio

@wesleysimplicio wesleysimplicio commented May 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Normalizes legacy reply_to_mode: false gateway config values to the explicit reply mode off before Discord adapter initialization.

Root cause

PlatformConfig.from_dict() preserved boolean False for reply_to_mode. DiscordAdapter then treated that falsy value as missing and fell back to first, which made Discord replies reference the triggering message again.

Fix

  • Adds a shared reply-mode normalizer in gateway config loading.
  • Maps boolean False and string "false" to "off" for backward compatibility.
  • Preserves the existing "first" default for missing or unsupported values.
  • Adds a Discord regression test proving PlatformConfig.from_dict() passes off through to the adapter.

Why this shape

This is the narrow config-boundary patch: it normalizes the legacy value where PlatformConfig.from_dict() accepts external configuration and keeps the Discord adapter receiving an explicit string mode.

PR #29639 is the broader/superset fix for the same issue because it also adds defensive normalization in Discord and Telegram adapters. If maintainers prefer that broader shape, this PR should be closed in favor of #29639 rather than merged as a competing duplicate.

Tests

  • git diff --check -- gateway/config.py tests/gateway/test_discord_reply_mode.py
  • python -m py_compile gateway\config.py
  • python -m pytest tests/gateway/test_discord_reply_mode.py tests/gateway/test_config.py -q -o addopts= -p no:xdist — 82 passed.
  • python -m ruff check gateway\config.py tests\gateway\test_discord_reply_mode.py

Related PRs / issues

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter labels May 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix with #29639 — both address #29623. PR #29639 is a superset (also normalizes in Discord and Telegram adapters defensively, adds more tests).

@wesleysimplicio wesleysimplicio changed the title fix(gateway): normalize false reply mode fix(gateway): normalize false reply mode at config boundary May 21, 2026
@wesleysimplicio

wesleysimplicio commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for pointing this out. I updated the PR body to make the overlap explicit: this is the narrow config-boundary patch, while #29639 is the broader/superset fix for the same #29623 issue.

If maintainers prefer the broader adapter-defensive approach in #29639, this PR should be closed in favor of that one rather than treated as a competing duplicate.

@wesleysimplicio

Copy link
Copy Markdown
Contributor Author

Fechando este PR como duplicado — @alt-glitch confirmou que #29639 (por @xxxigm) é um superset que também normaliza nos adapters Discord e Telegram, além da borda de config que este PR cobria.

Obrigado pela revisão! cc #29639

This was referenced May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/discord Discord bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants