Skip to content

fix: custom bot creation and WebSocket server lifecycle#3

Open
ronak-create wants to merge 1 commit intoexotel:mainfrom
ronak-create:fix/custom-bot-creation-and-websocket-server
Open

fix: custom bot creation and WebSocket server lifecycle#3
ronak-create wants to merge 1 commit intoexotel:mainfrom
ronak-create:fix/custom-bot-creation-and-websocket-server

Conversation

@ronak-create
Copy link

Problem

Running python core/bot_launcher.py, going through the Create Bot wizard,
and selecting "Custom Configuration" always fails at Step 5:

❌ Failed to create bot: Unknown bot type: custom

Root Cause

BotTemplateManager._load_default_templates() creates templates for 6 bot
types but custom was never included, despite BotType.CUSTOM being declared
in the enum. Additionally, core/custom_bot.py imported a non-existent
BaseBotFramework class and referenced config attributes that don't exist.

A separate bug in start_bot()/stop_bot() caused a crash when actually
starting the server: .closes() (typo) and a stale unused import.

Changes

  • core/bot_framework.py: Add _create_custom_template() + register it;
    fix start_bot() and stop_bot() server lifecycle
  • core/custom_bot.py: Complete rewrite — self-contained, no broken imports

Testing

Tested full wizard flow: create custom bot → starts WebSocket server →
clean shutdown via stop_bot().

- Add missing 'custom' template to BotTemplateManager._load_default_templates()
  so bot_type='custom' no longer raises 'Unknown bot type: custom'
- Rewrite core/custom_bot.py to remove broken BaseBotFramework import
  (class doesn't exist) and missing config attribute references
- Fix start_bot(): remove stale unused import, store server object correctly
- Fix stop_bot(): typo .closes() -> .close(), add await .wait_closed()
  for clean server shutdown

Fixes exotel#1 (Absence of Config file) and resolves the custom bot crash
reported by users of the bot_launcher interactive wizard.
@ox-security
Copy link

ox-security bot commented Mar 16, 2026

OX Security Logo

Successfully scanned changes introduced in a pull request into main from fix/custom-bot-creation-and-websocket-server.

Internal scan identifier: 0a770532-0329-41b6-8deb-2477a0d87948.

Total issues Blocking issues Scan status
0 0 ✔️

See all issues found during this scan in the OX Security Application.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant