mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-21 03:39:54 +00:00
2fae8fba9c
xAI's /responses endpoint rejects tool schemas that contain pattern or format JSON Schema keywords with HTTP 400. chat_completion_helpers.py already strips these for the main-agent xAI/xai-oauth path (lines 294-302), but _CodexCompletionsAdapter.create() — used for every xAI OAuth auxiliary call (kanban decomposer, profile describer, etc.) — passed raw tool schemas without sanitization. MCP tools that carry pattern/format keywords (common for string fields) silently caused every auxiliary call over xAI OAuth to fail with an HTTP 400, while the main agent worked fine. Parity fix: call strip_pattern_and_format() on the tool list before converting to Responses API format, matching the main-agent guarantee.