Skip to content

Add validation & token-counting middleware #13

@gorkem-bwl

Description

@gorkem-bwl

Create middleware to validate request schema (e.g. presence of messages) and count tokens before routing.

  • Uses Zod or similar for schema validation
  • Middleware extracts token count and attaches to req.context
  • Rejects bad payloads with 400
  • Logs token count for each request

Metadata

Metadata

Assignees

Labels

✨ New FeatureProposal or work to add a new feature.🛠 BackendBackend related issue.🧩 CoreChanges to core system architecture or critical modules.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions