Skip to content

telegram: clarify webhook config help and local listener startup logging#25732

Merged
obviyus merged 4 commits intoopenclaw:mainfrom
huntharo:telegram-webhook-config-troubleshooting
Feb 26, 2026
Merged

telegram: clarify webhook config help and local listener startup logging#25732
obviyus merged 4 commits intoopenclaw:mainfrom
huntharo:telegram-webhook-config-troubleshooting

Conversation

@huntharo
Copy link
Contributor

@huntharo huntharo commented Feb 24, 2026

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: Telegram webhook settings in the config UI did not clearly explain webhook URL/secret semantics and defaults; startup logging only showed the public webhook URL particularly port 8787 was not disclosed as the default in the web UI help text and was also not logged on startup of the gateway. Fixed main regression in port 0 not being allowed - per request from @obviyus
  • Why it matters: Operators need clear guidance to configure webhook mode correctly and to troubleshoot local listener bind details quickly. Issue Telegram webhook returns 405 Method Not Allowed #4417 shows that folks are confused about the port that the Telegram Webhook runs on because neither the config UI nor the startup logs tell them the actual port that the webhook is listening on.
  • What changed: Added Telegram webhook field help/default text in config schema (webhookUrl, webhookSecret, webhookPath, webhookHost, webhookPort) and added a startup log line for the local listener URL (http://host:port/path), while keeping the existing public URL log.
  • What did NOT change (scope boundary): No change to webhook startup validation behavior; missing channels.telegram.webhookSecret with channels.telegram.webhookUrl is still rejected at config validation/startup.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

  • Telegram channel config screen now shows inline help/default guidance for webhook fields.
  • Startup logs now include local listener URL in addition to public webhook URL.
  • Public webhook URL log remains unchanged.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS (local dev machine)
  • Runtime/container: Node 22 / local gateway run
  • Model/provider: N/A
  • Integration/channel (if any): Telegram
  • Relevant config (redacted): channels.telegram.webhookUrl, channels.telegram.webhookSecret, channels.telegram.webhookHost, channels.telegram.webhookPort, channels.telegram.webhookPath

Steps

  1. Configure Telegram webhook settings in Channels config UI and open Telegram section.
  2. Start gateway with webhook settings configured.
  3. Observe startup logs for Telegram channel.
  4. Observe inline documentation for the Telegram webhook settings

Expected

  • Startup logs include both local listener URL and expected public webhook URL.
  • Telegram webhook settings show clear inline help/default guidance.

Actual

  • Current version has little to no inline documentation
  • Current version does not print local listening endpoint for telegram webhook

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Sanitized startup log snippet

19:05:12 [telegram] [default] starting provider (@example_bot)
19:05:12 [telegram] autoSelectFamily=true (default-node22)
19:05:12 [telegram] dnsResultOrder=ipv4first (default-node22)
19:05:13 [telegram] webhook local listener on http://127.0.0.1:8787/telegram-webhook
19:05:13 [telegram] webhook advertised to telegram on https://oc-tg.example.com/telegram-webhook

Log snippet when webhoookPort: 0

13:32:53 [telegram] webhook local listener on http://127.0.0.1:56969/telegram-webhook

Screenshot - Web UI After

image

Screenshot - Startup Logs

Added log line:

19:05:13 [telegram] webhook local listener on http://127.0.0.1:8787/telegram-webhook

image

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
    • Opened browser and confirmed help text is present on Channels config screen for Telegram.
    • Started up and confirmed the webhook local listener line is printed when configured.
    • Confirmed that Telegram webhook is registered correctly and can pickup messages from the Telegram.
  • Edge cases checked:
    • Config validation still rejects channels.telegram.webhookUrl without channels.telegram.webhookSecret on startup.
  • What you did not verify:
    • Nothing?

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert this PR commit.
  • Files/config to restore: N/A (just revert)
  • Known bad symptoms reviewers should watch for: None

Risks and Mitigations

  • Risk: Help text can drift if defaults change later.
  • Mitigation: Keep default values in help text aligned with webhook implementation defaults during future changes.

Greptile Summary

Enhanced Telegram webhook configuration guidance by adding inline help text for all webhook-related fields (webhookUrl, webhookSecret, webhookPath, webhookHost, webhookPort) in the config schema. Added startup logging to display the local listener URL alongside the existing public webhook URL log, improving troubleshooting visibility for operators.

  • Config schema improvements clearly document webhook field semantics and defaults (port 8787, host 127.0.0.1, path /telegram-webhook)
  • New startup log line shows local listener binding details (http://host:port/path)
  • Test coverage updated to verify both log lines are emitted
  • No changes to webhook validation behavior or security model

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Documentation-focused changes that add inline help text and improve logging visibility. No logic changes to webhook behavior, validation, or security. Test coverage properly validates the new logging. The only minor suggestion is clarifying HTTPS requirement wording in the help text.
  • No files require special attention

Last reviewed commit: 337770c

@openclaw-barnacle openclaw-barnacle bot added channel: telegram Channel integration: telegram size: S labels Feb 24, 2026
@huntharo
Copy link
Contributor Author

Hat tip to @kesor and #20309 for helping push me to configure telegram webhooks on my setup.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

.string()
.optional()
.describe(
"Public HTTPS webhook URL registered with Telegram for inbound updates. This must be internet-reachable and requires channels.telegram.webhookSecret.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

help text states "Public HTTPS webhook URL" but webhook.ts:130 defaults to http:// when publicUrl is not provided

Suggested change
"Public HTTPS webhook URL registered with Telegram for inbound updates. This must be internet-reachable and requires channels.telegram.webhookSecret.",
"Public webhook URL (HTTPS required for production) registered with Telegram for inbound updates. This must be internet-reachable and requires channels.telegram.webhookSecret.",
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config/zod-schema.providers-core.ts
Line: 172

Comment:
help text states "Public HTTPS webhook URL" but `webhook.ts:130` defaults to `http://` when `publicUrl` is not provided

```suggestion
        "Public webhook URL (HTTPS required for production) registered with Telegram for inbound updates. This must be internet-reachable and requires channels.telegram.webhookSecret.",
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with guiding folks to use this with HTTPS. Telegram says they allow port 80... but if they really do that's a BAD idea to even suggest to folks that they should consider HTTP as an option for the webhook public URL.

@huntharo
Copy link
Contributor Author

@Takhoffman - Got a second to take a look at this one? It's got nice screenshots, closes an old issue, and should reduce support requests.

@huntharo huntharo force-pushed the telegram-webhook-config-troubleshooting branch 2 times, most recently from 7ba8f01 to b7178f4 Compare February 26, 2026 03:10
@huntharo huntharo force-pushed the telegram-webhook-config-troubleshooting branch 4 times, most recently from 42b564f to 23f28a7 Compare February 26, 2026 12:59
@obviyus obviyus self-assigned this Feb 26, 2026
@obviyus
Copy link
Contributor

obviyus commented Feb 26, 2026

So local-listener log now builds URL from configured host/port (http://${host}:${port}${path}), not the bound socket. If webhookPort=0 (ephemeral), log can show :0 and mislead debugging. Can we derive this from server.address() (single source of truth) so local/advertised URLs stay accurate?

@huntharo huntharo force-pushed the telegram-webhook-config-troubleshooting branch from 23f28a7 to 2983dd9 Compare February 26, 2026 13:41
@obviyus obviyus force-pushed the telegram-webhook-config-troubleshooting branch from 2983dd9 to e535e71 Compare February 26, 2026 14:31
@obviyus obviyus merged commit 22b0f36 into openclaw:main Feb 26, 2026
7 checks passed
@obviyus
Copy link
Contributor

obviyus commented Feb 26, 2026

Landed via temp rebase onto main.

  • Gate: pnpm test src/telegram/webhook.test.ts src/config/telegram-webhook-port.test.ts
  • Land commit: e535e71
  • Merge commit: 22b0f36

Thanks @huntharo!

@huntharo huntharo deleted the telegram-webhook-config-troubleshooting branch February 26, 2026 14:42
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 27, 2026
execute008 pushed a commit to execute008/openclaw that referenced this pull request Feb 27, 2026
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
… (thanks @huntharo)

(cherry picked from commit 22b0f36)

# Conflicts:
#	CHANGELOG.md
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
… (thanks @huntharo)

(cherry picked from commit 22b0f36)

# Conflicts:
#	CHANGELOG.md
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
thebenjaminlee pushed a commit to escape-velocity-ventures/openclaw that referenced this pull request Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram webhook returns 405 Method Not Allowed

2 participants