Repository navigation
Conversation
RedisLTMBackend built its Redis client without the configured username (DATABASE_REDIS_USERNAME / RedisConfig.username), so it always authenticated as the default user. With a Redis ACL account the connection failed with "invalid username-password pair". The Redis knowledge base backend already passes it, and the harness CLI already writes DATABASE_REDIS_USERNAME for long-term memory.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
RedisLTMBackendbuilds its Redis client fromhost,port,dbandpassword, but notusername.RedisConfig.username(DATABASE_REDIS_USERNAME) is therefore ignored and the client always authenticates as thedefaultuser. With a Redis ACL account (non-default user), long-term memory cannot connect at all:The Redis knowledge base backend (
veadk/knowledgebase/backends/redis_backend.py) already passesusername=self.redis_config.username, andveadk harness add --long-term-memory-usernamealready writesDATABASE_REDIS_USERNAMEfor long-term memory (viaBACKEND_ENV["redis"]), so the setting is accepted but has no effect.Fix
username=self.redis_config.usernametoRedis(...)inRedisLTMBackend._create_vector_index. The default is stillNone, so password-only setups behave exactly as before.usernameline to the long-term memory Redis section of the generatedharness.yamlcomments, matching the knowledge base section.Verification
ACL SETUSER ltmuser on >ltmpass ~* &* +@all, default user protected by a different password),MockEmbedding:save_memory("u1", ...)raisesAuthenticationError: invalid username-password pair or user is disabled.search_memorywork; a password-only config (no username) also still works.tests/memory/long_term_memory_backends/test_redis_ltm_client.py(fakeRedis, no server needed): both tests fail on main and pass with the fix.uv run --extra dev pre-commit run --all-files: pass.uv run --extra dev pytest -n 4 -m "not codex_smoke and not piagent_smoke": 8057 passed. The same 24 failures and 2 collection errors (Codex runtime / frontend / self-host sandbox tests that need local tooling) occur on unmodified main in this environment.Independent of #1201 (which changes the index prefix in the same file); they touch different lines.
This PR was prepared with an AI coding agent; I authorized the submission.