Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(assistant): replace z.unknown() in settings tool with a typed union (fixes #2892)#2896

Open
alexcf wants to merge 1 commit into
elie222:mainelie222/inbox-zero:mainfrom
alexcf:fix/assistant-settings-strict-schemaalexcf/inbox-zero:fix/assistant-settings-strict-schemaCopy head branch name to clipboard
Open

fix(assistant): replace z.unknown() in settings tool with a typed union (fixes #2892)#2896
alexcf wants to merge 1 commit into
elie222:mainelie222/inbox-zero:mainfrom
alexcf:fix/assistant-settings-strict-schemaalexcf/inbox-zero:fix/assistant-settings-strict-schemaCopy head branch name to clipboard

Conversation

@alexcf

@alexcf alexcf commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #2892.

Problem

The AI chat assistant is fully broken on strict-schema openai-compatible endpoints (llama.cpp / vLLM / LM Studio with structured outputs). The browser throws:

Error: JSON schema conversion failed: Unrecognized schema: {"description":"Setting value for the path. Type depends on the path definition."}

and the assistant returns nothing.

Root cause

updateAssistantSettings declares its value as z.unknown(), which emits a JSON Schema node with no type. With supportsStructuredOutputs: true on the provider (utils/llms/model.ts), the tool schema goes to the endpoint’s structured-output path, where the server’s grammar builder (e.g. llama.cpp json-schema-to-grammar) rejects the typeless node — aborting the whole tool set.

Fix

Replace z.unknown() with an explicit union of the value shapes the settings paths accept (primitives, arrays of primitives, and the existing object schemas). The per-path type is still re-validated downstream against the strict settingsChangeSchema discriminated union, so this only needs to be a permissive, fully-typed superset. A naive z.record(...) would emit additionalProperties:false with no properties and silently reject object values, so the union is the correct shape.

Validation

Reproduced the emitted tool JSON Schema on the pinned SDK versions: the old schema emits the typeless node verbatim; the new one emits zero typeless nodes and accepts string/number/boolean/null/array/object.

🤖 Generated with Claude Code

Review in cubic

The updateAssistantSettings tool declared its `value` as z.unknown(), which
emits a JSON Schema node with no `type`. With supportsStructuredOutputs:true
(openai-compatible provider), strict-schema endpoints (llama.cpp / vLLM /
LM Studio) reject the typeless node when building a constrained-decoding
grammar - "JSON schema conversion failed: Unrecognized schema" - which aborts
the entire chat tool set, so the assistant returns nothing.

Replace z.unknown() with an explicit union of the value shapes the settings
paths accept (primitives, arrays of primitives, and the existing object
schemas). The per-path type is still re-validated downstream against the
strict settingsChangeSchema discriminated union, so this only needs to be a
permissive, fully-typed superset.
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@alexcf is attempting to deploy a commit to the Inbox Zero OSS Program Team on Vercel.

A member of the Team first needs to authorize it.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@alexcf
alexcf force-pushed the fix/assistant-settings-strict-schema branch from 55f26cd to 814ca78 Compare July 3, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI chat assistant broken on strict openai-compatible endpoints: "Unrecognized schema" tool-schema conversion failure

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.