Skip to content

message tool crashes on unrelated channel SecretRef failures during schema probing #47519

@vrknetha

Description

@vrknetha

Summary

The message tool can fail during schema construction when an unrelated channel plugin eagerly resolves account secrets and hits an unresolved SecretRef.

In practice, an explicit send like channel=whatsapp can still fail because tool schema generation probes Telegram/Slack capabilities first.

Repro

  1. Configure a channel account whose token resolves through a SecretRef that is not currently resolvable from the active runtime snapshot (for example a cached file:localcache: ref).
  2. Keep another channel working, such as WhatsApp.
  3. Invoke the message tool with an explicit channel send targeting the healthy channel.

Actual

Tool/schema construction probes all channel plugins, an unrelated plugin throws during listActions / capability checks, and the whole message tool fails with errors like:

channels.telegram.accounts.coder.botToken: unresolved SecretRef "file:localcache:/channels/telegram/accounts/coder/botToken"

Expected

  • Explicit sends should not inspect unrelated channel configs.
  • Capability probing should degrade safely when a plugin cannot resolve secrets, instead of crashing the whole message tool.

Notes

I have a fix ready that:

  • skips unrelated channel inspection for explicit sends
  • wraps message capability probing in safe fallbacks so unresolved SecretRefs do not take down the tool

Local validation on the fix branch:

  • targeted regression tests pass
  • pnpm build passes
  • gateway restart succeeds
  • WhatsApp message.send dry-run succeeds after the rebuild

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions