Repository navigation
Closed
Description
Safe diagnostics
plugin: 0.8.2
host: pi 1.5.2
catalog CLI: 1.88.5
model: zai-org/GLM-5.3
route: unknown/openai-responses
capabilities: bundled snapshot; host overrides may apply
price: known (verified 2026-11-11; estimate, not billing)
last request: none
Timing measures received body chunks, not tokens. No prompts, tool content, credentials, account data or configured local paths are collected. Model IDs come from the host; review custom names before sharing.
model endpoint: openai-responses (auto; catalog)
Plan
Max
Minimal reproduction
first message: "hey" with model zai-org/GLM-5.3
Error and timing
Error: commandcode API error (400): {"message":"{\"error\":{\"code\":\"invalid_request\",\"details\":{},\"message\":\"input item is missing
type\",\"param\":null,\"request_id\":\"req_bxxx\",\"type\":\"invalid_request_error\"}}","type":"invalid_request_error"}
Exact same setup while using deepseek/deepseek-v4.1-flash just works.
Edit Selecting chat-completions for zai-org/GLM-5.3 also works: Pi does not report any suspicious cache misses for that model on completions but I'm unsure if caching works on completions for that model.
Metadata
Metadata
Assignees
Labels
No labels
Activity
pierreraby commentedon Nov 13, 2026
Thanks for the precise report — it reproduced exactly, and it turned out to be two stacked causes, not one. I probed the live Provider API with a minimal text-only request (
"hey",max_output_tokens: 16) againstzai-org/GLM-5.3in four configurations:reasoningfieldinvalid_request: input item is missing typetype: "message", noreasoningfieldtype: "message"+reasoning: {effort: "none"}unsupported output_config.effort: nonereasoning: {effort: "none"}input item is missing typeSo the missing item type is real, and it is independent of reasoning — removing
reasoningalone still fails (row 1). But fixing it alone is not enough either: once the input is accepted,effort: "none"is refused (row 3).Why the items are untagged
The Responses body is built by the host encoder, not by this extension: pi-ai only tags non-message items (
type: "message"for assistant text,function_call,function_call_output,reasoning). The leadingsystem/developeritem and everyuseritem go out as a bare{role, content}pair. OpenAI accepts that shorthand; the adapter in front of GLM-5.3 does not. I confirmed it by driving the installedpi-aiencoder directly and dumping the body it produces for this model — the very first turn emits a single untagged{role: "user", ...}item.Why
effort: "none"is sentWhen thinking is off, pi-ai reads the level from
thinkingLevelMapand falls back to"none". Declaringoff: nulldoes not fix it: pi then clamps to the lowest allowed level and sendseffort: "low", which silently forces reasoning on instead of disabling it. Omitting thereasoningfield is what actually works.Not specific to GLM-5.3
I swept all 74 models that advertise
/responseswith the same minimal request:zai-org/GLM-5.3. Every other/responsesmodel accepts the shorthand, so this is an adapter quirk, not a general defect of the Responses route.effort: "none"refused by two models:zai-org/GLM-5.3(unsupported output_config.effort: none) andmistral/mistral-large-4(reasoning_effort none is not supported for this model, supported values: [high, low, ...]).mistral-large-4accepts the shorthand fine and answers 200 witheffort: "low"or with noreasoningfield at all — it is broken the same way for anyone running it with thinking off, unrelated to this issue.Two unrelated observations from the sweep, worth separate issues:
Qwen/Qwen3.6-Max-Previewandstepfun/Step-3.5-Flashare still advertised by/provider/v1/modelsbut answer404 Model '...' not found.Workaround available today
/commandcode-endpoint zai-org/GLM-5.3 chat-completions(you already found it) — it works because Chat Completions has a different encoder. Same command fixesmistral/mistral-large-4.Fix
A per-model repair table in the Responses
fetchwrapper: addtype: "message"to role-carrying input items for GLM-5.3, and drop areasoningblock that only sayseffort: "none"for both models. Everything else passes through byte-identical — other models, malformed JSON, non-object bodies, and already-tagged items are untouched. Both repairs are keyed off live evidence, so no other backend's request changes.Locally:
tsc --noEmit, Prettier, 13 new unit tests over the rewrite, and the fullnpm testsuite against real hosts are green. I'll open a PR shortly and link it here. Nothing has been released for this yet.fix(responses): repair the Provider API wire for GLM-5.3 and Mistral …
pierreraby commentedon Nov 13, 2026
Confirmed and fixed in #215 (merged as
6094904), which is onmainnow.Post-merge verification with the bodies the fix actually produces:
zai-org/GLM-5.3, tagged items, noreasoningmistral/mistral-large-4, untouched items, noreasoningOne caveat worth knowing when you re-test by hand:
mistral-large-4reasons by default even with noreasoningfield, so a smallmax_output_tokensgets spent entirely on reasoning and the answer arrives empty. That is not a wire failure — it shows up as200with 0 text deltas and a largereasoning_tokens. With a realistic budget it answers normally.The merged change adds
type: "message"to thesystem/useritems for GLM-5.3 and drops the inertreasoningblock for both GLM-5.3 andmistral/mistral-large-4; every other model's request body is untouched. Until a release is cut,/commandcode-endpoint zai-org/GLM-5.3 chat-completionsremains the workaround on 0.8.2.Closing this issue — the pricing gate is green again on
mainand a patch release will follow.chore(release): prepare 0.8.3 (#216)