[#104] Fix telegram plugin call_extension API mismatch #111

Merged
k9ert merged 3 commits from story-104 into main 2026-02-26 15:51:42 +00:00
Collaborator

Closes #104

Problem

The telegram plugin's _call_extension() method called self._registry.call_extension(point, ctx) which no longer exists on PluginRegistry. This method was moved to BasePlugin.call_extension() (async) during a refactor, but the telegram plugin was not updated.

This caused an AttributeError crash in the telegram poll loop at runtime.

Fix

Removed the broken self._registry.call_extension() call. The local extension handler loop already works correctly for registered handlers. Cross-plugin async dispatch via BasePlugin.call_extension() can be added in a future PR if needed.

Acceptance Criteria

  • Telegram plugin no longer crashes with AttributeError
  • Extension point handlers still fire correctly
  • ruff check cobot/ passes
  • 312 tests pass, 1 skipped
Closes #104 ## Problem The telegram plugin's `_call_extension()` method called `self._registry.call_extension(point, ctx)` which no longer exists on `PluginRegistry`. This method was moved to `BasePlugin.call_extension()` (async) during a refactor, but the telegram plugin was not updated. This caused an `AttributeError` crash in the telegram poll loop at runtime. ## Fix Removed the broken `self._registry.call_extension()` call. The local extension handler loop already works correctly for registered handlers. Cross-plugin async dispatch via `BasePlugin.call_extension()` can be added in a future PR if needed. ## Acceptance Criteria - [x] Telegram plugin no longer crashes with AttributeError - [x] Extension point handlers still fire correctly - [x] `ruff check cobot/` passes - [x] 312 tests pass, 1 skipped
[#104] fix: remove broken registry.call_extension() call in telegram plugin
Some checks failed
CI / lint (pull_request) Successful in 9s
CI / test (3.11) (pull_request) Failing after 17s
CI / test (3.12) (pull_request) Failing after 19s
CI / test (3.13) (pull_request) Failing after 19s
CI / build (pull_request) Has been skipped
E2E Tests / e2e (pull_request) Successful in 12s
8ea117603d
The telegram plugin's _call_extension() called self._registry.call_extension()
which no longer exists (method moved to BasePlugin as async). This caused an
AttributeError crash in the telegram poll loop.

Fix: Remove the broken registry call. Local extension handlers still work.
Cross-plugin async dispatch can be added later via BasePlugin.call_extension().
k9ert approved these changes 2026-02-26 15:46:06 +00:00
[#103] fix: guard optional imports in nostr and telegram tests
Some checks failed
CI / lint (pull_request) Successful in 9s
CI / test (3.11) (pull_request) Failing after 16s
CI / test (3.12) (pull_request) Failing after 17s
CI / test (3.13) (pull_request) Failing after 18s
CI / build (pull_request) Has been skipped
E2E Tests / e2e (pull_request) Successful in 13s
ab7f36eb11
Use pytest.importorskip() to gracefully skip tests when optional
dependencies (pynostr, python-telegram-bot) are not installed,
instead of crashing during test collection.

Also fix unused imports (AsyncMock, CommunicationError) in telegram tests.
[#104] fix: update test to match removed registry.call_extension
All checks were successful
CI / lint (pull_request) Successful in 9s
CI / test (3.11) (pull_request) Successful in 21s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.13) (pull_request) Successful in 24s
E2E Tests / e2e (pull_request) Successful in 15s
CI / build (pull_request) Successful in 6s
f9c29ab86b
Test was asserting the old behavior (registry dispatch). Updated to
verify _call_extension returns ctx correctly without registry call.
k9ert force-pushed story-104 from f9c29ab86b
All checks were successful
CI / lint (pull_request) Successful in 9s
CI / test (3.11) (pull_request) Successful in 21s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.13) (pull_request) Successful in 24s
E2E Tests / e2e (pull_request) Successful in 15s
CI / build (pull_request) Successful in 6s
to 80a8128db4
All checks were successful
CI / lint (pull_request) Successful in 8s
CI / test (3.11) (pull_request) Successful in 21s
CI / test (3.12) (pull_request) Successful in 23s
CI / test (3.13) (pull_request) Successful in 23s
E2E Tests / e2e (pull_request) Successful in 14s
CI / build (pull_request) Successful in 6s
2026-02-26 15:50:37 +00:00
Compare
k9ert merged commit bfae9b51d4 into main 2026-02-26 15:51:42 +00:00
k9ert deleted branch story-104 2026-02-26 15:51:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot!111
No description provided.