Skip to content

fix: GatewayConfig has no attribute 'get' when sending /start on Telegram (#973)#1016

Closed
Bartok9 wants to merge 1 commit intoNousResearch:mainfrom
Bartok9:fix/gateway-config-quick-commands-973
Closed

fix: GatewayConfig has no attribute 'get' when sending /start on Telegram (#973)#1016
Bartok9 wants to merge 1 commit intoNousResearch:mainfrom
Bartok9:fix/gateway-config-quick-commands-973

Conversation

@Bartok9
Copy link
Contributor

@Bartok9 Bartok9 commented Mar 12, 2026

Problem

Sending /start to the Telegram bot triggers an AttributeError:

[Telegram] Error handling message: 'GatewayConfig' object has no attribute 'get'
Traceback (most recent call last):
  File "gateway/run.py", line 917, in _handle_message
    quick_commands = self.config.get("quick_commands", {})
AttributeError: 'GatewayConfig' object has no attribute 'get'

Root Cause

The quick_commands feature (commit 1404f84) 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

Note: Commit bd2606a fixed this for CLI (cli.py), but the gateway (run.py) still had the bug.

Fix

  1. Added quick_commands: Dict[str, Dict[str, Any]] field to GatewayConfig dataclass
  2. Load quick_commands from config.yaml in load_gateway_config()
  3. Changed self.config.get("quick_commands", {}) to getattr(self.config, "quick_commands", {})

Closes #973

…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
@Bartok9 Bartok9 force-pushed the fix/gateway-config-quick-commands-973 branch from 92226fb to eecc8bc Compare March 14, 2026 07:36
@teknium1
Copy link
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.

@teknium1 teknium1 closed this Mar 14, 2026
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.

[Bug]: GatewayConfig has no attribute 'get' when sending /start on Telegram

3 participants