Commit 34ef86c
Josh Kappler
fix(runner): drop nest_asyncio, which breaks startup on Python 3.14
nest_asyncio.apply() patches asyncio in a way that no longer holds on
3.14: asyncio.wait_for runs through asyncio.timeouts.timeout, which needs
a current task, and under the patched loop that context is lost. The
first wait_for inside Telethon's client.connect() then raises
"RuntimeError: Timeout should be used inside a task" and the server dies
before serving anything. nest_asyncio has been archived upstream since
January 2024, so this will not be fixed there.
The call is vestigial. Nothing under telegram_mcp/ re-enters a running
loop: the only entrypoint is asyncio.run(_main()), and the HTTP/SSE
transports are awaited inside that same loop. session_string_generator.py
uses telethon.sync + loop.run_until_complete, but it runs standalone and
never imports runner, so apply() never applied to it.
Removed the import, the call, and the dependency from pyproject,
requirements and uv.lock. The lock diff is nest-asyncio only.
Verified on 3.14.6: before, `python main.py` dies at connect() with the
error above; after, the connection completes and startup reaches the
expected "not authorized" error for dummy credentials. 3.11 reaches that
same point, unchanged. pytest is 149 passed with 3 pre-existing Windows
path failures, identical before and after.
Fixes #1561 parent 48a6237 commit 34ef86c
5 files changed
Lines changed: 0 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments