Skip to content

server : add missing return after validation errors in /infill endpoint#22146

Open
JoongHyuk-Shin wants to merge 1 commit intoggml-org:masterfrom
JoongHyuk-Shin:fix/infill-missing-return
Open

server : add missing return after validation errors in /infill endpoint#22146
JoongHyuk-Shin wants to merge 1 commit intoggml-org:masterfrom
JoongHyuk-Shin:fix/infill-missing-return

Conversation

@JoongHyuk-Shin
Copy link
Copy Markdown

Overview

The /infill endpoint sets error for missing input_prefix,input_suffix but doesn't return,
so it falls through and throws 500 instead of 400.

Added "return res; "
after the three validation checks and a test for each case.

Requirements

The /infill endpoint calls res->error() for missing input_prefix,
input_suffix, and non-string prompt, but does not return afterward.
Execution falls through to data.at() which throws out_of_range,
resulting in HTTP 500 instead of the intended HTTP 400.

Add return res; after each of the three validation error calls,
matching the pattern already used by the input_extra check below.
@JoongHyuk-Shin JoongHyuk-Shin requested a review from a team as a code owner April 20, 2026 06:41
@github-actions github-actions bot added examples python python script changes server labels Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples python python script changes server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant