Fix shared-bot Telegram agent resolution and add effort badge

- TelegramService: build the chat context with the session owner instead
  of the bot owner, so a public/shared bot resolves the agent for foreign
  sessions; credentials/CLI permission stay with the bot owner.
- Agent cards: render an effort badge next to the model badge when an
  agent has an explicit reasoning effort set.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MelekiandClaude Opus 4.8 committed 2026-06-20 12:56:42 +02:00
1 parent e395927a67
commit e6770bb5f8
3 files changed
+13 -1

No files matched your search

+4 -1
View File
@@ -164,7 +164,10 @@ public class TelegramService
private async Task HandleMessage(long chatId, string userText, string botToken, string botUserId, SessionRecord session)
{
var ctx = await _chatService.PrepareContext(session.SessionId, botUserId, _settings.GetInt("MaxIterations", 100));
// Kontext mit dem Session-Besitzer aufbauen, nicht mit dem Bot-Besitzer:
// bei einem geteilten Bot können sich beide unterscheiden, und PrepareContext
// lehnt fremde Sessions ab. Credentials/CLI-Berechtigung bleiben beim Bot-Besitzer (botUserId, s.u.).
var ctx = await _chatService.PrepareContext(session.SessionId, session.UserId, _settings.GetInt("MaxIterations", 100));
if (ctx == null)
{
await SendMessage(chatId, botToken, "❌ Kein Agent konfiguriert. Bitte weise der Session im Web-UI einen Agent zu.");