hermes - 💡(How to fix) Fix [Bug]: core memory tool schema uses allOf at root, rejected by OpenAI/Anthropic

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The built-in memory tool (tools/memory_tool.py) uses allOf with if/then at the root of its parameters schema. OpenAI (GPT-5.5) and Anthropic reject this with a non-retryable HTTP 400, blocking all agent calls when the memory toolset is enabled.

This is the same pattern that was fixed for the Honcho plugin in #10812 — the fix there was to remove schema-level anyOf and rely on runtime validation. The core memory tool now needs the same treatment.

Error Message

HTTP 400: Invalid schema for function 'memory': schema must have type 'object' and not have 'oneOf'/'anyOf'/'allOf'/'enum'/'not' at the top level.

Details: {'param': 'tools[65].parameters', 'code': 'invalid_function_parameters'}

Root Cause

  • #10812 — same root cause in Honcho plugin, fixed by removing anyOf and relying on runtime checks.

Fix Action

Fix / Workaround

  • #10812 — same root cause in Honcho plugin, fixed by removing anyOf and relying on runtime checks.

Code Example

HTTP 400: Invalid schema for function 'memory': schema must have type 'object' and not have 'oneOf'/'anyOf'/'allOf'/'enum'/'not' at the top level.

---

"allOf": [
    {
        "if": {
            "properties": {"action": {"const": "add"}},
            "required": ["action"],
        },
        "then": {"required": ["content"]},
    },
    ...
],
RAW_BUFFERClick to expand / collapse

Summary

The built-in memory tool (tools/memory_tool.py) uses allOf with if/then at the root of its parameters schema. OpenAI (GPT-5.5) and Anthropic reject this with a non-retryable HTTP 400, blocking all agent calls when the memory toolset is enabled.

This is the same pattern that was fixed for the Honcho plugin in #10812 — the fix there was to remove schema-level anyOf and rely on runtime validation. The core memory tool now needs the same treatment.

Error

HTTP 400: Invalid schema for function 'memory': schema must have type 'object' and not have 'oneOf'/'anyOf'/'allOf'/'enum'/'not' at the top level.

Details: {'param': 'tools[65].parameters', 'code': 'invalid_function_parameters'}

Location

Commit 5b24c0fa8 ("fix: require memory schema fields by action", 3 May 2026) introduced this in tools/memory_tool.py, MEMORY_SCHEMA['parameters']:

"allOf": [
    {
        "if": {
            "properties": {"action": {"const": "add"}},
            "required": ["action"],
        },
        "then": {"required": ["content"]},
    },
    ...
],

Reproduction

  1. Enable memory toolset (default on CLI and gateway).
  2. Use any provider with strict schema validation: OpenAI (GPT-5.5), Anthropic (Claude), or Azure via OpenRouter.
  3. Start a fresh session (/reset or new CLI invocation); prompt caching on existing sessions may mask the error.
  4. Send any message — instant HTTP 400, non-retryable.

Why it was not noticed immediately

Moonshot Kimi (the previous default for many users) silently accepts allOf/if/then. The bug only surfaces when switching to OpenAI/Anthropic or when an existing cached session expires and the fresh schema is sent.

Local fix applied

Removed the allOf block from MEMORY_SCHEMA. The runtime memory_tool() handler already validates every case:

  • action="add" without content → returns tool_error(...)
  • action="replace" without old_text or content → returns tool_error(...)
  • action="remove" without old_text → returns tool_error(...)

So removing the schema-level constraint does not reduce safety.

Environment

  • Hermes: commit c2d6b385f (post 3-May update)
  • Python: 3.13
  • Affected: OpenAI, Anthropic, Azure via OpenRouter — any backend enforcing strict tool schemas
  • Not affected: Moonshot Kimi (permissive)

Related

  • #10812 — same root cause in Honcho plugin, fixed by removing anyOf and relying on runtime checks.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING