Truncated responses are detected and handled gracefully
Why it matters
When finish_reason: "length" fires and the application ignores it, users receive half-written code, truncated JSON that fails to parse, or advice that ends mid-clause — and they have no signal that anything was cut. They act on incomplete information, file bug reports against the wrong component, or lose trust in the assistant entirely. The error-resilience taxon requires surfacing partial-output states; silent truncation is the worst possible UX for a recoverable failure because it looks like a complete answer.
Severity rationale
Low because truncation is infrequent in practice and users can retry, but the failure mode is silent and misleading.
Remediation
After every non-streaming API call, inspect finish_reason (OpenAI) or stop_reason (Anthropic) and propagate a truncation flag to the UI so the user sees a "Response may be incomplete" banner with a continue button. Wire this through api/chat/route.ts.
const choice = response.choices[0]
return { content: choice.message.content, truncated: choice.finish_reason === 'length' }
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI Response Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-response-quality·automated