Skip to content

Fix XaiStreamedResponse finish_reason mapping for streaming responses - #6814

Merged
adtyavrdhn merged 3 commits into
mainfrom
fix/xai-stream-finish-reason
Aug 10, 2026
Merged

adtyavrdhn merged 3 commits into
mainfrom
fix/xai-stream-finish-reason

Conversation

@pydanty

@pydanty pydanty Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #6812

xAI SDK Response.finish_reason returns proto enum names (e.g. REASON_STOP), but the streaming path in XaiStreamedResponse._update_response_state keyed _FINISH_REASON_MAP on lowercase strings (stop, length, …), so it always fell through to the stop default. The non-streaming path (XaiModel._process_response) already used _FINISH_REASON_PROTO_MAP keyed on proto ints, so the two paths disagreed on the same response. Streaming users therefore always saw finish_reason='stop', defeating the _agent_graph.py finish_reason == 'length' diagnostics (IncompleteToolCall detection and the token-limit-exceeded error).

Fix

  • Delete the string-keyed _FINISH_REASON_MAP.
  • Extend _FINISH_REASON_PROTO_MAP with REASON_MAX_CONTEXT → 'length' and REASON_TIME_LIMIT → 'error' so every proto enum member except REASON_INVALID is covered.
  • Add a shared _map_finish_reason(response) helper that reads the proto int from the final output, returning None for empty outputs or REASON_INVALID (the proto default meaning not-finished-yet).
  • Non-streaming uses _map_finish_reason(response) or 'stop'; streaming only assigns finish_reason when the helper returns non-None, so intermediate chunks (REASON_INVALID) no longer clobber it with a false 'stop'.

REASON_MAX_CONTEXT → 'length' follows the same class as the existing REASON_MAX_LEN → 'length': a context-full truncation surfaces the same IncompleteToolCall/token-limit diagnostics as a max-len truncation.

Tests

  • test_xai_stream_finish_reason_matches_non_stream — parametrized across stop/length/tool_call/error, asserts the streamed ModelResponse.finish_reason agrees with the non-streamed value.
  • test_xai_stream_intermediate_chunks_keep_finish_reason_unset — intermediate chunks (REASON_INVALID) keep finish_reason=None; only the final chunk sets it.
  • test_xai_finish_reason_proto_map_covers_all_enum_members — guards that every FinishReason proto enum member except REASON_INVALID is mapped.
  • mock_xai.py updated so chunk helpers pass None (→ REASON_INVALID) instead of coercing to 'stop', and create_response accepts FinishReason | None.

Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • No breaking changes in accordance with the version policy.
  • PR title is fit for the release changelog.

Review in cubic

💰 Run usage: 702,091 tokens, 32 model requests (est. cost $0.2560)
Agent Cost Input Output Requests Tool calls Model
pydanty-pr-opener $0.2437 616,763 11,299 22 33 —
pydanty-test-runner $0.0123 71,857 2,172 10 11 deepseek-v4-pro
total $0.2560 688,620 13,471 32 44
💰 Run usage: 1,696,310 tokens, 75 model requests (est. cost $0.7186)
Agent Cost Input Output Requests Tool calls Model
pydanty-pr-opener $0.5728 1,196,149 12,879 37 50 —
pydanty-test-runner $0.1458 478,233 9,049 38 44 deepseek-v4-pro
total $0.7186 1,674,382 21,928 75 94

xAI SDK `Response.finish_reason` returns proto enum *names* (e.g.
`REASON_STOP`), but the streaming path keyed `_FINISH_REASON_MAP` on
lowercase strings (`stop`, `length`, ...\), so it always fell through to
the `stop` default. The non-streaming path already used
`_FINISH_REASON_PROTO_MAP` keyed on proto ints, so the two paths disagreed
on the same response, and streaming users always saw `finish_reason='stop'`,
defeating `_agent_graph.py` length diagnostics (IncompleteToolCall and
token-limit error).

Delete `_FINISH_REASON_MAP` and add a shared `_map_finish_reason` helper
that reads the proto int from the final output, returning `None` for empty
outputs or `REASON_INVALID` (the proto default meaning not-finished-yet).
Extend `_FINISH_REASON_PROTO_MAP` with `REASON_MAX_CONTEXT`->`length`
and `REASON_TIME_LIMIT`->`error` so every enum member except
`REASON_INVALID` is covered. Non-streaming uses the helper with an `or
'stop'` fallback; streaming only assigns `finish_reason` when the helper
returns non-None, so intermediate chunks no longer clobber it with a false
`stop`.

Closes #6812
@pydanty pydanty Bot added bug Report that something isn't working, or PR implementing a fix tools streaming xai loopable Mechanically fixable bug suitable for automated fix loop; no human design judgment expected. labels Jul 29, 2026
@github-actions github-actions Bot added the size: S Small PR (≤100 weighted lines) label Jul 29, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 29, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 2dc7408

Straightforward bug fix that consolidates finish_reason mapping for streaming and non-streaming xAI responses to use the same proto-based lookup. Limited scope to xai.py model code with comprehensive test coverage added.

You can customize Macroscope's approvability policy. Learn more.

@LHMQ878

LHMQ878 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Original reporter here (#6812) — thanks for turning this around so fast. The fix matches what I proposed, and I have the same change on a branch locally, so I can point at exactly what the two red checks want. All four lint errors and the single coverage miss are mechanical.

lint — 4 pyright errors

3 × mock_xai.py:384, 393, 405 — Argument of type "str | None" cannot be assigned to parameter "finish_reason" of type "FinishReason | None".

The three chunk helpers declare finish_reason: str = 'stop' (plain str, not the FinishReason literal), so narrowing it with if finish_reason else None still leaves str | None. Widening the helpers' own annotations would ripple into every call site, so the smallest fix is to acknowledge the cast at the boundary:

        finish_reason=finish_reason or None,  # type: ignore[arg-type]

x or None is equivalent to x if x else None here (the only falsy str is '', which is the "no finish reason" sentinel these helpers already use) and it keeps the diff to one token plus the comment.

1 × test_xai.py:6174 — "_FINISH_REASON_PROTO_MAP" is private and used outside of the module in which it is declared (reportPrivateUsage).

Needs an inline suppression on the access:

        if number not in xai_module._FINISH_REASON_PROTO_MAP  # pyright: ignore[reportPrivateUsage]

(tests/models/test_openai.py and friends use the same # pyright: ignore[reportPrivateUsage] idiom when reaching into module privates, so this is consistent with the existing test style.)

coverage — xai.py:166 uncovered, total 99.99% vs fail-under=100

Line 166 is the return None in:

    outputs = response.proto.outputs
    if not outputs:
        return None          # <- never hit

It's genuinely unreachable from the test suite: _map_finish_reason is only called on an accumulated Response, and both _process_response and _update_response_state are reached only after the SDK has produced at least one output — a zero-output Response isn't constructible through mock_xai. Every other defensive branch in this file is marked rather than tested, so:

    if not outputs:  # pragma: no cover
        return None

Alternatively, drop the guard entirely and let outputs[-1] raise — but the guard documents the invariant, and # pragma: no cover is what the rest of xai.py does for exactly this shape (e.g. the existing else: # pragma: no cover branches).

One substantive note on the mock

_get_proto_finish_reason maps 'content_filter' → REASON_STOP, which is right (xAI's enum has no content-filter member) but worth a comment, because it's the one entry where the mock deliberately isn't round-trippable: a test that asks for content_filter gets 'stop' back. Without a note, the next person to touch test_xai_stream_finish_reason_matches_non_stream may add content_filter to the parametrize list and be surprised. Suggested docstring on that helper:

error maps to REASON_TIME_LIMIT because that is the only proto reason pydantic-ai reports as an error. content_filter has no proto equivalent at all — xAI's enum has no such member — so it maps to REASON_STOP, matching what the API would send.

Everything else looks right to me, including the REASON_MAX_CONTEXT → 'length' call and the decision not to add provider_details['finish_reason'] on the streaming path (_process_response doesn't set it either, so adding it one-sidedly would just trade one asymmetry for another).

With those three suppressions and the pragma, this is green — I've run the identical change locally: tests/models/test_xai.py 122 passed, xai.py at 100% coverage, ruff and pyright clean. Happy to push the corrections if that's easier than editing the bot branch.

Add type: ignore[arg-type] to the three create_response calls in
mock_xai.py whose finish_reason arg is a plain str (matching the
existing sibling annotations), add pyright: ignore[reportPrivateUsage]
to the private _FINISH_REASON_PROTO_MAP access, and add
test_xai_map_finish_reason_empty_outputs_returns_none to cover the
empty-outputs return None branch in _map_finish_reason (xai.py:166).
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 29, 2026 13:57

Dismissing prior approval to re-evaluate b203d44

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 29, 2026
Match other providers: unknown finish reasons map to None, not 'stop'.
Stream test now actually compares against the non-streamed path.
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 10, 2026 06:32

Dismissing prior approval to re-evaluate 2dc7408

@adtyavrdhn adtyavrdhn mentioned this pull request Aug 10, 2026
2 of 3 tasks
@adtyavrdhn
adtyavrdhn merged commit 640d517 into main Aug 10, 2026
62 checks passed
@adtyavrdhn
adtyavrdhn deleted the fix/xai-stream-finish-reason branch August 10, 2026 07:26
736-c41-2c1-e464fc974 added a commit to Swiss-Armed-Forces/Loom that referenced this pull request Sep 15, 2026
This MR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [numpy](https://github.com/numpy/numpy) ([changelog](https://numpy.org/doc/stable/release)) | dependencies | patch | `2.5.2` → `2.5.3` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/numpy/numpy/badge)](https://securityscorecards.dev/viewer/?uri=github.com/numpy/numpy) |
| [openai](https://github.com/openai/openai-python) | dependencies | patch | `2.52.0` → `2.52.1` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/openai/openai-python/badge)](https://securityscorecards.dev/viewer/?uri=github.com/openai/openai-python) |
| [pydantic](https://github.com/pydantic/pydantic) ([changelog](https://docs.pydantic.dev/latest/changelog/)) | dependencies | patch | `2.13.4` → `2.13.5` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/pydantic/pydantic/badge)](https://securityscorecards.dev/viewer/?uri=github.com/pydantic/pydantic) |
| [pydantic-ai](https://github.com/pydantic/pydantic-ai) ([changelog](https://github.com/pydantic/pydantic-ai/releases)) | dependencies | patch | `2.27.0` → `2.27.1` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/pydantic/pydantic-ai/badge)](https://securityscorecards.dev/viewer/?uri=github.com/pydantic/pydantic-ai) |
| [types-requests](https://github.com/python/typeshed) ([changelog](https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/requests.md)) | dependencies | patch | `2.33.0.20260712` → `2.33.0.20260906` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/python/typeshed/badge)](https://securityscorecards.dev/viewer/?uri=github.com/python/typeshed) |
| [uvicorn](https://github.com/Kludex/uvicorn) ([changelog](https://uvicorn.dev/release-notes)) | dependencies | patch | `0.52.3` → `0.52.4` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Kludex/uvicorn/badge)](https://securityscorecards.dev/viewer/?uri=github.com/Kludex/uvicorn) |

---

### Release Notes

<details>
<summary>numpy/numpy (numpy)</summary>

### [`v2.5.3`](https://github.com/numpy/numpy/releases/tag/v2.5.3): (Sep 6, 2026)

[Compare Source](numpy/numpy@v2.5.2...v2.5.3)

### NumPy 2.5.3 Release Notes

The NumPy 2.5.3 is a patch release that fixes bugs discovered after the 2.5.2
release. Apart from the usual bug and maintenance work, there are a number of
StringDType related fixes for problems discovered during the ongoing string
work in the main branch.

This release supports Python versions 3.12-3.15

#### Changes

- Casting a fixed-width byte string array (`np.bytes_`) to `StringDType`
  now raises `TypeError` when the bytes are not valid UTF-8. Previously the
  invalid bytes were stored as-is and later caused undefined behavior in
  string operations.

  ([gh-32296](numpy/numpy#32296))

- `MaskedArray._fill_value` would become stale when ufuncs that change dtype
  left the result holding a fill\_value typed for the old dtype. The mismatch
  was silent until something later called `_check_fill_value`, such as
  `.view()`, and then a `TypeError` would be raised. Now, when the copied
  fill\_value is no longer valid for the new dtype, fall back to the
  default fill\_value for that dtype instead of propagating the stale value.
  This may raise a `ComplexWarning` if the fill\_value is complex and the
  new dtype is real.

  ([gh-32423](numpy/numpy#32423))

#### Contributors

A total of 9 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.

- Charles Harris
- Iason Krommydas
- James Davies +
- Joren Hammudoglu
- Maanas Arora
- Matti Picus
- Nathan Goldbaum
- Shikhar Goel +
- Yeonho Kim +

#### Pull requests merged

A total of 27 pull requests were merged for this release.

- [#&#8203;32235](numpy/numpy#32235): MAINT: Prepare 2.5.x for further development
- [#&#8203;32289](numpy/numpy#32289): BUG: raise ValueError when reading into record array with references...
- [#&#8203;32290](numpy/numpy#32290): BUG: avoid uninitialized memory access / NULL-pointer deref in...
- [#&#8203;32291](numpy/numpy#32291): TYP: fix `np.random.{get,set}_bit_generator` implicit re-exports...
- [#&#8203;32292](numpy/numpy#32292): BUG: don't assume strides are a multiple of itemsize in stringdtype...
- [#&#8203;32293](numpy/numpy#32293): CI: fix ccache CC override, add CXX in mac Conda CI ([#&#8203;32285](numpy/numpy#32285))
- [#&#8203;32303](numpy/numpy#32303): BUG: Fix ref leak in \[convert\_from\_type]{#convert\_from\_type} for custom scalar types...
- [#&#8203;32304](numpy/numpy#32304): BUG: fix a number of issues around iterators and StringDType...
- [#&#8203;32326](numpy/numpy#32326): TST: avoid allocating huge tuple of arrays in concatenate test...
- [#&#8203;32338](numpy/numpy#32338): BUG: avoid possible UB in 'safe' multiplication helpers ([#&#8203;32294](numpy/numpy#32294))
- [#&#8203;32339](numpy/numpy#32339): MAINT: use `PyObject_` functions instead of raw `PyArray_ ones` ([#&#8203;32331](numpy/numpy#32331))
- [#&#8203;32378](numpy/numpy#32378): BUG: validate UTF-8 and harden StringDType bounds handling ([#&#8203;32296](numpy/numpy#32296))
- [#&#8203;32380](numpy/numpy#32380): BUG: fix two error handling mistakes in stringdtype replace loop...
- [#&#8203;32381](numpy/numpy#32381): BUG: fix visibility annotations for functions in StringDType...
- [#&#8203;32384](numpy/numpy#32384): MAINT: Update ml\_dtypes pin to 8/21/2026.
- [#&#8203;32385](numpy/numpy#32385): MAINT: Update numpy/\_core/src/umath/svml
- [#&#8203;32410](numpy/numpy#32410): MAINT: skip failing cython limited API tests on Cython 3.3.0...
- [#&#8203;32427](numpy/numpy#32427): BUG: close duplicated file descriptor if fdopen fails ([#&#8203;32386](numpy/numpy#32386))
- [#&#8203;32428](numpy/numpy#32428): MAINT: add missing space in warning and error messages ([#&#8203;32405](numpy/numpy#32405))
- [#&#8203;32430](numpy/numpy#32430): BUG: fix error handling in StringDType to fixed-width bytes case...
- [#&#8203;32441](numpy/numpy#32441): MAINT: Only run nightly BLAS tests on main.
- [#&#8203;32471](numpy/numpy#32471): BUG: fix memory leak in StringDType creation error path ([#&#8203;32470](numpy/numpy#32470))
- [#&#8203;32477](numpy/numpy#32477): BUG: fix stale fill\_value after ufuncs change MaskedArray dtype...
- [#&#8203;32478](numpy/numpy#32478): MAINT: exit deadlock tests quickly on slow hardware ([#&#8203;32466](numpy/numpy#32466))
- [#&#8203;32481](numpy/numpy#32481): BUG: Backport StringDType byteorder fixes
- [#&#8203;32506](numpy/numpy#32506): DOC: use static scipy doc site for intershpinx ([#&#8203;32503](numpy/numpy#32503))
- [#&#8203;32509](numpy/numpy#32509): BUG: fix crash in ufunc.resolve\_dtypes with a Python scalar type...

</details>

<details>
<summary>openai/openai-python (openai)</summary>

### [`v2.52.1`](https://github.com/openai/openai-python/blob/HEAD/CHANGELOG.md#2521-2026-07-31)

[Compare Source](openai/openai-python@v2.52.0...v2.52.1)

Full Changelog: [v2.52.0...v2.52.1](openai/openai-python@v2.52.0...v2.52.1)

##### Chores

- **ci:** pin setup-uv v5 to its underlying commit ([#&#8203;3560](openai/openai-python#3560)) ([cbdc98b](openai/openai-python@cbdc98b))

</details>

<details>
<summary>pydantic/pydantic (pydantic)</summary>

### [`v2.13.5`](https://github.com/pydantic/pydantic/releases/tag/v2.13.5)

[Compare Source](pydantic/pydantic@v2.13.4...v2.13.5)

#### v2.13.5 (2026-08-28)

##### What's Changed

##### Fixes

- Allow reuse of validators when plugins are set by [@&#8203;Viicos](https://github.com/Viicos) in [#&#8203;13535](pydantic/pydantic#13535)
- Fix missing GC traversal on some `pydantic-core` struct fields by [@&#8203;Viicos](https://github.com/Viicos) in [#&#8203;13624](pydantic/pydantic#13624)
- Fix missing GC traversal in `pydantic-core` for `GeneralFieldsSerializer` by [@&#8203;Viicos](https://github.com/Viicos) in [#&#8203;13629](pydantic/pydantic#13629)
- Count validated model fields once in smart unions by [@&#8203;tamird](https://github.com/tamird) in [#&#8203;13731](pydantic/pydantic#13731)

</details>

<details>
<summary>pydantic/pydantic-ai (pydantic-ai)</summary>

### [`v2.27.1`](https://github.com/pydantic/pydantic-ai/releases/tag/v2.27.1): (2026-08-10)

[Compare Source](pydantic/pydantic-ai@v2.27.0...v2.27.1)

##### 🛡️ Security

This release fixed an information-disclosure issue: retry-prompt content (validation feedback sent back to the model, which can quote invalid values from its output) was not redacted by `InstrumentationSettings(include_content=False)` when the retry was not tied to a tool call. Now disclosed as [GHSA-3gh4-cghq-f8v4](GHSA-3gh4-cghq-f8v4) (low). Fixed here in `2.27.1` ([#&#8203;7357](pydantic/pydantic-ai#7357)); v1 users should upgrade to `1.107.4` or later.

<!-- Release notes generated using configuration in .github/release.yml at main -->

#### What's Changed

##### 🐛 Bug Fixes

- Restore tool spans for failed argument validation by [@&#8203;adtyavrdhn](https://github.com/adtyavrdhn) in [#&#8203;6601](pydantic/pydantic-ai#6601)
- Fix `XaiStreamedResponse` finish\_reason mapping for streaming responses by [@&#8203;pydanty](https://github.com/pydanty)\[bot] in [#&#8203;6814](pydantic/pydantic-ai#6814)
- Point offline web UI hosting at the self-contained chat UI build by [@&#8203;dsfaccini](https://github.com/dsfaccini) in [#&#8203;7349](pydantic/pydantic-ai#7349)
- Allow adaptive thinking with Tool Output and forced tool choice on Anthropic by [@&#8203;pydanty](https://github.com/pydanty)\[bot] in [#&#8203;7200](pydantic/pydantic-ai#7200)
- Gate `RetryPromptPart` OpenTelemetry content on `include_content` by [@&#8203;sean-kim05](https://github.com/sean-kim05) in [#&#8203;7357](pydantic/pydantic-ai#7357)

**Full Changelog**: <pydantic/pydantic-ai@v2.27.0...v2.27.1>

</details>

<details>
<summary>Kludex/uvicorn (uvicorn)</summary>

### [`v0.52.4`](https://github.com/Kludex/uvicorn/releases/tag/0.52.4): Version 0.52.4

[Compare Source](Kludex/uvicorn@0.52.3...0.52.4)

##### Fixed

- Remove duplicate `Date` headers from accepted WebSocket handshakes with `websockets-sansio` ([#&#8203;3078](Kludex/uvicorn#3078))

**Full Changelog**: <Kludex/uvicorn@0.52.3...0.52.4>

</details>

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zOS4yIiwidXBkYXRlZEluVmVyIjoiNDQuOTAuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGUiXX0=-->

See merge request swiss-armed-forces/cyber-command/cea/loom!769

Co-authored-by: Loom MR Pipeline Trigger <group_103951964_bot_9504bb8dead6d4e406ad817a607f24be@noreply.gitlab.com>
Co-authored-by: shrewd-laidback palace <shrewd-laidback-palace-736-c41-2c1-e464fc974@swiss-armed-forces-open-source.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Report that something isn't working, or PR implementing a fix loopable Mechanically fixable bug suitable for automated fix loop; no human design judgment expected. size: S Small PR (≤100 weighted lines) streaming tools xai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xAI streamed responses always report finish_reason='stop' (map is keyed on lowercase strings, SDK returns proto enum names)

3 participants