fix(telegram): address PR review comments

- Export pickFirstExistingAgentId and use it to validate topic agentId
- Properly update mainSessionKey when overriding route agent
- Fix docs example showing incorrect session key for topic 3

Fixes issue where non-existent agentId would create orphaned sessions.
Fixes issue where DM topic replies would route to wrong agent.
This commit is contained in:
Evgeny Zislis
2026-03-04 02:21:37 +02:00
committed by Ayaan Zaidi
parent 58bc9a241b
commit 8eeb049683
3 changed files with 16 additions and 5 deletions

View File

@@ -466,7 +466,7 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"
}
```
Each topic then has its own session key: `agent:main:telegram:group:-1001234567890:topic:3`
Each topic then has its own session key: `agent:zu:telegram:group:-1001234567890:topic:3`
Template context includes: