fix: GatewayConfig has no attribute 'get' when sending /start on Telegram (#973)#1016
Closed
Bartok9 wants to merge 1 commit intoNousResearch:mainfrom
Closed
fix: GatewayConfig has no attribute 'get' when sending /start on Telegram (#973)#1016Bartok9 wants to merge 1 commit intoNousResearch:mainfrom
Bartok9 wants to merge 1 commit intoNousResearch:mainfrom
Conversation
…gram (NousResearch#973) The quick_commands feature was added to gateway/run.py but: 1. GatewayConfig dataclass didn't have a quick_commands field 2. Code used self.config.get() which doesn't work on dataclasses Root cause: Feature commit 1404f84 added quick_commands to CLI config but the gateway config was incomplete. Fix: - Added quick_commands field to GatewayConfig dataclass (Dict[str, Dict[str, Any]]) - Load quick_commands from config.yaml in load_gateway_config() - Changed self.config.get() to getattr(self.config, 'quick_commands', {}) Closes NousResearch#973
92226fb to
eecc8bc
Compare
Contributor
|
Thanks for the fix. This is redundant on current main now: the GatewayConfig quick-command crash path is already resolved, and the broader config-path completion work landed in PR #1287. That merged fix covers the dataclass-vs-dict access issue, adds GatewayConfig.quick_commands, and bridges quick_commands from config.yaml into gateway runtime config. Closing this one to keep the duplicate queue clean. |
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
Sending
/startto the Telegram bot triggers an AttributeError:Root Cause
The quick_commands feature (commit 1404f84) was added to
gateway/run.pybut:GatewayConfigdataclass didn't have aquick_commandsfieldself.config.get()which doesn't work on dataclassesNote: Commit bd2606a fixed this for CLI (
cli.py), but the gateway (run.py) still had the bug.Fix
quick_commands: Dict[str, Dict[str, Any]]field toGatewayConfigdataclassquick_commandsfromconfig.yamlinload_gateway_config()self.config.get("quick_commands", {})togetattr(self.config, "quick_commands", {})Closes #973