fix: address coderabbit review feedback

- Add try/except to _build_context, return None when hash fails
- Return None from _serialize_cache_key on total failure (no id()-based fallback)
- Replace hex-like test literal with non-secret placeholder

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Deep Mehta
2026-03-03 13:04:10 -08:00
parent da514866d6
commit 04097e6902
3 changed files with 23 additions and 14 deletions

View File

@@ -333,13 +333,13 @@ class TestCacheContext:
prompt_id="prompt-123",
node_id="node-456",
class_type="KSampler",
cache_key_hash="abcdef1234567890" * 4,
cache_key_hash="a" * 64,
)
assert context.prompt_id == "prompt-123"
assert context.node_id == "node-456"
assert context.class_type == "KSampler"
assert context.cache_key_hash == "abcdef1234567890" * 4
assert context.cache_key_hash == "a" * 64
class TestCacheValue: