fix(discord): notify user on discord when inbound worker times out.#40819
fix(discord): notify user on discord when inbound worker times out.#40819Kimbo7870 wants to merge 4 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a UX gap where Discord users received no feedback when the Key changes:
The implementation is clean, well-scoped, and the logic is correct. The Confidence Score: 4/5
Last reviewed commit: 41cae55 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41cae55749
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Triage resultQuick read
Intent
Why
AI review
CI/CD
Recommendation🏁 continue autonomously What I would do next is:
If that updated branch stays as scoped as this one, I would not send it back for human attention just because of the repo drift. |
|
I rebased this fix locally onto current Replacement PR: What changed in the replacement:
Validation run on the rebased branch:
|
|
I had to recreate this on a branch I can actually update. That replacement keeps the same contributor-authored commits and author info on top of current
I do not have permission to close #40819 from this account, so the PR itself still has to be closed by someone with write access. |
Summary
Describe the problem and fix in 2–5 bullets:
channels.discord.inboundWorker.runTimeoutMSis set to a time that's smaller thanagents.defaults.timeoutSeconds, and the time expires while a model is processing, it times out without notifying the user on Discord.Change Type (select all)
Scope (select all touched areas)
User-visible / Behavior Changes
Discord users now receive a timeout reply when the Discord inbound worker times out before a final response is delivered.
The timeout reply is:
Discord inbound worker timed out.Security Impact (required)
Yes/No) NoYes/No) NoYes/No) YesYes/No) NoYes/No) NoYes, explain risk + mitigation: The worker-timeout path now sends one outbound Discord reply when no final reply has already started. It reuses the existing Discord reply delivery path and resolved reply target, including auto-thread targets, and suppresses the fallback once final reply delivery has started.Repro + Verification
Environment
Steps
openclaw.json, either setagents.defaults.timeoutSecondsto something larger than 1800, becausechannels.discord.inboundWorker.runTimeoutMSdefaults to 30 minutes, or setchannels.discord.inboundWorker.runTimeoutMSto something smaller like25000andagents.defaults.timeoutSecondsto something bigger like35for quicker testing.channels.discord.inboundWorker.runTimeoutMS < agents.defaults.timeoutSeconds(besides 0), then send a prompt on Discord that takes longer thanchannels.discord.inboundWorker.runTimeoutMSto finish.openclaw logs --follow,ollama serve, or anything else that shows the model is still running, because you will see timeout logs but no message on Discord.Expected
Actual
discord inbound worker timed out after...but no corresponding Discord message is sent to the user.Evidence
1_min_evidence_openclaw.mov
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Verified scenarios:
pnpm exec vitest run src/discord/monitor/message-handler.queue.test.tsandpnpm build.Edge cases checked:
runTimeoutMsis 0, message stays properly disabled.What you did not verify:
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
src/discord/monitor/inbound-worker.tssrc/discord/monitor/message-handler.process.tssrc/discord/monitor/message-handler.queue.test.tsAI-assisted PR, gpt-5.4
Human Testing Level:
[ x ] moderately tested
I reviewed the generated changes and understand what the code does.