hermes - 💡(How to fix) Fix [Bug]: HTTP 400 from openai-codex on memory tool — top-level allOf in MEMORY_SCHEMA (regression from #19180)

Official PRs (…)
ON THIS PAGE

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…

Error Message

verbatim API error above is the salient signal.)

Root Cause

After updating to any build that includes commit 5b24c0fa8 ("fix: require memory schema fields by action", originally PR #19180, salvaged in PR #21238), every agent call fails immediately when the active provider is openai-codex. The Codex backend at chatgpt.com/backend-api/codex rejects the memory tool's parameters because the schema includes allOf at the top level — a JSON Schema combinator the strict tool validator does not accept.

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.
| provider=openai-codex param=tools[15].parameters
| code=invalid_function_parameters type=invalid_request_error

---

ROOT: API call failed after 3 retries. HTTP 400: ...
  provider=openai-codex model=gpt-5.4-mini msgs=4 tokens=~4,274

---

Hermes:     0.12.0 (2026.4.30)
Affected:   any HEAD that includes 5b24c0fa8 ("fix: require memory schema fields by action")
OS:         Debian 13, Linux 6.12.73+deb13-amd64 x86_64
Python:     3.11.15
OpenAI SDK: 2.33.0
Provider:   openai-codex
Model:      gpt-5.4-mini
Endpoint:   https://chatgpt.com/backend-api/codex

(`hermes debug share` upload skipped: gateway logs contain user-message
bodies and Telegram chat IDs that the redactor does not strip. The
verbatim API error above is the salient signal.)
RAW_BUFFERClick to expand / collapse

Bug Description

After updating to any build that includes commit 5b24c0fa8 ("fix: require memory schema fields by action", originally PR #19180, salvaged in PR #21238), every agent call fails immediately when the active provider is openai-codex. The Codex backend at chatgpt.com/backend-api/codex rejects the memory tool's parameters because the schema includes allOf at the top level — a JSON Schema combinator the strict tool validator does not accept.

This is a regression: before that commit, MEMORY_SCHEMA["parameters"] had only type/properties/required, which was Codex-compatible.

PR #21295 ("fix: strip Codex-hostile top-level schema combinators") is already open and proposes the proper fix at the sanitizer layer. Filing this so the regression has a tracked issue and a duplicate-search hit for other affected users.

Steps to Reproduce

  1. Set model.provider: openai-codex in ~/.hermes/config.yaml (any Codex model, e.g. gpt-5.4-mini)
  2. Send any message to the agent (CLI or any gateway)
  3. Request fails on the very first turn — non-retryable

Expected Behavior

Agent processes the message and replies. The memory tool is registered with a schema acceptable to OpenAI's strict tool validator.

Actual Behavior

HTTP 400: Invalid schema for function 'memory': schema must have type 'object'
and not have 'oneOf'/'anyOf'/'allOf'/'enum'/'not' at the top level.
| provider=openai-codex param=tools[15].parameters
| code=invalid_function_parameters type=invalid_request_error

Gateway log:

ROOT: API call failed after 3 retries. HTTP 400: ...
  provider=openai-codex model=gpt-5.4-mini msgs=4 tokens=~4,274

Affected Component

Agent Core, Tools

Messaging Platform (if gateway-related)

Telegram (also reproduces in CLI — affects every interface that sends tool definitions)

Debug Report

Hermes:     0.12.0 (2026.4.30)
Affected:   any HEAD that includes 5b24c0fa8 ("fix: require memory schema fields by action")
OS:         Debian 13, Linux 6.12.73+deb13-amd64 x86_64
Python:     3.11.15
OpenAI SDK: 2.33.0
Provider:   openai-codex
Model:      gpt-5.4-mini
Endpoint:   https://chatgpt.com/backend-api/codex

(`hermes debug share` upload skipped: gateway logs contain user-message
bodies and Telegram chat IDs that the redactor does not strip. The
verbatim API error above is the salient signal.)

Operating System

Debian 13 (Linux 6.12.73+deb13-amd64)

Python Version

3.11.15

Hermes Version

0.12.0 (2026.4.30) — bug present on main at any commit ≥ 5b24c0fa8

Root Cause Analysis (optional)

  • tools/memory_tool.py:563-585 (after 5b24c0fa8) places allOf with if/then conditional-required clauses at the top level of the tool's parameters object.
  • OpenAI Codex's strict tool validator rejects any oneOf/anyOf/allOf/enum/not at the parameters root and returns HTTP 400 before any model call.
  • Hermes ships per-provider schema sanitizers for Gemini (agent/gemini_schema.py), Anthropic (agent/anthropic_adapter.py), and Moonshot (agent/moonshot_schema.py), but no equivalent path for OpenAI Codex strict mode — the canonical schema reaches the wire unchanged.
  • Anthropic enforces the same restriction; this regression likely affects that provider too. See related #10812 for the same class of bug on honcho_conclude.

Proposed Fix (optional)

PR #21295 already implements the right approach: a tools/schema_sanitizer.py that strips oneOf/anyOf/allOf/enum/not only from the top level of each tool's parameters, preserving nested combinators. This keeps MEMORY_SCHEMA's canonical conditional shape useful for providers that accept it, while making the wire payload Codex-compatible. I cherry-picked #21295 locally and the 400 disappears.

Are you willing to submit a PR for this?

Not needed — fix already proposed in #21295.

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