Conversation
… and long forms
The generated zsh completion script used invalid _arguments syntax:
'(-h --help){-h,--help}[...]'. Zsh () groups must contain only single-letter
short options, not long options with spaces. Changed to '(-)'{-h,--help}'[...]'
which is the standard zsh completion convention.
Closes NousResearch#22686
…d update_fact add_fact() now raises RuntimeError when a concurrent delete removes the fact between a failed INSERT and the follow-up SELECT, instead of crashing with TypeError. update_fact() falls back to category='general' when the category re-fetch returns no row after a concurrent delete. Closes NousResearch#22660
teknium1
left a comment
There was a problem hiding this comment.
Thanks for covering the unguarded fetchone() paths. The memory portion still targets current-main code: plugins/memory/holographic/store.py:175-178 and :306-308 remain unguarded, and the latter re-fetch occurs after the commit at :290.
Problems
tests/hermes_cli/test_completion.pydefinestest_valid_zsh_arguments_syntaxtwice in this PR; the second definition shadows the first.tests/plugins/memory/test_holographic_store_null_guards.py:21-24creates adelete=Falsedatabase but never removes it.- The zsh implementation is already on main at
hermes_cli/completion.py:220-243, with stronger existing coverage attests/hermes_cli/test_completion.py:148-187(commits8c4bec615and6d30b4a7e).
Suggested changes
- Salvage the focused memory fix only, remove the duplicate test definition, and use
tmp_pathor unlink the temporary database.
Automated hermes-sweeper review.
| assert "'(-)'{-h,--help}'" in out | ||
| assert "'(-)'{-V,--version}'" in out | ||
| assert "'(-)'{-p,--profile}'" in out | ||
|
|
There was a problem hiding this comment.
This is a second definition of test_valid_zsh_arguments_syntax; Python silently replaces the first method with this one. Please keep only one copy so the intended coverage is not shadowed.
| def store(): | ||
| """Create a MemoryStore backed by a temporary database.""" | ||
| with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as f: | ||
| path = f.name |
There was a problem hiding this comment.
NamedTemporaryFile(delete=False) leaves the database behind because this fixture only closes the connection. Please use pytest's tmp_path fixture or unlink the file in teardown.
Summary
add_fact(): raisesRuntimeErrorwith descriptive message when a concurrent delete removes the fact between a failed INSERT and the follow-up SELECT, instead of crashing withTypeErrorupdate_fact(): falls back tocategory="general"when the category re-fetch returns no row after a concurrent deleteCloses #22660