fix(memory): remove dead allOf schema block at the source

PR #21238 introduced top-level `allOf: [{if/then/required}]` blocks in the
built-in memory tool's parameters schema as conditional-required hints.
Two problems:

1. OpenAI's Codex backend (chatgpt.com/backend-api/codex, gpt-5.x) rejects
   top-level `allOf`/`anyOf`/`oneOf`/`enum`/`not` outright with a
   non-retryable 400 — affected every user on openai-codex/gpt-5.x.
2. The `if/then` hints were silently ignored by every other provider
   (Chat Completions doesn't honour them on function schemas), so they
   never actually enforced anything anywhere.

The runtime handler in `memory_tool()` already validates the per-action
required fields and returns actionable error messages, so removing the
block changes nothing behaviourally.

Paired with the defense-in-depth sanitizer in the previous commit, this
closes the bug both at the source (schema no longer emits the forbidden
form) and at the wire boundary (sanitizer strips it if anything else
re-introduces it).

- Rewrites `tests/tools/test_memory_tool_schema.py` to guard against
  regressing the forbidden-combinator shape instead of asserting it.
- Adds AUTHOR_MAP entry for @hrkzogw (author of the sanitizer fix).
This commit is contained in:
Teknium 2026-05-07 07:02:05 -07:00
parent 3924cb408b
commit 5a3e5b23d2
3 changed files with 38 additions and 50 deletions

View file

@ -560,29 +560,6 @@ MEMORY_SCHEMA = {
},
},
"required": ["action", "target"],
"allOf": [
{
"if": {
"properties": {"action": {"const": "add"}},
"required": ["action"],
},
"then": {"required": ["content"]},
},
{
"if": {
"properties": {"action": {"const": "replace"}},
"required": ["action"],
},
"then": {"required": ["old_text", "content"]},
},
{
"if": {
"properties": {"action": {"const": "remove"}},
"required": ["action"],
},
"then": {"required": ["old_text"]},
},
],
},
}