[BUG]: fix telegram webhook should wait for abort signal instead of returning#20309
Closed
kesor wants to merge 2 commits intoopenclaw:mainfrom
Closed
[BUG]: fix telegram webhook should wait for abort signal instead of returning#20309kesor wants to merge 2 commits intoopenclaw:mainfrom
kesor wants to merge 2 commits intoopenclaw:mainfrom
Conversation
d026cfe to
e0f4c6a
Compare
e0f4c6a to
dade1d0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d026cfe337
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The webhook server starts successfully but the monitor function was returning immediately, causing the gateway to think the channel exited and trigger restarts. The fix waits for the abort signal in the monitor (not in the webhook startup function) so the webhook server can return its handle immediately while the monitor stays running until shutdown.
dade1d0 to
8af0292
Compare
Add test to ensure the monitor function stays running in webhook mode until the abort signal is fired, preventing premature returns that would cause the gateway to restart the channel.
a0086b8 to
2b10f34
Compare
18 tasks
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
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
Describe the problem and fix in 2–5 bullets:
monitorTelegramProviderfunction was returning immediately after starting the webhook server, causing the gateway to interpret this as a channel exit and trigger automatic restarts, leading toEADDRINUSEerrors.Change Type (select all)
Scope (select all touched areas)
User-visible / Behavior Changes
Telegram webhook mode now works correctly without crashing. The gateway no longer attempts to restart the Telegram channel when using webhook mode, eliminating the
EADDRINUSEport conflict errors.Security Impact (required)
Repro + Verification
Environment
{ "channels": { "telegram": { "webhookUrl": "https://xxx.xxxx.xxx/telegram/webhook", "webhookSecret": "xxxxx", "webhookPath": "/telegram/webhook", "webhookHost": "127.0.0.1" } } }Steps
EADDRINUSE: address already in use 127.0.0.1:8787Expected
Actual (before fix)
Actual (after fix)
Evidence
Attach at least one:
Before fix:
After fix:
Test added:
Added test
"webhook mode waits for abort signal before returning"inmonitor.test.tsthat verifies the monitor stays running until abort is triggered.Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
Failure Recovery (if this breaks)
webhookUrlfrom Telegram config, or revert the commitsrc/telegram/monitor.ts(primary change)Risks and Mitigations
abortSignalis provided and not already aborted; gateway shutdown always fires abort signals