discord: harden preflight/reply path against slow lookup latency#23158
Closed
danielstarman wants to merge 4 commits into
Closed
discord: harden preflight/reply path against slow lookup latency#23158danielstarman wants to merge 4 commits into
danielstarman wants to merge 4 commits into
Conversation
danielstarman
force-pushed
the
fix/discord-preflight-latency-22378
branch
3 times, most recently
from
February 22, 2026 08:05
98062db to
3f14c0e
Compare
danielstarman
force-pushed
the
fix/discord-preflight-latency-22378
branch
from
February 22, 2026 15:05
3f14c0e to
8e3e8c2
Compare
Author
|
Closing pull request and cleaning up branch as #22396 was merged in for this issue. |
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
Linked Issue
Closes #22378.
What Changed
channel_id.fire-and-forget) so reply dispatch is not delayed by typing REST latency.Scope
Changed files:
src/discord/monitor/message-handler.preflight.tssrc/discord/monitor/message-handler.process.tssrc/discord/monitor/message-utils.tssrc/discord/monitor/threading.tssrc/discord/pluralkit.tsValidation
pnpm buildpasses.pnpm checkpasses.pnpm testpasses.src/discord/monitor/message-handler.process.test.tssrc/discord/monitor/message-utils.test.tssrc/discord/pluralkit.test.tssrc/discord/monitor.tool-result.sends-status-replies-responseprefix.test.tssrc/discord/monitor/message-handler.preflight.test.tsRisk Notes
Transparency
pnpm build,pnpm check,pnpm test, plus targeted Discord suites).Context
Greptile Summary
Added timeout/abort handling to Discord channel and PluralKit lookups to prevent monitor flow from stalling when external APIs are slow. Guild messages now skip early channel REST lookup (payload-first fast path), PluralKit lookups retry with extended timeout on abort-like errors for bot messages, and reply typing starts fire-and-forget to avoid blocking dispatch. Thread binding detection now consistently uses
channel_idand checks binding presence rather thanthreadChannelexistence.Confidence Score: 4/5
message-utils.tsdoesn't callunref()conditionally, which could cause subtle issues in environments where it's not available.src/discord/monitor/message-utils.tsline 90 - theunref()call should be conditional.Last reviewed commit: 13e72ca
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!