Skip to content

fix: keep semantic tool-schema patterns portable across providers - #90

Merged
nicobailon merged 1 commit into
mainfrom
fix/portable-semantic-schema-patterns
Oct 21, 2026
Merged

nicobailon merged 1 commit into
mainfrom
fix/portable-semantic-schema-patterns

Conversation

@nicobailon

Copy link
Copy Markdown
Owner

Since 0.17.1, requests that include the interactive_shell tool fail on xAI's Responses API (#89) and llama.cpp servers (#87). The monitor.semantic.actions fields sent JSON-Schema patterns containing raw control characters: xAI rejects those, and llama.cpp can't build a grammar from them. Writing them as \uXXXX escape text instead breaks strict gateways (#83), so no encoding works everywhere.

This drops the control-character patterns (action description, input, inputKeys items) and the unanchored \\S watch-condition pattern (now minLength: 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, which compileSemanticActions now 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant