fix(desktop): clarify options defensive rendering and layout fix - #69497
Closed
webtecnica wants to merge 1 commit into
Closed
fix(desktop): clarify options defensive rendering and layout fix#69497webtecnica wants to merge 1 commit into
webtecnica wants to merge 1 commit into
Conversation
- Replace undefined CSS class with Tailwind v4's so long choice text wraps properly instead of overflowing the button container. - Add validation that strips non-string items, blanks, newlines, and text >200 chars — preventing garbage/JSON arrays from rendering as raw values. - Add diagnostic logging at both the gateway event handler and the tool-args parser when choices are dropped, so malformed payloads are no longer silent. - Apply in both the gateway event handler () and the inline tool-args parser () for consistent defense in depth. - Add unit tests for covering null, non-array, mixed-type, blank, multiline, and overlong inputs. Closes NousResearch#69122
This was referenced Jul 23, 2026
Collaborator
|
Superseded by #69796 — cherry-picked so your authorship is preserved, then re-ported onto the merged |
Collaborator
Duplicate of active salvage #69796. It carries the same clarify-choice normalization mechanism onto the current component shape; this closed predecessor remains preserved for authorship and history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #69122 — clarify options rendering with wrong layout in the Desktop chat.
Root cause
The clarify choices
<span>usedwrap-anywhere, an undefined CSS utility class with no effect. Long choice text would overflow the button container instead of wrapping, causing visible layout breakage.Additionally, choices that did render could include garbage values (raw JSON arrays, nulls, multi-line strings) because there was no validation — they were only checked for
typeof === 'string'.Changes
Layout fix: Replace the non-functional
wrap-anywherewith Tailwind v4's[overflow-wrap:anywhere]so choice text wraps at any character boundary — preventing overflow on long options.Defensive choice normalization (
normalizeChoices): A new shared validation function instore/clarify.tsthat:Diagnostic logging:
console.warn('[clarify] ...')fires at both the gateway event handler and the tool-args parser when choices are present but none survive normalization — breaking the silent-failure pattern.Unit tests for
normalizeChoicescovering null, non-array, mixed types, blanks, multi-line, and overlong inputs.Files changed
normalizeChoices()validation functionnormalizeChoicesnormalizeChoicesinreadClarifyArgs; fix CSS class; add diagnosticsnormalizeChoicesin gateway handler; add diagnosticsTesting
normalizeChoices(8 cases)