mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-15 14:22:43 +00:00
fix: default memory null target to memory store (#46356)
Port from nearai/ironclaw#4547: treat a JSON null memory target as omitted so strict providers that fill optional fields with null use the documented default target instead of failing validation.
This commit is contained in:
parent
6d3d9d0baf
commit
07d93413e5
2 changed files with 26 additions and 0 deletions
|
|
@ -977,6 +977,12 @@ def memory_tool(
|
|||
if store is None:
|
||||
return tool_error("Memory is not available. It may be disabled in config or this environment.", success=False)
|
||||
|
||||
# Some strict providers fill optional schema fields with JSON null rather
|
||||
# than omitting them. Treat ``target: null`` as omitted so memory writes
|
||||
# still use the documented default store instead of failing validation.
|
||||
if target is None:
|
||||
target = "memory"
|
||||
|
||||
if target not in {"memory", "user"}:
|
||||
return tool_error(f"Invalid target '{target}'. Use 'memory' or 'user'.", success=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue