fix(discord): always use autocomplete for slash command choices#32767
fix(discord): always use autocomplete for slash command choices#32767scoootscooob wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…claw#32753) Static choices force Discord's dropdown UI which sends null for typed-in values (e.g. /acp close). Switching to autocomplete lets users both pick from suggestions and type inline values. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Greptile SummaryThis PR fixes a Discord UX bug where slash commands with static choices (fewer than 25) sent Key changes:
Confidence Score: 4/5
Last reviewed commit: f5e524a |
Additional Comments (1)
Since Consider simplifying to: Or removing the Prompt To Fix With AIThis is a comment left during a code review.
Path: src/discord/monitor/native-command.ts
Line: 138-143
Comment:
**Dead code: `choices` is now always `undefined`**
Since `shouldAutocomplete` is now `resolvedChoices.length > 0`, the `autocomplete` variable is always defined whenever `resolvedChoices.length > 0`. This means the condition `resolvedChoices.length > 0 && !autocomplete` on line 139 can never be `true`, so `choices` will always be assigned `undefined`. The entire block is unreachable.
Consider simplifying to:
```suggestion
const choices = undefined;
```
Or removing the `choices` variable entirely and just passing `choices: undefined` (or omitting it) in the returned object. This would make the intent clearer and avoid confusion for future readers.
How can I resolve this? If you propose a fix, please make it concise. |
|
Superseded by #33136, which consolidates the /acp inline action autocomplete fix plus the bound-thread bot system message guard. Closing in favor of that PR. |
Summary
/acp close(and other commands with <25 static choices) sendsaction = nullbecause Discord's static dropdown UI doesn't pass through typed inline valuesbuildDiscordCommandOptionsto always useautocomplete: truewhen an arg has choices, regardless of countWhat did NOT change
inputargs) — unchangedresolveCommandArgMenu/ button picker fallback — unchanged, it correctly returnsnullwhenargs.values[argName] != nullTest plan
native-command.model-picker.test.tstests still passCloses #32753
🤖 Generated with Claude Code