Skip to content

fix(heartbeat): pass accountId for Telegram delivery#516

Merged
steipete merged 3 commits intoopenclaw:mainfrom
YuriNachos:fix/heartbeat-telegram-account-id
Jan 8, 2026
Merged

fix(heartbeat): pass accountId for Telegram delivery#516
steipete merged 3 commits intoopenclaw:mainfrom
YuriNachos:fix/heartbeat-telegram-account-id

Conversation

@YuriNachos
Copy link
Contributor

Description

This PR fixes Telegram heartbeat delivery when the bot token is configured only via telegram.botToken in config (without TELEGRAM_BOT_TOKEN environment variable).

Root Cause

The deliverOutboundPayloads function in runHeartbeatOnce was called without the accountId parameter. When accountId is not provided, sendMessageTelegram cannot determine which account to use and cannot locate the token from config, falling back only to the TELEGRAM_BOT_TOKEN environment variable.

Changes

  • Added import for resolveDefaultTelegramAccountId from ../telegram/accounts.js
  • Added accountId resolution logic when provider is "telegram"
  • Updated deliverOutboundPayloads call to include the accountId parameter

Impact

  • Heartbeat Telegram delivery now works with config-only token configuration
  • Follows the same pattern used in other parts of the codebase (e.g., cron uses resolveTelegramToken)
  • No breaking changes - other providers continue to work as before

Testing

  • Verified build passes with npm run build
  • Verified lint passes with npm run lint
  • Verified all heartbeat-runner tests pass (15/15)
  • Follows existing code patterns from cron/isolated-agent.ts

Fixes #318


AI-assisted PR: This PR was created with assistance from Claude Code. The fix follows the existing token resolution pattern used elsewhere in the codebase.

Yurii Chukhlib and others added 2 commits January 8, 2026 20:28
Fixes parameter mismatch between AI tool schema and internal validation.
The TypeBox schema now uses `jobId` for update/remove/run/runs actions,
matching what users expect based on the returned job objects.

Changes:
- Changed parameter from `id` to `jobId` in TypeBox schema for update/remove/run/runs
- Updated execute function to read `jobId` parameter
- Updated tests to use `jobId` in input parameters

The gateway protocol still uses `id` internally - the tool now maps
`jobId` from the AI to `id` for the gateway call.

Fixes openclaw#185

Co-Authored-By: Claude <noreply@anthropic.com>
Heartbeat Telegram delivery was failing when the bot token was
configured only via telegram.botToken in config (without TELEGRAM_BOT_TOKEN
environment variable).

Root cause: deliverOutboundPayloads was called without accountId parameter,
so sendMessageTelegram couldn't determine which account to use and couldn't
find the token from config.

Fix: Resolve default Telegram accountId when provider is "telegram" and pass
it to deliverOutboundPayloads. This follows the same pattern used elsewhere in
the codebase (e.g., cron uses resolveTelegramToken).

Changes:
- Added import for resolveDefaultTelegramAccountId
- Added accountId resolution for telegram provider
- Updated deliverOutboundPayloads call to include accountId

Fixes openclaw#318

Co-Authored-By: Claude <noreply@anthropic.com>
@steipete steipete merged commit 28e3e51 into openclaw:main Jan 8, 2026
17 checks passed
@steipete
Copy link
Contributor

steipete commented Jan 8, 2026

Landed on main. Updates: Telegram heartbeat resolves accountId from config, cron tool supports canonical with legacy uid=501(steipete) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),701(com.apple.sharepoint.group.1),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae) compat + changelog. SHAs: 9d42972, 4dac298, 871c9e5. Thanks @YuriNachos!

@steipete
Copy link
Contributor

steipete commented Jan 8, 2026

Landed on main. Updates: Telegram heartbeat resolves accountId from config, cron tool supports canonical jobId with legacy id compat + changelog. SHAs: 9d42972, 4dac298, 871c9e5. Thanks @YuriNachos!

steipete added a commit that referenced this pull request Jan 8, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…m-account-id

fix(heartbeat): pass accountId for Telegram delivery
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Heartbeat Telegram delivery ignores config token (env-only)

2 participants