diff --git a/internal/bootstrap/seed_store_test.go b/internal/bootstrap/seed_store_test.go index 0bb2af5c..9ba4a9f5 100644 --- a/internal/bootstrap/seed_store_test.go +++ b/internal/bootstrap/seed_store_test.go @@ -108,6 +108,9 @@ func (s *seedStubStore) ListUserInstances(_ context.Context, _ uuid.UUID) ([]sto func (s *seedStubStore) UpdateUserProfileMetadata(_ context.Context, _ uuid.UUID, _ string, _ map[string]string) error { return nil } +func (s *seedStubStore) EnsureUserProfile(_ context.Context, _ uuid.UUID, _ string) error { + return nil +} // ---- Tests ---- diff --git a/internal/channels/telegram/handlers.go b/internal/channels/telegram/handlers.go index 8bd512f8..28c15a65 100644 --- a/internal/channels/telegram/handlers.go +++ b/internal/channels/telegram/handlers.go @@ -358,6 +358,9 @@ func (c *Channel) handleMessage(ctx context.Context, update telego.Update) { } else { finalContent = annotated } + } else { + // DM: annotate with sender identity so the agent knows who is messaging. + finalContent = fmt.Sprintf("[From: %s]\n%s", senderLabel, content) } // Send typing indicator with keepalive + TTL safety net. diff --git a/internal/channels/zalo/personal/handlers.go b/internal/channels/zalo/personal/handlers.go index e9425626..c40f768d 100644 --- a/internal/channels/zalo/personal/handlers.go +++ b/internal/channels/zalo/personal/handlers.go @@ -43,8 +43,15 @@ func (c *Channel) handleDM(msg protocol.UserMessage) { return } + // Annotate with sender display name so the agent knows who is messaging. + senderName := msg.Data.DName + if senderName != "" { + content = fmt.Sprintf("[From: %s]\n%s", senderName, content) + } + slog.Debug("zalo_personal DM received", "sender", senderID, + "dname", senderName, "thread", threadID, "preview", channels.Truncate(content, 50), ) diff --git a/internal/gateway/methods/agents_create_owner_test.go b/internal/gateway/methods/agents_create_owner_test.go index 5cbefc60..78f0c87b 100644 --- a/internal/gateway/methods/agents_create_owner_test.go +++ b/internal/gateway/methods/agents_create_owner_test.go @@ -101,6 +101,9 @@ func (s *createCaptureStore) ListUserInstances(_ context.Context, _ uuid.UUID) ( func (s *createCaptureStore) UpdateUserProfileMetadata(_ context.Context, _ uuid.UUID, _ string, _ map[string]string) error { return nil } +func (s *createCaptureStore) EnsureUserProfile(_ context.Context, _ uuid.UUID, _ string) error { + return nil +} // ---- helpers ---- diff --git a/internal/tools/context_file_interceptor_test.go b/internal/tools/context_file_interceptor_test.go index f2ea9171..8af0fa74 100644 --- a/internal/tools/context_file_interceptor_test.go +++ b/internal/tools/context_file_interceptor_test.go @@ -90,6 +90,9 @@ func (s *stubAgentStore) ListUserInstances(_ context.Context, _ uuid.UUID) ([]st func (s *stubAgentStore) UpdateUserProfileMetadata(_ context.Context, _ uuid.UUID, _ string, _ map[string]string) error { return nil } +func (s *stubAgentStore) EnsureUserProfile(_ context.Context, _ uuid.UUID, _ string) error { + return nil +} // ---- Tests ----