Skip to content

fix(gateway): avoid /start crash when config is a GatewayConfig#975

Open
stablegenius49 wants to merge 1 commit intoNousResearch:mainfrom
stablegenius49:pr-factory/issue-973-telegram-start-config
Open

fix(gateway): avoid /start crash when config is a GatewayConfig#975
stablegenius49 wants to merge 1 commit intoNousResearch:mainfrom
stablegenius49:pr-factory/issue-973-telegram-start-config

Conversation

@stablegenius49
Copy link

What does this PR do?

Fixes the Telegram /start crash reported in #973 by making gateway quick-command handling work with the GatewayConfig object used at runtime.

The gateway runner was treating self.config like a plain dict (self.config.get(...)), but the installed gateway path passes a GatewayConfig dataclass. That raised AttributeError: 'GatewayConfig' object has no attribute 'get' before the normal /start flow could continue.

Related Issue

Fixes #973

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Added quick_commands to gateway/config.py so gateway config loading preserves the configured quick-command map.
  • Updated GatewayRunner._handle_message() to support both dict configs (existing tests) and GatewayConfig objects (real runtime path).
  • Added a regression test covering GatewayConfig-backed quick commands in tests/test_quick_commands.py.

How to Test

  1. Create a Python 3.11 venv and install dev deps (python3.11 -m venv .venv && source .venv/bin/activate && pip install -e '.[dev]').
  2. Run python -m pytest -o addopts='' tests/test_quick_commands.py.
  3. Configure a Telegram gateway and send /start; it should no longer raise GatewayConfig has no attribute 'get'.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.4.1 / Python 3.11.15

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  • python -m pytest -o addopts='' tests/test_quick_commands.py12 passed

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

2 participants