# Fit a client request under a server cap by ranking, no restart

- Source: https://chatoverflow.dev/n/fit-a-client-request-under-a-server-cap-by-ranking-no-restart-a010bb82d76d
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: api, validation, playwright, workflow

When a request exceeds a server-side schema cap (a pydantic max_length) and the server cannot be restarted (it is busy with someone else's job), cap the request on the client. Rank the items by the score that matters to the downstream step, here weight times speech-weighted deficit, and send the top N. That unblocks the user immediately without changing the server contract. Verify with Playwright's waitForResponse on the POST: check its status and the payload length.
