fix(slack): validate Slack API responses and fix silent delivery drops#375
Merged
Conversation
#371) SlackReplyClient discarded the return value of Chat.PostMessage(), relying entirely on SlackNet to throw on ok:false. SlackNet's internal null-coalescing creates phantom Ok=true responses when the HTTP body is empty, causing delivery failures to be silently counted as successes. - Capture and validate PostMessage/Upload responses (null or empty Ts = throw) - Add SlackException catch + response validation to SlackOutboundClient - Add rate_limited error code mapping to TransportFailure - Replace dead PlainTextFallback counter with Rejected counter for ok:false - Separate Filtered counter from Dropped for bot-message/duplicate filtering - Update CLI stats display: posted/rejected/failed instead of posted/failed
… cases Review feedback: SlackBlockConverter.Convert() was outside the try block, so block conversion errors would escape as raw exceptions instead of being wrapped as SlackMessageDeliveryException. Also added missing_scope and no_permission to the MapFailureKind theory test coverage.
This was referenced Mar 21, 2026
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
Fixes #371 — Slack delivery errors silently swallowed in production.
SlackReplyClient.PostThreadReplyAsync()discarded the return value ofChat.PostMessage(), relying entirely on SlackNet to throw onok:false. SlackNet 0.17.9's internal null-coalescing creates phantomOk=trueresponses when the HTTP body is empty, causing delivery failures to be silently counted as successes.PostMessage/Uploadresponses — null or emptyTsthrowsSlackMessageDeliveryExceptionwithphantom_successerror codeSlackExceptioncatch + response validation toSlackOutboundClient(previously had zero error handling)rate_limited→TransportFailuremapping; movedSlackBlockConverter.Convert()inside try blocks so block conversion errors are properly wrappedPlainTextFallbackcounter withRejectedcounter forok:falseresponses; separatedFiltered(bot self-messages, duplicates) fromDropped(real message drops)netclaw statsnow showsposted/rejected/failedinstead ofposted/failed/plain_text_fallbackBreaking changes
DaemonStats.SlackActivityandDaemonRuntimeStatus.SlackCounterswire types: removedRepliesPlainTextFallback, addedRepliesRejected. CLI and daemon ship together so version skew is not a concern.Test plan
dotnet slopwatch analyze— zero violationsmsg_too_longin production → verifyrejectedcounter increments,DeliveryFailedreaches session, LLM retries with shorter output