fix: custom bot creation and WebSocket server lifecycle#3
Open
ronak-create wants to merge 1 commit intoexotel:mainfrom
Open
fix: custom bot creation and WebSocket server lifecycle#3ronak-create wants to merge 1 commit intoexotel:mainfrom
ronak-create wants to merge 1 commit intoexotel:mainfrom
Conversation
- 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.
|
Successfully scanned changes introduced in a pull request into Internal scan identifier:
See all issues found during this scan in the OX Security Application. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 bottypes but
customwas never included, despiteBotType.CUSTOMbeing declaredin the enum. Additionally,
core/custom_bot.pyimported a non-existentBaseBotFrameworkclass and referenced config attributes that don't exist.A separate bug in
start_bot()/stop_bot()caused a crash when actuallystarting the server:
.closes()(typo) and a stale unused import.Changes
core/bot_framework.py: Add_create_custom_template()+ register it;fix
start_bot()andstop_bot()server lifecyclecore/custom_bot.py: Complete rewrite — self-contained, no broken importsTesting
Tested full wizard flow: create custom bot → starts WebSocket server →
clean shutdown via stop_bot().