Repository navigation
fix: keep semantic tool-schema patterns portable across providers - #90
Merged
Merged
Conversation
xAI Responses rejects raw control characters in JSON-Schema patterns (#89) and llama.cpp cannot build a grammar from them or from the unanchored watch-condition pattern (#87). Strict RE2 gateways reject the escape-text form instead (#83), so no encoding works everywhere. Drop those patterns from the wire schema. compileSemanticActions and the watch check already enforce the same rules at runtime; descriptions now also reject U+2028/U+2029, which the removed pattern caught. Closes #87 Closes #89
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 0.17.1, requests that include the
interactive_shelltool fail on xAI's Responses API (#89) and llama.cpp servers (#87). Themonitor.semantic.actionsfields sent JSON-Schemapatterns containing raw control characters: xAI rejects those, and llama.cpp can't build a grammar from them. Writing them as\uXXXXescape text instead breaks strict gateways (#83), so no encoding works everywhere.This drops the control-character patterns (action
description,input,inputKeysitems) and the unanchored\\Swatch-condition pattern (nowminLength: 1) from the wire schema. The only patterns left are the ASCII,^...$-anchored safe-ID ones.Runtime validation already enforced the same rules before any terminal write, on every route that accepts
monitor.semantic. The one gap was a description containing U+2028/U+2029, whichcompileSemanticActionsnow rejects. The cases the schema tests used to cover now live in the runtime tests, and the shell-metacharacter case no longer also trips the forbidden-intent check, so it actually pins that check.Thanks @ianbmacdonald and @jeffreysmattson for the detailed isolation work.
Closes #87
Closes #89