Repository navigation
fix(memory): default null target to memory store - #46356
Conversation
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.
🔎 Lint report:
|
| Rule | Count |
|---|---|
invalid-argument-type |
2 |
invalid-assignment |
1 |
First entries
tests/tools/test_memory_tool.py:429: [invalid-argument-type] invalid-argument-type: Argument to function `memory_tool` is incorrect: Expected `str`, found `None`
tests/tools/test_memory_tool.py:440: [invalid-argument-type] invalid-argument-type: Argument to function `memory_tool` is incorrect: Expected `str`, found `Literal[42]`
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
✅ Fixed issues (2):
| Rule | Count |
|---|---|
unresolved-attribute |
2 |
First entries
run_agent.py:2920: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
Unchanged: 5733 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
|
Verification: Reviewed the diff — treating |
|
Merged in PR #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.
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.
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.
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.
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.
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.
Summary
memory(action="add", target=null, ...)now behaves like an omitted target and writes to the default memory store.Source: nearai/ironclaw#4547 fixed the same strict-provider shape for IronClaw's
memory_writecapability. Hermes adapts the invariant at the Python tool dispatcher boundary instead of adding provider-specific schema plumbing.Changes
tools/memory_tool.py: normalizetarget is Noneto"memory"before target validation.tests/tools/test_memory_tool.py: add regression coverage fortarget=Noneand keep non-string targets rejected.Validation
scripts/run_tests.sh tests/tools/test_memory_tool.pyMemoryStore, temp memory dir,target=NonewritesMEMORY.md;target=42still rejectedSource adaptation
Infographic