fix(legal-intake): remove invalid inputSchema property keys containing brackets#69
Draft
sd-gh-bot wants to merge 1 commit into
Draft
fix(legal-intake): remove invalid inputSchema property keys containing brackets#69sd-gh-bot wants to merge 1 commit into
sd-gh-bot wants to merge 1 commit into
Conversation
…ckets
The get_legal_intakes tool defined input schema properties with keys like
'filter__priority[$eq]', 'filter__priority[$in]', 'filter__priority[$ne]',
'filter__status[$eq]', 'filter__status[$in]', 'filter__status[$ne]'.
These keys contain '[' and ']' characters which are not allowed by Claude Sonnet
on Vertex AI. The model validates that all inputSchema.properties keys match
the pattern '^[a-zA-Z0-9_.-]{1,64}$', and rejects the entire tool list with:
tools.18.custom.input_schema.properties: Property keys should match
pattern '^[a-zA-Z0-9_.-]{1,64}$'
This caused a BadRequestError (HTTP 400) for every Sidebar request on prod EU
that triggered the tool-list send to claude-sonnet-4-5 on Vertex AI, with no
valid fallback chain available.
Fix: remove the six bracket-keyed duplicate properties from the inputSchema and
clean up the corresponding dead handler branches. The base filter__priority and
filter__status properties (exact-match / $eq) are kept and their descriptions
are updated to document filtering intent clearly.
Co-authored-by: Pranav Pandey <pranav.p@spotdraft.com>
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.
User description
Problem
The
get_legal_intakestool defined 6inputSchema.propertieskeys containing[and]characters:filter__priority[$eq]filter__priority[$in]filter__priority[$ne]filter__status[$eq]filter__status[$in]filter__status[$ne]Claude Sonnet on Vertex AI validates that all
inputSchema.propertieskeys match^[a-zA-Z0-9_.-]{1,64}$before accepting any tool call.[and]are not in that charset, so the model rejected the entire tool list with:This surfaced as an
openai.BadRequestError: Error code: 400on prod EU for every Sidebar request routed tochat_vertex_ai/claude-sonnet-4-5@20250929. Becauseclaude-sonnet-4-5is not in any fallback chain, LiteLLM also failed to recover, resulting in a hard user-visible error.Root cause
src/tools/legal-intake/get_legal_intakes.ts— bracket-keyed properties were meant to let the agent pass Django-style filter operators directly (e.g.filter__priority[$eq]=HIGH), but the keys themselves violate the Anthropic/Vertex AI schema contract.Fix
inputSchema.filter__priorityandfilter__status(valid keys, exact-match semantics) with updated descriptions.Testing
npx tsc --noEmitpasses with no errors.^[a-zA-Z0-9_.-]{1,64}$.Generated description
Below is a concise technical summary of the changes proposed in this PR:
Sanitize
getLegalIntakesToolinput schema by removing bracketed filter keys and expanding descriptions that now explain comma-separated and negated values forfilter__priorityandfilter__status. Clean upgetLegalIntakesrequest parameter handling to no longer read or append the deleted operators, preserving the remaining filters.getLegalIntakesToolschema to drop bracketedfilter__priority/filter__statuskeys and document the allowed values usage for the remaining filters.Modified files (1)
Latest Contributors(2)
getLegalIntakesrequest builder to only appendfilter__priorityandfilter__statusand remove the now-obsolete bracketed operator branches.Modified files (1)
Latest Contributors(2)