feat(discord): clear approval buttons after decision#768
Merged
Aaronontheweb merged 4 commits intodevfrom Apr 27, 2026
Merged
Conversation
…ng Slack behavior Discord approval buttons remained active after clicking — unlike Slack, which replaces the original message with a resolved status. Root cause was three gaps: PostReplyAsync didn't return the sent message ID, PendingApprovalRequest didn't store it, and IDiscordReplyClient had no message-update method. Changes: - Add MessageId to DiscordPostResult; capture from SendMessageAsync return - Add UpdateMessageAsync to IDiscordReplyClient using ModifyMessageAsync - Restructure PendingApprovalRequest to store ToolInteractionRequest + PromptMessageId - Add BuildResolvedPromptText for Discord-markdown resolved status rendering - Replace SafeReplyAsync(BuildDecisionStatus) with TryResolveApprovalPromptAsync in both button and text approval handlers
…ply client - Extract ResolveMessageChannelAsync in DiscordNetReplyClient to deduplicate the socket-cache + REST-fallback channel resolution between PostReplyAsync and UpdateMessageAsync - Cache empty MessageComponent as a static field instead of allocating per call - Extract AppendToolSummary in DiscordApprovalPromptBuilder to deduplicate tool/action/pattern rendering between BuildButtonPrompt and BuildResolvedPromptText - Fix redundant null-conditional on promptMessageId in catch block
Merged
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
UpdateMessageAsynctoIDiscordReplyClientusing Discord.Net'sModifyMessageAsyncAPISendMessageAsyncand track it inPendingApprovalRequestso the original prompt can be edited on resolutionTest plan
dotnet build— 0 warnings, 0 errorsdotnet test --filter "FullyQualifiedName~Discord"— 121 tests passdotnet test --filter "FullyQualifiedName~SessionBindingContract"— 48 contract tests pass (both Slack and Discord)