Skip to content

fix(legal-intake): remove invalid inputSchema property keys containing brackets#69

Draft
sd-gh-bot wants to merge 1 commit into
mainfrom
fix/legal-intake-invalid-schema-keys
Draft

fix(legal-intake): remove invalid inputSchema property keys containing brackets#69
sd-gh-bot wants to merge 1 commit into
mainfrom
fix/legal-intake-invalid-schema-keys

Conversation

@sd-gh-bot
Copy link
Copy Markdown
Contributor

@sd-gh-bot sd-gh-bot commented May 13, 2026

User description

Problem

The get_legal_intakes tool defined 6 inputSchema.properties keys 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.properties keys 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:

tools.18.custom.input_schema.properties: Property keys should match pattern '^[a-zA-Z0-9_.-]{1,64}$'

This surfaced as an openai.BadRequestError: Error code: 400 on prod EU for every Sidebar request routed to chat_vertex_ai/claude-sonnet-4-5@20250929. Because claude-sonnet-4-5 is 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

  • Remove the 6 bracket-keyed duplicate properties from inputSchema.
  • Keep filter__priority and filter__status (valid keys, exact-match semantics) with updated descriptions.
  • Remove the now-dead handler branches that read from those keys.
  • TypeScript compiles clean with no errors.

Testing

  • npx tsc --noEmit passes with no errors.
  • All property keys in the updated schema match ^[a-zA-Z0-9_.-]{1,64}$.
  • No other tools were found to have bracket-keyed property names.

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Sanitize getLegalIntakesTool input schema by removing bracketed filter keys and expanding descriptions that now explain comma-separated and negated values for filter__priority and filter__status. Clean up getLegalIntakes request parameter handling to no longer read or append the deleted operators, preserving the remaining filters.

TopicDetails
Legal intake filters Update getLegalIntakesTool schema to drop bracketed filter__priority/filter__status keys and document the allowed values usage for the remaining filters.
Modified files (1)
  • src/tools/legal-intake/get_legal_intakes.ts
Latest Contributors(2)
UserCommitDate
neo@spotdraft.comfix(legal-intake): rem...May 13, 2026
vinit@spotdraft.comadded support to get l...April 28, 2026
Request params Simplify getLegalIntakes request builder to only append filter__priority and filter__status and remove the now-obsolete bracketed operator branches.
Modified files (1)
  • src/tools/legal-intake/get_legal_intakes.ts
Latest Contributors(2)
UserCommitDate
neo@spotdraft.comfix(legal-intake): rem...May 13, 2026
vinit@spotdraft.comadded support to get l...April 28, 2026
Review this PR on Baz | Customize your next review

…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>
@sachin-spotdraft sachin-spotdraft added the size/s < 100 lines of changes label May 13, 2026
@kundanrao8507 kundanrao8507 added deploy-to-dev Deploy to dev and removed deploy-to-dev Deploy to dev labels May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s < 100 lines of changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants