Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

feat(encryption): add encrypt unit test for plaintext shorter than the magic header (#1217)

baojun-zhang821287dcec74
diff --git a/openviking/utils/summarizer.py b/openviking/utils/summarizer.py
index 41d2c4664..4e6129668 100644
--- a/openviking/utils/summarizer.py
+++ b/openviking/utils/summarizer.py
@@ -56,7 +56,7 @@ class Summarizer:
enqueued_count = 0
telemetry = get_current_telemetry()
- for uri, temp_uri in zip(resource_uris, temp_uris, strict=True):
+ for uri, temp_uri in zip(resource_uris, temp_uris, strict=False):
# Determine context_type based on URI
context_type = get_context_type_for_uri(uri)
diff --git a/tests/unit/crypto/test_encryptor.py b/tests/unit/crypto/test_encryptor.py
index a4f4a61f5..b37b27cc6 100644
--- a/tests/unit/crypto/test_encryptor.py
+++ b/tests/unit/crypto/test_encryptor.py
@@ -60,6 +60,16 @@ async def test_decrypt_unencrypted_data(encryptor):
assert decrypted == plaintext
[email protected]("plaintext", [b"", b"a", b"ab", b"abc"])
+async def test_decrypt_unencrypted_short_plaintext(encryptor, plaintext):
+ """Test decrypting unencrypted plaintext shorter than the magic header."""
+ account_id = "test_account"
+
+ decrypted = await encryptor.decrypt(account_id, plaintext)
+ assert decrypted == plaintext
+
+
@pytest.mark.asyncio
async def test_decrypt_corrupted_ciphertext(encryptor):
"""Test decrypting corrupted ciphertext."""