Compare commits

...
Author SHA1 Message Date
praisonai-triage-agent[bot]andMervin Praison a4df5ce859 fix: make Valkey client names configurable and component-specific
- Add optional client_name parameter to create_valkey_client()
- Enable component-specific names for better debugging:
  * praisonai_state_store for StateStore
  * praisonai_vector_store for VectorKnowledgeStore
  * praisonai_storage_adapter for StorageAdapter
  * praisonai_search_backend for SearchBackend
- Maintain backward compatibility with default fallback
- Allow client_name=None to disable CLIENT SETNAME

Addresses Qodo reviewer feedback about hardcoded client names.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
2026-06-01 22:22:23 +00:00
Anna Tao 10d55167d8 feat: add CLIENT SETNAME for connection identification
Adds client_name="praisonai_valkey_client" to the shared Valkey client
factory so all PraisonAI connections are identifiable via CLIENT LIST.

Signed-off-by: Anna Tao <[email protected]>
2026-06-01 15:01:26 -07:00
4 changed files with 16 additions and 5 deletions

No files matched your search

@@ -30,15 +30,22 @@ def create_valkey_client(
port: int = 6379,
password: Optional[str] = None,
db: int = 0,
client_name: Optional[str] = "praisonai_valkey_client",
):
"""Create and return a GlideClientSync instance."""
if GlideClientSync is None:
raise ImportError(_MISSING_MSG)
addresses = [NodeAddress(host, port)]
creds = ServerCredentials(password=password) if password else None
config = GlideClientConfiguration(
addresses=addresses,
credentials=creds,
database_id=db,
)
# Build configuration, only include client_name if provided
config_kwargs = {
"addresses": addresses,
"credentials": creds,
"database_id": db,
}
if client_name is not None:
config_kwargs["client_name"] = client_name
config = GlideClientConfiguration(**config_kwargs)
return GlideClientSync.create(config)
@@ -73,6 +73,7 @@ class ValkeyVectorKnowledgeStore(KnowledgeStore):
host=self.host,
port=self.port,
password=self.password,
client_name="praisonai_vector_store",
)
return self._client
@@ -52,6 +52,7 @@ class ValkeyStateStore(StateStore):
port=self.port,
password=self.password,
db=self.db,
client_name="praisonai_state_store",
)
return self._client
@@ -80,6 +80,7 @@ class ValkeyStorageAdapter:
host=self.host,
port=self.port,
password=self.password,
client_name="praisonai_storage_adapter",
)
return self._client
@@ -260,6 +261,7 @@ class ValkeySearchBackend:
host=self.host,
port=self.port,
password=self.password,
client_name="praisonai_search_backend",
)
return self._client