fix(admin): surface inactivity-warn thread addMember failures - #27
fix(admin): surface inactivity-warn thread addMember failures#27SebTardif wants to merge 1 commit into
Conversation
Await thread.addMember for /admin inactivity-warn. When Discord rejects the add, still create the thread and send the warning, but reply with the addMember failure instead of claiming unqualified success. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 1:39 AM ET / 05:39 UTC. ClawSweeper reviewWhat this changesThe PR waits for private-thread membership in Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain This PR remains necessary: current main still swallows a rejected private-thread membership request and reports unqualified success. It needs the repository-required Carbon v2 response and real Discord-boundary proof before merge. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherThe admin command creates a private Discord warning thread, tries to add the invoking staff member, posts the warning, and returns an ephemeral result. The result determines whether staff know they can follow the new private thread. flowchart LR
A[Admin runs inactivity warning] --> B[Create private warning thread]
B --> C[Add invoking staff member]
C --> D[Post warning message]
D --> E[Send ephemeral result]
C --> F[Membership rejected]
F --> E
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Convert the introduced partial-result response to Carbon v2 components and attach redacted after-fix proof from a real Discord private-thread membership failure while preserving thread creation and warning delivery. Do we have a high-confidence way to reproduce the issue? Yes in source: if Discord rejects Is this the best way to solve the issue? No; awaiting the membership call is the narrow fix, but the introduced result must use the repository’s Carbon v2 response convention and needs real Discord-boundary evidence. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e360e25a5a75. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
What Problem This Solves
Fixes an issue where Discord admins running
/admin inactivity-warnwould be told the private warning thread was created as a complete success even when Discord rejectedaddMember(missing permissions, thread membership API error). The thread and warning message still exist, but the staffer who ran the command is not in the private thread.That false success is worse than a failed command: staff think they can see and follow the warning thread when they cannot.
Why This Change Was Made
/admin inactivity-warnnow waits forthread.addMemberto finish. The private thread and warning message are still created when membership fails. The ephemeral reply then reports that partial result (Failed to add you to the thread) instead of the unqualified created-thread sentence./admin automod-bypass-toggleis unchanged.User Impact
Admins get an accurate private reply about whether they were added to the inactivity warning thread. A Discord API failure no longer looks like a completed staff follow-up.
Evidence
Live
bunrun of/tmp/proof-hermit-addmember.tsagainst this branch. The script calls the previous fire-and-forget handler and the patchedInactivityWarn.runwith a thread whoseaddMemberthrowsMissing Permissions, then prints the command replies.Before this patch the command always printed the unqualified created-thread sentence. After the patch a rejected
addMemberstill creates the thread, then printsFailed to add you to the thread. The unqualified sentence is reserved for a resolved membership add.Real behavior proof
Behavior or issue addressed:
/admin inactivity-warnreported that the inactivity warning thread was created even when Discord rejected adding the staffer to that private thread, so staff could think they were in the thread when they were not.Real environment tested: macOS 26.6.1 Darwin 25.6.0 arm64, Node v26.7.0, bun 1.3.14, patched checkout
/tmp/oc-impl-hermit-addmemberonfix/inactivity-warn-addmember-errors(base97d3731).Exact steps or command run after this patch:
Evidence after fix: terminal output from the patched command class:
Observed result after fix: A rejected
addMembernow replies that the thread was created andFailed to add you to the thread(ephemeral). The unqualified created-thread sentence is printed only after membership add resolves.What was not tested: A live Discord guild with a real private-thread permission error. The automod-bypass role path is unchanged.
Origin
The silent
thread.addMember(actorId).catch(() => { })landed inae6ce064(Remove legacy review locks and Shadow references, 2026-07-25) and has been present for 21 days. The discarded Discord error was followed by the unqualified created-thread reply.