Skip to content

bug: karen crashes when slack integration missing #327

@flexus-teams

Description

@flexus-teams

Original Logs

20260418 07:10:54.850 igrdb [INFO] Omf96P2ZHS integration slack skipped (not connected)
20260418 07:10:54.850 igrdb [INFO] Omf96P2ZHS integration telegram skipped (not connected)
20260418 07:10:54.850 igrdb [INFO] Omf96P2ZHS integration discord skipped (not connected)
20260418 07:10:54.850 igrdb [INFO] Omf96P2ZHS integration resend skipped (not connected)
20260418 07:10:54.850 btexe [ERROR] 🛑 Omf96P2ZHS Bot main loop problem: KeyError 'slack'
Traceback (most recent call last):
  File "/app/flexus_client_kit/ckit_bot_exec.py", line 308, in crash_boom_bang
    await bot_main_loop(fclient, rcx)
  File "/app/flexus_simple_bots/karen/karen_bot.py", line 396, in karen_main_loop
    slack: fi_slack.IntegrationSlack = integrations["slack"]
                                       ~~~~~~~~~~~~^^^^^^^^^
KeyError: 'slack'

Error Summary

Karen pod in isolated repeatedly logs KeyError: 'slack' on startup. The pod is running but the bot main loop repeatedly restarts internally and never completes normal startup behavior. This is a persistent service-breaking failure whenever the slack integration is absent.

Stacktrace

File "/app/flexus_client_kit/ckit_bot_exec.py", line 308, in crash_boom_bang
File "/app/flexus_simple_bots/karen/karen_bot.py", line 396, in karen_main_loop

Root Cause

  • File: flexus_simple_bots/karen/karen_bot.py:396
  • Function: karen_main_loop
  • Why: The setup/loading flow allows optional integrations, but the main loop unconditionally indexes integrations["slack"], so a missing Slack connection causes an unhandled KeyError.
  • Git blame: @Humberto Yusta in 4be2823 (2026-04-01)

Code Snippet

pdoc_integration: fi_pdoc.IntegrationPdoc = integrations["flexus_policy_document"]
email_respond_to = set(a.strip().lower() for a in setup.get("EMAIL_RESPOND_TO", "").split(",") if a.strip())
shopify = fi_shopify.IntegrationShopify(fclient, rcx)
sched = fi_sched.IntegrationSched(rcx)
slack: fi_slack.IntegrationSlack = integrations["slack"]
telegram: fi_telegram.IntegrationTelegram = integrations["telegram"]

Affected

  • Pods: flexus-pod-bot-karen-100020233-rx
  • Namespaces: isolated
  • Occurrences: repeated within minutes on startup

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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