Skip to content

fix(memory): guard fetchone() against None in MemoryStore add_fact and update_fact#22702

Open
Ninso112 wants to merge 2 commits into
NousResearch:mainfrom
Ninso112:fix-memory-fetchone-guard
Open

fix(memory): guard fetchone() against None in MemoryStore add_fact and update_fact#22702
Ninso112 wants to merge 2 commits into
NousResearch:mainfrom
Ninso112:fix-memory-fetchone-guard

Conversation

@Ninso112

@Ninso112 Ninso112 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add_fact(): raises RuntimeError with descriptive message 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
  • Added 5 tests covering normal dedup, concurrent delete in both methods, category skip, and non-existent fact handling

Closes #22660

Ninso112 added 2 commits May 9, 2026 18:20
… 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
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers duplicate This issue or pull request already exists labels May 9, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing with #22660 (same fix — guard fetchone() in MemoryStore). #22660 is from the original author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants