When the responses endpoint fails and the chat.completions fallback also
fails (raises or returns empty), the original responses error was captured
in fallback_reason but never surfaced. Wrap the fallback call in its own
try/except and re-raise a RuntimeError that chains both errors with
context, so users see why both endpoints failed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- coerce_seed("") returns None, not ValueError; move "" out of the
invalid-values parametrize and give it its own explicit assertion
- strip_think_content tests used \\n (literal backslash-n) instead of
real newlines; .strip() cannot remove backslash or 'n' so the dangling-
tag test always failed. Replace with actual \n to match real LLM output.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>