You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uvx ruff format openviking/session/memory/extract_loop.py tests/session/memory/test_memory_react.py
Targeted pytest note: this local checkout cannot import the target memory test module with system Python because optional project dependency litellm is not installed; uv run python -m pytest ... also cannot complete here because the editable build tries to build the Rust CLI and the local macOS CommandLineTools xcrun is an incompatible architecture. The new tests are still included for CI.
Initialize self._expected_fields to an empty list before appending to it. Without initialization, self._expected_fields remains None and calling .append() will raise an AttributeError.
# 获取 ExtractContext(整个流程复用)
self._extract_context = self.context_provider.get_extract_context()
if self._extract_context is None:
raise ValueError("Failed to get ExtractContext from provider")
+self._expected_fields = []
for schema in schemas:
self._expected_fields.append(f"{schema.memory_type}")
Suggestion importance[1-10]: 8
__
Why: The suggestion addresses a critical bug where self._expected_fields is used as a list without being initialized (it was set to None), which would cause an AttributeError when calling .append(). The fix is accurate and necessary for the code to function correctly.
Pushed a2ac581e to address the automated review feedback:
Kept delete_uris in the final empty-operations skeleton even if _expected_fields is missing or does not include it, and added a regression for that path.
Moved the existing allowed-directory assertion back into the same patch scope to avoid any ambiguity in the test.
Confirmed _expected_fields is initialized before appending memory type fields in run().
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
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.
Summary
ResolvedOperationsValidation
python3 -m py_compile openviking/session/memory/extract_loop.py tests/session/memory/test_memory_react.pygit diff --checkuvx ruff check openviking/session/memory/extract_loop.py tests/session/memory/test_memory_react.pyuvx ruff format openviking/session/memory/extract_loop.py tests/session/memory/test_memory_react.pyTargeted pytest note: this local checkout cannot import the target memory test module with system Python because optional project dependency
litellmis not installed;uv run python -m pytest ...also cannot complete here because the editable build tries to build the Rust CLI and the local macOS CommandLineToolsxcrunis an incompatible architecture. The new tests are still included for CI.