Skip to content

Telegram adapter crashes on Bun: TypeError readonly property in Telegraf #1042

@klatt42

Description

@klatt42

Environment

  • Archon v0.3.2
  • Bun v1.3.11
  • Platform: linux-x64 (WSL2)
  • Telegraf v4.16.3

Problem

Telegram adapter initializes successfully but then crashes during start():

telegram.whitelist_enabled (userCount: 1)
telegram.adapter_initialized (mode: stream)
telegram.start_failed: TypeError: Attempted to assign to readonly property.
  at redactToken (telegraf/lib/core/network/client.js:248:5)

The adapter loads config, validates the whitelist, but fails when Telegraf tries to redact the bot token internally. This appears to be a Bun compatibility issue with Telegraf's redactToken function attempting to assign to a readonly property.

Steps to Reproduce

  1. Configure TELEGRAM_BOT_TOKEN and TELEGRAM_USER_IDS via archon setup
  2. Start server: bun run dev:server
  3. Telegram adapter initializes but immediately crashes

Expected

Telegram bot should start polling and respond to messages.

Workaround

Using GitHub adapter (@ROK-Archon-Bot mentions in issues/PRs) as alternative trigger mechanism.

Notes

  • Web adapter: works fine
  • GitHub adapter: works fine
  • Slack/Discord: not tested
  • This may be related to Bun's handling of property descriptors in CJS modules

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions