Commit Graph

3 Commits

Author SHA1 Message Date
anhtran-ai
781c18d837 fix(codex): strip Unicode-property tool schema patterns Codex rejects
Codex's /responses validator has no Unicode property escapes, so a tool
`pattern` containing `\p{...}` 400s the whole request with `Invalid schema
for function ... is not a 'regex'` — identically on every account, costing a
full combo failover per turn (#3922).

- Add open-sse/utils/codexToolSchema.js: copy-on-write walk that drops only
  `pattern` values carrying a property escape, returning the original
  reference when nothing changed so the caller's schema stays intact for a
  retry against another provider
- Treat `properties` keys as property names, so a field literally called
  `pattern` is never read as the schema keyword; skip escaped literals via
  backslash-parity counting
- Apply it in normalizeCodexTools for both function and namespace sub-tool
  parameters, and log the strip count via dbg
- Add three cases to tests/unit/codex-tool-normalization.test.js
2026-09-10 22:25:47 +07:00
tenglong
e544bfceae fix(codex): preserve Responses text format
Add "text" to Codex Responses API allowlist so text.format.json_schema
reaches upstream for structured outputs instead of being stripped.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 10:37:29 +07:00
Sutarto Jordan Chrisfivo
ed68bcedf8 fix(codex): preserve custom tools during request normalization
Add CODEX_PASSTHROUGH_TOOL_TYPES allowlist so Responses-native freeform
tools (e.g. grammar-backed apply_patch) survive normalizeCodexTools and
reach the upstream Codex Responses API intact.

Refs #1907

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 16:01:45 +07:00