Repository navigation
fix: strip regex patterns invalid under strict provider validators - #68
Merged
Merged
Conversation
Extends the lookaround strip from #58: any schema pattern that fails to compile under the RegExp v flag (e.g. the database password pattern with an unescaped '[' inside a character class) is now removed from the advertised tool schemas. DeepSeek and other strict validators reject these patterns, breaking tools/list for all database tools. Server-side Zod validation is unchanged; only the JSON Schema exposed to clients is sanitized. Fixes #43 Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Aug 7, 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.
Fixes #43.
Summary
Extends the runtime schema sanitization introduced in #58: in addition to lookarounds, any
patternthat fails to compile under the strict RegExpvflag is now stripped from the tool schemas advertised viatools/list.This fixes the database password pattern (
^[a-zA-Z0-9@#%^&*()_+\-=[\]{}|;:,.<>?~]*$) — its unescaped[` inside the character class is valid classic ECMA-262 but rejected by DeepSeek and other strict provider validators, which broke all database tools (see #43).Why this approach
server.ts, instead of adding a second strip pass in the codegen path.Verification
libsql-*,mariadb-*,mongo-*,mysql-*,postgres-*,redis-changePassword) verified clean in a realtools/listover InMemoryTransport.^(all|\d+[smhd])$,^[a-zA-Z0-9.\-_]+$) compile under strict syntax — nothing over-stripped.vflag.pnpm test(6/6),pnpm type-check,pnpm buildall pass.Credit to @Baijack-star for the diagnosis in #43/#44 — this supersedes #44 with a generic runtime fix.
🤖 Generated with Claude Code