Skip to content

Fix Telegram channel resolution drift across announce + message send paths#23727

Closed
SmithLabsLLC wants to merge 5 commits into
openclaw:mainfrom
SmithLabsLLC:fix/telegram-channel-resolution-consistency
Closed

Fix Telegram channel resolution drift across announce + message send paths#23727
SmithLabsLLC wants to merge 5 commits into
openclaw:mainfrom
SmithLabsLLC:fix/telegram-channel-resolution-consistency

Conversation

@SmithLabsLLC

@SmithLabsLLC SmithLabsLLC commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a shared outbound channel resolver (src/infra/outbound/channel-resolution.ts) that:
    • normalizes explicit channel inputs with deliverable-channel rules
    • retries missing channel plugins by bootstrapping plugin registry from config (applyPluginAutoEnable + loadOpenClawPlugins)
  • wire announce/send paths to use that shared resolver:
    • src/infra/outbound/targets.ts (cron/subagent announce target resolution + heartbeat account/allowFrom checks)
    • src/infra/outbound/message.ts (message/send + poll explicit channel handling)
    • src/gateway/server-methods/send.ts (gateway send/poll channel plugin lookup)

This keeps channel resolution behavior consistent and recovers from empty/stale plugin registries in these outbound paths, preventing Telegram from being rejected as unsupported/unknown.

Regression tests

  • src/infra/outbound/targets.channel-resolution.test.ts
    • reproduces and guards against Unsupported channel: telegram in announce target resolution
  • src/infra/outbound/message.test.ts
    • reproduces and guards against Unknown channel: telegram in message/send

Verification

pnpm vitest src/infra/outbound/message.test.ts src/infra/outbound/targets.channel-resolution.test.ts src/infra/outbound/targets.test.ts src/gateway/server-methods/send.test.ts
pnpm lint -- src/infra/outbound/channel-resolution.ts src/infra/outbound/message.ts src/infra/outbound/targets.ts src/gateway/server-methods/send.ts src/infra/outbound/message.test.ts src/infra/outbound/targets.channel-resolution.test.ts
pnpm exec tsc --noEmit -p tsconfig.json --pretty false

Related: #21968 #21595 #13420 #14188

Greptile Summary

This PR introduces a shared channel resolution module (channel-resolution.ts) that prevents Telegram and other plugins from being rejected as unsupported when the plugin registry is empty or stale. The fix applies consistently across announce/send paths by:

  • Creating resolveOutboundChannelPlugin() that normalizes channel inputs and retries plugin lookup after bootstrapping the plugin registry from config
  • Using a module-level Set to track bootstrap attempts per registry key, preventing infinite retry loops
  • Replacing direct getChannelPlugin() calls in targets.ts, message.ts, and send.ts with the new shared resolver

The implementation includes regression tests that verify the bootstrap recovery mechanism works correctly for both announce target resolution and message send flows.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring follows established patterns, includes comprehensive regression tests for both affected code paths, uses proper deduplication to prevent infinite loops, and maintains backward compatibility by wrapping existing functions without changing their signatures
  • No files require special attention

Last reviewed commit: 4381ffe

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M commands Command implementations labels Feb 22, 2026
@SmithLabsLLC SmithLabsLLC force-pushed the fix/telegram-channel-resolution-consistency branch from c876f67 to a337189 Compare February 22, 2026 17:40
@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram agents Agent runtime and tooling labels Feb 22, 2026
@SmithLabsLLC SmithLabsLLC force-pushed the fix/telegram-channel-resolution-consistency branch 2 times, most recently from fe1f384 to 54a31a6 Compare February 22, 2026 18:55
@openclaw-barnacle openclaw-barnacle Bot removed channel: telegram Channel integration: telegram commands Command implementations agents Agent runtime and tooling labels Feb 22, 2026
@SmithLabsLLC SmithLabsLLC force-pushed the fix/telegram-channel-resolution-consistency branch 2 times, most recently from 812f17a to 31b06f5 Compare February 22, 2026 20:08
@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack app: macos App: macos labels Feb 22, 2026
@SmithLabsLLC SmithLabsLLC force-pushed the fix/telegram-channel-resolution-consistency branch from a7230e8 to 90358c6 Compare February 22, 2026 20:30
@openclaw-barnacle openclaw-barnacle Bot added docker Docker and sandbox tooling agents Agent runtime and tooling labels Feb 22, 2026
@steipete

Copy link
Copy Markdown
Contributor

Closing as superseded by commit 4258a33 on main.

The merged change set consolidates the relevant parts into one refactor/fix pass:

  • unified subagent announce delivery dispatch
  • shared outbound channel/plugin resolution recovery across announce/send paths
  • cleanup-finalization safety on announce rejection
  • expanded regression coverage for the combined behavior

Thanks for the PR and the groundwork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: macos App: macos channel: slack Channel integration: slack docker Docker and sandbox tooling gateway Gateway runtime size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants