Repository navigation
fix(discord): honor reply visibility for session-busy notices - #135444
Conversation
Use the prepared reply mode when completing exhausted session conflicts, recording delivered or suppressed outcomes before ingress settlement. Preserve retryability when an allowed terminal notice fails to send. Cover ambient, message-tool, direct, downstream suppression, and replay cases.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 2:55 PM ET / 18:55 UTC. ClawSweeper reviewWhat this changesThe PR makes Discord’s exhausted session-busy notice follow the prepared reply-visibility policy and records whether it was delivered or intentionally suppressed. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review. The active PR repairs a current-main Discord reply-policy gap, has no actionable correctness finding, and carries sufficient Gateway-backed channel proof. Priority: P2 Review scores
Verification
How this fits togetherDiscord’s inbound monitor prepares whether a turn may post automatic replies before dispatch. If session initialization exhausts its retries, the terminal conflict helper either sends a permitted notice or records a suppression before ingress settles the event. flowchart LR
A[Discord inbound turn] --> B[Prepare reply visibility]
B --> C[Initialize and dispatch session]
C --> D{Retries exhausted?}
D -->|yes| E[Conflict completion]
E --> F{Automatic reply allowed?}
F -->|yes| G[Send final notice]
F -->|no| H[Record suppression]
G --> I[Settle ingress event]
H --> I
Before merge
Agent review detailsSecurityNone. PR surfaceSource +7, Tests +65, Docs +2. Total +74 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the focused owner-boundary repair so all terminal conflict notices obey the already prepared reply policy while failed permitted notices remain retryable. Do we have a high-confidence way to reproduce the issue? Yes: the supplied deterministic harness targets the exhausted session-conflict path, and source inspection confirms the current helper bypasses the prepared quiet-reply mode. Is this the best way to solve the issue? Yes: passing the already prepared delivery mode to the terminal conflict owner avoids policy recomputation and retains the existing failure retry behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f512082aa343. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…aw#135444) Use the prepared reply mode when completing exhausted session conflicts, recording delivered or suppressed outcomes before ingress settlement. Preserve retryability when an allowed terminal notice fails to send. Cover ambient, message-tool, direct, downstream suppression, and replay cases.
Closes #135442
What Problem This Solves
Fixes an issue where operators using Discord ambient room events or message-tool visible replies could receive unsolicited session-busy warnings after session initialization exhausted its retries. The normal reply path respected the selected visibility policy, but the terminal conflict notice bypassed it.
Why This Change Was Made
The existing Discord conflict-completion owner now consumes the prepared source reply mode and returns a delivered or suppressed outcome. Its caller records the exhausted conflict and outcome before the ingress owner settles the event. A failed allowed notice still throws so the existing ingress retry can recover it; downstream suppression is recorded accurately too.
This removes the one-use conflict-classification wrapper and replaces the old boolean completion assumption with an explicit outcome. Production changes are +21/-14 (net +7), covering the policy input and terminal outcome record; tests are +71/-6 and docs +2. The repair adds no configuration, schema, or retry policy.
User Impact
Ambient and message-tool-only turns remain quiet when their session stays busy, with an explicit failure and suppression record in Gateway logs. Automatic replies retain the existing visible session-busy warning. Both handled outcomes complete ingress processing, while an allowed notice that fails to send remains retryable.
Evidence
joinIntro: falseoption to keep the separate fresh-guild welcome turn out of the provider-count assertion. Test-only endpoint adapters route Discord REST and the WebSocket handshake to loopback; the fixture rejects other TCP destinations. The production Gateway build is unchanged by the harness.OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build sourcePerformance(exit 0). The reviewed working-tree patch was tested on base91067e340a1811f94a3f119fae329542c3f23872; its diff SHA-256 is5b2ce2bbc72d6b5124b5bbc072d878de091c639b21c51979e5c5e534c773b51e.86e273da9ddcbad764efb9eb89c5944844aae3dd.{ "kind": "discord-conflict-visibility-mock-gateway", "status": "pass", "gateway": "actual ephemeral built Gateway", "channel": { "driver": "crabline", "live": false }, "provider": { "fixture": "mock-openai", "live": false }, "cases": [ { "name": "ambient-room-event", "casConflicts": 40, "messagePosts": 0, "outcome": "suppressed", "ingress": "completed" }, { "name": "mentioned-message-tool-group", "casConflicts": 40, "messagePosts": 0, "outcome": "suppressed", "ingress": "completed" }, { "name": "direct-automatic-notice", "casConflicts": 40, "messagePosts": 1, "outcome": "delivered", "ingress": "completed" }, { "name": "failed-direct-notice-retry", "casConflicts": 80, "failedPosts": 3, "retryPendingObserved": true, "messagePosts": 1, "ingress": "completed" }, { "name": "normal-provider-turn-after-conflicts", "providerRequests": 1, "reply": "DISCORD_CONFLICT_RECOVERED", "ingress": "completed" } ], "cleanup": "all owned services confirmed stopped", "sourceHashesUnchanged": true }Related work: #109902 addresses the shared conflict classifier; #121204 addresses stale ambient backlog ordering. Neither changes this terminal-notice visibility boundary.