[Bug] Anthropic-compatible endpoint rejects a JSON Schema `pattern` with Unicode property escapes (\p{Cc}) with 400 code 1210, breaking every interactive Claude Code turn
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
工具调用 / MCP · Tool use / MCP
涉及的 Agent 框架 · Agent framework
Claude Code
严重程度 · Severity
阻塞使用 · Blocking (无法使用核心功能 / core function unusable)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
Claude Code (interactive mode) pointed at the Anthropic-compatible endpoint with glm-5.3 fails on every turn with:
API Error: 400 [glm/glm-5.3] {"type":"error","error":{"type":"invalid_request_error","code":"1210","message":"[1210][Invalid API parameter, please check the documentation.][<request id>]"}}
claude -p "..." (print mode) works against the same endpoint. Bisecting the two captured request bodies shows the only difference that matters is the tools array: interactive mode includes Claude Code's built-in Artifact tool, and inside its input_schema the field property carries this pattern:
^(?!__.*__$)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}"\\./[\]]{1,200}$
Removing that single pattern makes the identical request return 200. The other five patterns in the same schema are accepted. So the endpoint's schema validator cannot compile ECMA-262 Unicode property escapes (\p{...}), which are valid in JSON Schema pattern (ECMA-262 dialect), and it rejects the whole request with a generic 1210 rather than naming the parameter.
This affects every Claude Code user on the GLM Coding Plan as soon as they use the interactive CLI (versions 2.1.263, 2.1.265, 2.1.266 all send this tool).
复现步骤 · Steps to reproduce
- Send any Messages request to the Anthropic-compatible endpoint with a tools entry whose input_schema contains a string property with
"pattern": "^[^\\p{Cc}]{1,200}$". Standalone repro (replace the key):
curl -s https://api.z.ai/api/anthropic/v1/messages \
-H 'content-type: application/json' -H 'anthropic-version: 2023-06-01' -H 'x-api-key: <KEY>' \
-d '{"model":"glm-5.3","max_tokens":32,"messages":[{"role":"user","content":"Say OK"}],
"tools":[{"name":"probe","description":"probe","input_schema":{"type":"object","properties":{"field":{"type":"string","pattern":"^[^\\p{Cc}]{1,200}$"}}}}]}'
- Observe HTTP 400, error code 1210.
- Send the same request without the
patternkeyword: HTTP 200. - Real-world path: start interactive Claude Code with
ANTHROPIC_BASE_URLset to the endpoint and send any prompt; every turn fails.claude -psucceeds because print mode omits theArtifacttool.
期望表现 · Expected behavior
Either accept ECMA-262 Unicode property escapes in pattern (the JSON Schema dialect Claude Code and the Anthropic API use), or ignore pattern keywords the validator cannot compile instead of rejecting the request. In all cases the 1210 error should name the offending parameter (e.g. tools[32].input_schema.properties.field.pattern) so users can find it without bisecting request bodies.
实际表现 · Actual behavior
HTTP 400 with {"type":"invalid_request_error","code":"1210","message":"[1210][Invalid API parameter, please check the documentation.][...]"}, no indication of which parameter. Interactive Claude Code is unusable on the endpoint; the only workaround found is "permissions": {"deny": ["Artifact"]} in Claude Code's settings.json, which removes the tool from the request.
ZCode 版本 · ZCode version
Not ZCode: Claude Code CLI 2.1.263 / 2.1.265 / 2.1.266 against the Anthropic-compatible API, model glm-5.3
设备 / 系统 / 浏览器 · Device / OS / Browser
macOS 26 (Apple Silicon) / Claude Code CLI / requests reach the endpoint through a local Anthropic-compatible proxy (9router); reproduced with plain curl as well
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
Upstream request ids for two failing turns: 202609090758534b30326b670343d5 and 202609090759179161046158a5442f (2026-09-09, UTC+3 morning).
Bisection log (same request body, only the named part changed):
- full interactive body: 400 / 1210
- interactive body with print-mode
tools: 200 - print-mode body + only the
Artifacttool added: 400 / 1210; + AskUserQuestion, EnterPlanMode, ExitPlanMode, SendFeedback individually: 200 - Artifact with its
patternkeywords stripped: 200; with each other keyword (propertyNames,prefixItems,additionalProperties,anyOf,const,maxLength) stripped: still 400 - keeping exactly one pattern at a time: only
^(?!__.*__$)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}"\\./[\]]{1,200}$fails; the other five pass
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the standalone curl reproduction against the Anthropic-compatible endpoint and compare requests with and without the Unicode-property pattern. Trace the schema validation path for the tools input schema; done means the request is accepted or the 1210 response identifies the offending pattern parameter, with the provided Claude Code and curl cases covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100