Skip to content

Return 400 for malformed UI inference request data#7523

Open
RitwijParmar wants to merge 1 commit into
tensorzero:mainfrom
RitwijParmar:codex/fix-inference-form-json-400
Open

Return 400 for malformed UI inference request data#7523
RitwijParmar wants to merge 1 commit into
tensorzero:mainfrom
RitwijParmar:codex/fix-inference-form-json-400

Conversation

@RitwijParmar
Copy link
Copy Markdown

Summary

  • Parse the data form field for /api/tensorzero/inference before invoking the TensorZero client
  • Convert malformed JSON into the existing Error parsing request data 400 response instead of falling through to the generic 500 handler
  • Add route-action regression coverage for missing data, malformed JSON, successful inference calls, and existing client-error handling

Fixes #7508.

Tests

  • pnpm --filter=tensorzero-ui exec vitest run app/routes/api/tensorzero/inference.test.ts
  • pnpm --filter=tensorzero-ui run format
  • pnpm --filter=tensorzero-ui run lint
  • pnpm build-bindings
  • pnpm --filter=@tensorzero/tensorzero-node run build
  • pnpm --filter=tensorzero-ui run typecheck

@tensorzero-cla-bot
Copy link
Copy Markdown

tensorzero-cla-bot Bot commented May 28, 2026

✅ All contributors to this pull request have signed the TensorZero CLA. Thank you!

@RitwijParmar
Copy link
Copy Markdown
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

tensorzero-cla-bot Bot added a commit that referenced this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: malformed /api/tensorzero/inference form JSON returns 500 instead of 400

1 participant