Repository navigation
fix(discord): suppress typing when hooks silently handle a turn - #108449
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 5:10 AM ET / 09:10 UTC. Summary PR surface: Source +24, Tests +288. Total +312 across 6 files. Reproducibility: yes. The PR provides a concrete scratch-plugin setup and real Discord baseline where a silent Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the lifecycle change after a current-head Discord run proves both that silent handled turns emit no typing and that accepted fast replies emit typing exactly once, with the refreshed head passing required checks. Do we have a high-confidence way to reproduce the issue? Yes. The PR provides a concrete scratch-plugin setup and real Discord baseline where a silent Is this the best way to solve the issue? Yes. Deferring the Discord-owned side effect until the shared reply-admission boundary preserves plugin-agnostic policy ownership, while the focused fast-reply fallback avoids a configuration workaround or duplicate hook policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5ad0d4d6c03d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +24, Tests +288. Total +312 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
67ff5db to
54afa50
Compare
54afa50 to
63204a8
Compare
63204a8 to
94d7c85
Compare
|
Maintainer deep review complete on Rewritten head deletes the preflight/queue typing-feedback lease, creates Discord feedback lazily only after shared dispatch admission, preserves admitted fast-final typing, and removes the stale queue-key export. Proof:
The PR-body Discord observer comparison remains the external behavior proof: suppressed turns emit neither typing nor reply; admitted controls emit both. |
|
Merged via squash.
|
…claw#108449) * fix(discord): defer typing until reply dispatch is accepted * fix(discord): preserve typing for accepted fast replies * refactor(discord): create typing feedback after admission * refactor(discord): keep queue key resolver internal --------- Co-authored-by: Peter Steinberger <[email protected]>
…claw#108449) * fix(discord): defer typing until reply dispatch is accepted * fix(discord): preserve typing for accepted fast replies * refactor(discord): create typing feedback after admission * refactor(discord): keep queue key resolver internal --------- Co-authored-by: Peter Steinberger <[email protected]>
…claw#108449) * fix(discord): defer typing until reply dispatch is accepted * fix(discord): preserve typing for accepted fast replies * refactor(discord): create typing feedback after admission * refactor(discord): keep queue key resolver internal --------- Co-authored-by: Peter Steinberger <[email protected]>
…claw#108449) * fix(discord): defer typing until reply dispatch is accepted * fix(discord): preserve typing for accepted fast replies * refactor(discord): create typing feedback after admission * refactor(discord): keep queue key resolver internal --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Discord could emit a typing indicator before shared
before_dispatchhooks decided whether a turn should produce a reply. A hook returning{ handled: true }could therefore leave users with a typing flash and no response.Why This Change Was Made
Typing is an externally visible reply side effect. Shared dispatch already owns admission, so Discord feedback now starts only when that admitted lifecycle reaches
onReplyStart. Silent pre-dispatch outcomes return before Discord allocates a feedback controller.User Impact
Silently handled Discord turns no longer show a misleading typing indicator. Admitted normal replies and deliverable fast replies still show typing.
typingMode: "never"and room-event suppression remain silent.Summary
Root Cause
Discord preflight owned a second typing policy before the canonical reply-admission boundary. The previous PR revision tried to preserve that controller as an inactive queue lease, then replaced it at dispatch. That plumbing did not own a useful runtime state and duplicated policy already expressed by shared dispatch.
The rewritten implementation has one owner: shared dispatch admits the turn, then Discord creates transport feedback on demand.
Evidence
Automated validation
Current rewritten head
94d7c85c7b1a54db6256c4d0e57dc935f7de6dc8:node scripts/run-vitest.mjs extensions/discord/src/monitor/message-handler.process.test.ts extensions/discord/src/monitor/message-handler.queue.test.ts extensions/discord/src/monitor/inbound-job.test.ts— 154 tests passed;node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts— 269 tests passed;node scripts/check-changed.mjs -- <touched paths>— format, API baseline, boundaries, core/extensions typechecks, core/extensions lint, and guards passed on Blacksmith Testbox;node scripts/run-vitest.mjs extensions/discord/src/monitor/inbound-job.test.ts— 5 tests passed after removing the stale public export;Real behavior proof
The original live Discord observer comparison used an exclusive scratch gateway and independent gateway-event observer. It demonstrated the behavioral invariant this rewrite preserves:
That observer run tested commit
67ff5db6b22ad91830e7fa61f3af65d0b82043a5. The rewritten current head removes the unused preflight/queue plumbing while current-head focused tests cover the same suppressed and admitted branches.Security Impact
No authentication, authorization, permission, token-handling, or plugin-trust boundary changes. The fix removes an observable presence leak from silently handled turns.
Compatibility
typingMode: "never"remain silent;Risks
Typing begins after queueing and admission rather than during preflight. That later boundary is intentional: it prevents silent-turn leakage. Fast-final coverage preserves the early cue for admitted replies that bypass the normal resolver callback.