Skip to content

fix(discord): show full long clarify options - #73545

Open
merlincat11 wants to merge 2 commits into
NousResearch:mainfrom
merlincat11:fix/discord-long-clarify-options
Open

fix(discord): show full long clarify options#73545
merlincat11 wants to merge 2 commits into
NousResearch:mainfrom
merlincat11:fix/discord-long-clarify-options

Conversation

@merlincat11

@merlincat11 merlincat11 commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • Add a Full options embed field when any normalized Discord clarify option exceeds the existing 40 UTF-16-unit mobile-safe threshold.
  • Keep the current button labels, truncation, styles, custom IDs, callbacks, and plain-text mirror unchanged.
  • Keep short-option prompts unchanged.

Why this matters

Discord accepts button labels up to 80 UTF-16 units, but its mobile client can visibly clip labels much earlier. Today, the embed only says to pick a button, so a mobile user may be asked to choose among options they cannot fully read.

Mirroring complete numbered choices in the embed makes the decision readable without redesigning the interaction. The field is conditional, so ordinary short prompts retain their current compact presentation.

Before / after

Before

The native Discord mobile screenshot shows all three choice labels clipped with ellipses:

Discord mobile clipping long clarification option labels

Choices
Pick one below, or click ✏️ Other to type a custom answer.

[long option buttons may be clipped by Discord mobile]

After, only when an option exceeds 40 UTF-16 units

Choices
Pick one below, or click ✏️ Other to type a custom answer.

Full options
1. <complete first option>
2. <complete second option>
3. <complete third option>

[existing buttons remain unchanged]

The screenshot above is native Discord mobile evidence of the broken state. A native after-screenshot is not attached because this headless development environment cannot render the mobile client. The exact outgoing embed fields and unchanged button labels are asserted by the regression tests and were also exercised through the adapter's rendered payload.

Prior art / duplicate audit

Related open PR: #62291 addresses the same clipping symptom by changing every choice button to a numeric-only label and always mirroring choices. This PR is intentionally narrower: it preserves the existing buttons and adds full embed text only when a choice crosses the mobile-safe threshold.

How to test

scripts/run_tests.sh tests/gateway/test_discord_clarify_buttons.py -q

python -m ruff check \
  plugins/platforms/discord/adapter.py \
  tests/gateway/test_discord_clarify_buttons.py

python scripts/check-windows-footguns.py

Results:

  • Discord clarify suite: 21 passed through the repository test wrapper
  • Ruff: all checks passed
  • Windows footgun scan: 2 changed files scanned, no findings
  • git diff --check: clean

Platforms tested

  • Linux 6.8
  • Python 3.13
  • Discord adapter rendering through the repository's Discord test double

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins platform/discord Discord bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jul 28, 2026
@merlincat11
merlincat11 force-pushed the fix/discord-long-clarify-options branch from ec52807 to bf63375 Compare July 29, 2026 00:20

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for preserving the existing callbacks and button semantics while addressing a real mobile readability issue.

Problems

  • Blocking: plugins/platforms/discord/adapter.py:6813 creates Full options with an unbounded join. tools/clarify_tool.py:225-228 limits only choice count, not choice length, so a valid clarify call can exceed Discord's 1024-character embed-field value limit and cause the prompt send to fail. Add a field budget and cover the overflow boundary.
  • plugins/platforms/discord/adapter.py:6752-6773 states that interactive payloads must be mirrored in plain content because embeds can be invisible or separated from controls on web/mobile. The proposed change leaves clarify content unchanged, so those clients still lack readable full options. Mirror the numbered list into clarify_tail, bounded independently for message content.

Suggested changes

  • Cap the rendered embed field and reserve suffix space before truncation; add a long-options regression test.
  • Include the complete/bounded numbered options in the plain-content mirror and test that payload.

Automated hermes-sweeper review.

):
embed.add_field(
name="Full options",
value="\n".join(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: this join has no embed-field budget. clarify limits choice count but not individual choice length, so valid long choices can exceed Discord's 1024-character field-value limit and make the entire clarify send fail. Truncate the rendered list with room for any suffix and add an overflow-boundary test.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/discord Discord bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants