Skip to content

Kingy / AI Fix Finder

← All fixes

A JSON closing brace in stop cuts off the structured answer

Check this fix ↓

A request stop sequence matched the JSON closing brace before the schema-constrained answer finished. Removing that stop sequence restored the exact complete record.

kingy tested

Tested repair · llama.cpp + Python client · llama.cpp 0.6.0 b11429; Qwen3-4B Q4_K_M; Python 3.14.0

Check this fix

Applies when
The JSON client fails to parse an HTTP 200 answer with finish_reason=stop because closing braces are missing.
Change to inspect
Remove the client stop sequence that collides with JSON syntax. Here only stop=["}"] was removed; the unchanged schema, prompt, output cap and original exact-answer checker were retained.
Expected result
0/3 baseline full-task passes, 3/3 corrected passes and 0/1 reverted passes. Each repair uses its own seven attempts; corrected generations are not counted twice.
If it still fails
Keep the original failed output and check the conditions and verification steps below. Retained failed attempt: All three baseline attempts and the reverted attempt failed the unchanged full-task checker; raw requests, responses and client errors are retained.

Tested or reviewed 2026-10-27. Verify the original task on your own version and settings; this case does not prove a universal fix.

Read the verification steps ↓ · Report your outcome ↓

What happened

Symptom

The JSON client fails to parse an HTTP 200 answer with finish_reason=stop because closing braces are missing.

Exact environment and tested conditions

Same exact pinned local runtime/model and original synthetic task; see evidence packet for full requests.

Owned Python reference integration; POST /v1/chat/completions on a loopback-only server.

Correction

Remove the client stop sequence that collides with JSON syntax. Here only stop=["}"] was removed; the unchanged schema, prompt, output cap and original exact-answer checker were retained.

Result

0/3 baseline full-task passes, 3/3 corrected passes and 0/1 reverted passes. Each repair uses its own seven attempts; corrected generations are not counted twice.

What did not work

All three baseline attempts and the reverted attempt failed the unchanged full-task checker; raw requests, responses and client errors are retained.

  1. Inspect the actual serialized stop setting and raw message.content; finish_reason=stop alone does not prove a complete JSON document.
  2. For this fixture remove stop=["}"]. Keep the exact original response schema, source facts, model, prompt and 128-token cap.
  3. Parse the complete content with duplicate-key rejection and validate the unchanged record contract: kingy_record contains integer id 17 and text ALPHA, with no extra keys.
  4. Retain the original truncated output. The package includes the same stop setting restored as a negative control.
Sources & limits

Four client/configuration repairs: full qualification report, exact changes and limits

Download four client repairs evidence ZIP (105,390 bytes; SHA-256 3896413bb91395bd1634be0491ba3fc7a0f4cbba8d5c55416a2d52e246bb6ed1)

Pinned llama.cpp server API documentation for tested build d81235049

Record checked 2026-10-27.

Qualified October 27, 2026 by the same agent in one fresh server process on one Apple M4 Pro Mac with 24 GiB unified memory; no independent operator, second machine or human usability outcome.

Three baseline failures, three corrected full-task passes and one reverted failure per repair. These are fixed synthetic integration tasks chosen after exploration, not a general reliability estimate or evidence of user demand.

llama.cpp 0.6.0 build 11429 commit d81235049, Qwen3-4B Q4_K_M, Python 3.14.0; CPU-only four threads, one slot, 2048-token context, reasoning off, temperature 0, seed 42 and cache_prompt=false.

The failing clients/settings are owned reference integrations. These tests do not establish an installed application defect or an upstream runtime fix. Runtime binaries and model weights are excluded from the package.

Only this brace collision was tested. Do not delete intentional application stop markers without reviewing the original task. A different incomplete answer may instead require output-budget or transport diagnosis.

This still happens?

Send the smallest example that reproduces it. Use a public, non-sensitive example; leave out account details, keys and private files.

Help improve this tool

Did this repair work for you?

About AI Fix Finder. Your self-reported outcome goes to Kingy’s private review queue; it is not an independently verified reproduction.

Your experience with AI Fix Finder
What happened?