fix: responder en thread cuando el mensaje viene de un thread
Dos problemas corregidos: 1. Detección de threads con E2EE: después de desencriptar un evento, evt.Content.Raw puede no contener m.relates_to. Se añade fallback usando el contenido tipado (evt.Content.Parsed) que es más robusto tras la desencriptación de mautrix. 2. Notificaciones de tools fuera del thread: la notificación "🔨 tool" se enviaba con SendMarkdown directo a la sala, ignorando el contexto de thread. Ahora usa sendReply que respeta ThreadID. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -788,9 +788,9 @@ func (a *Agent) runLLM(ctx context.Context, msgCtx decision.MessageContext, memK
|
||||
continue
|
||||
}
|
||||
|
||||
// Notify the room that a tool is being called
|
||||
// Notify the room that a tool is being called (respect thread context)
|
||||
toolNotice := fmt.Sprintf("🔨 <em>%s</em>", tc.Name)
|
||||
if err := a.matrix.SendMarkdown(ctx, msgCtx.RoomID, toolNotice); err != nil {
|
||||
if err := a.sendReply(ctx, msgCtx.RoomID, msgCtx.EventID, msgCtx.ThreadID, toolNotice); err != nil {
|
||||
a.logger.Warn("failed to send tool call notice", "tool", tc.Name, "err", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user