bug: karen crashes when slack integration missing

Open Beginner friendly
#327 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
backend

Research direction

Start in flexus_simple_bots/karen/karen_bot.py at karen_main_loop around line 396, then read the optional integration setup/loading flow. Reproduce startup with Slack absent and verify the bot no longer repeatedly restarts with KeyError 'slack' and can complete normal startup behavior.

Written by the indexing model from the issue text.

Description

bug

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 4be28233 (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
Dominant language
Python
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from smallcloudai/flexus-client-kit

All issues in smallcloudai/flexus-client-kit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.