Repository navigation
fix(xai): preserve tool result IDs and require xai-sdk 1.6.0 - #5355
Merged
Merged
Conversation
adtyavrdhn
reviewed
May 11, 2026
adtyavrdhn
reviewed
May 11, 2026
Contributor
Author
|
Thanks, both points make sense. I removed the unrelated xAI model-name/schema updates from this PR so it stays focused on preserving tool result IDs. I also checked the xai-sdk versions: |
DouweM
added a commit
that referenced
this pull request
May 21, 2026
Adapts incoming main changes to v2 idioms: - Bedrock adaptive-thinking/effort (#5326): rewrote `bedrock_anthropic_model_profile` and `BedrockModelProfile` flag reads to the v2 TypedDict shape (`merge_profile`, `.get(...)`) instead of `.update()`/attribute access; fixed the two new profile fields that were merged in as dataclass-style defaults. - XSearch model-agnostic refactor (#5120): adopted the moved `capabilities/x_search.py` + `common_tools/x_search.py`, stripping the v1 `builtin`/`native` deprecation shims (removed in v2) and reconciling the XSearch test suite. - MCP background tasks / SEP-1686 (#5192): kept v2's runtime fastmcp import structure plus the new `ToolTask` import; relocated the new background-task tests into `tests/test_mcp.py` (v2 dropped `tests/test_mcp_toolset.py`). - xAI tool result IDs (#5355): tracks the latest `xai-sdk` (1.12.2), which keeps `tool_result(result, tool_call_id=...)`; all 112 `tests/models/test_xai.py` pass against it. - Reconciled capabilities/MCP docs to keep v2 default-behavior wording while adding the XSearch entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5328.
This updates the xAI model adapter to preserve
tool_call_idwhen mappingToolReturnPartand tool-boundRetryPromptPartintoxai_sdk.chat.tool_result(...)messages. This keeps parallel tool-call results associated with the correct xAI tool calls.The xAI optional dependency is bumped from
xai-sdk>=1.5.0toxai-sdk>=1.6.0because1.6.0is the first SDK version wheretool_result(...)accepts thetool_call_idkeyword argument.Tests were updated to assert reordered xAI tool-result history retains the expected
tool_call_idvalues.