fix: restore failure_memory tests — remove skip, fix imports and key names#130
fix: restore failure_memory tests — remove skip, fix imports and key names#130acailic wants to merge 3 commits into
Conversation
…and key names Closes #127 - Remove pytestmark skip (feature is implemented in collector/failure_memory.py) - Import EmbeddingGenerationError, FailureSignature, SimilarFailureMatch from collector.failure_memory instead of defining local placeholder classes - Fix metadata key assertions: metadata → metadatas[0] to match vector_db API - Fix make_error_event call: pass tool_name inside data= dict - Fix make_session call: pass plain dict instead of Session object (method accepts dict[str, Any]) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Restores and updates the Failure Memory test suite so it runs again and validates the implemented collector.failure_memory types and vector DB call signatures (fixes #127).
Changes:
- Re-enabled the Failure Memory tests by removing the module-level skip.
- Updated tests to import real
collector.failure_memoryclasses (avoids placeholder/dataclass mismatches inisinstancechecks). - Corrected vector DB call-arg assertions to use
metadatas=[...]shapes and fixed fixture usage fortool_name/ session input types.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| make_decision_event, | ||
| make_session, |
There was a problem hiding this comment.
make_decision_event and make_session are injected into test_link_to_why_button_analysis but not used. Removing unused fixture parameters will avoid unnecessary fixture setup and keep the test focused on the behavior under test.
| make_decision_event, | |
| make_session, |
There was a problem hiding this comment.
Fixed. Removed and from the fixture parameters — neither was referenced in the test body. Also fixed a pre-existing ruff import-sort warning (I001) in the same file. 12 tests pass.
…_button_analysis Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the incorrect skip guard and replace local placeholder classes with real imports from collector.failure_memory; fix assertion keys to use metadatas (plural) matching the actual vector_db.add/update call signatures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Fixes #127
pytestmark = pytest.mark.skip(...)removed — the feature is fully implemented incollector/failure_memory.pyEmbeddingGenerationError,FailureSignature,SimilarFailureMatch) with imports fromcollector.failure_memory, soisinstanceassertions work correctlyadd_args[1]["metadata"][...]→add_args[1]["metadatas"][0][...]andupdate_args[1]["metadata"][...]→update_args[1]["metadatas"][0][...]to match the actual vector DB call signatures (metadatas=[...])tool_namepassed viadata=dict inmake_error_event;remember_session_failuresfed a plaindictas it expectsdict[str, Any]Test plan
python3 -m pytest -q tests/test_feature_2_failure_memory.py→ 12 passed, 0 failed🤖 Generated with Claude Code