Skip to content

Python: Add CLIENT SETNAME to Valkey chat message store for connection identification #6097

@atao2004

Description

@atao2004

Summary

The Microsoft Agent Framework's _chat_message_store.py creates a GlideClient without setting a client_name. This means connections appear anonymous in monitoring tools like CLIENT LIST and Valkey Admin.

Suggested Fix

In python/packages/valkey/agent_framework_valkey/_chat_message_store.py (line ~67), add client_name to the GlideClientConfiguration:

cfg = GlideClientConfiguration(
    [NodeAddress(host, port)],
    client_name="ms_agent_framework_chat_store_client",
)

Why This Matters

When monitoring a Valkey server with multiple connected applications, CLIENT LIST shows each connection's name. Without a client name, operators cannot distinguish Microsoft Agent Framework connections from other anonymous clients. This is especially important in production environments with ElastiCache where multiple services share the same Valkey cluster.

Setting client_name sends a CLIENT SETNAME command on connection, making the connection identifiable in:

  • CLIENT LIST output
  • Monitoring dashboards (e.g., Valkey Admin)
  • CloudWatch metrics (ElastiCache)

Naming Convention

Suggested client name: ms_agent_framework_chat_store_client

Pattern: {project}_{purpose}_client

  • ms_agent_framework = project name
  • chat_store = purpose (chat message persistence)
  • _client = convention (matches Valkey Admin naming pattern)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions