-
Notifications
You must be signed in to change notification settings - Fork 50
release: 0.2.0 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
release: 0.2.0 #29
Conversation
|
🧪 Testing To try out this version of the SDK, run: Expires at: Sun, 18 Jan 2026 22:36:54 GMT |
c009fc7 to
f7dcba2
Compare
f7dcba2 to
9f9595f
Compare
9f9595f to
e472959
Compare
e472959 to
b0d5b29
Compare
b0d5b29 to
0f9dda8
Compare
0f9dda8 to
18bac02
Compare
18bac02 to
0855388
Compare
0855388 to
01f0641
Compare
01f0641 to
8f6e9b4
Compare
Feat/20251201 mcp server params
8f6e9b4 to
d39dc44
Compare
d39dc44 to
349fdaa
Compare
c437646 to
94d029c
Compare
94d029c to
20b4252
Compare
| data["mcp_servers"] = serialize_mcp_servers(servers) | ||
|
|
||
| # Make a copy to avoid mutation side effects related to SDK retry logic. | ||
| data = copy.deepcopy(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Request data mutated before deep copy protection
The prepare_mcp_request and prepare_mcp_request_sync functions modify data["mcp_servers"] in place on line 101/142 before creating the deep copy on line 104/145. The comment states the copy is made "to avoid mutation side effects" but the mutation has already occurred. This causes the caller's original dict to be unexpectedly modified—users who pass a dict containing MCPServer objects will find their dict now contains serialized strings/dicts after the API call. The deep copy should be made first to actually protect against mutation side effects.
Additional Locations (1)
20b4252 to
dfc2867
Compare
dfc2867 to
e9300fa
Compare
38a6079 to
e0550b8
Compare
e0550b8 to
892cd49
Compare
| ) | ||
|
|
||
| # Extract MCP tool executions from the last response | ||
| mcp_results = _extract_mcp_results(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Undefined variable when max_steps is zero or negative
The response variable is only defined inside the while steps < exec_config.max_steps loop, but _extract_mcp_results(response) is called unconditionally after the loop. If max_steps is 0 or negative, the loop body never executes, leaving response undefined, which causes an UnboundLocalError when the function tries to extract MCP results. This affects both _execute_turns_sync and _execute_turns_async methods.
Automated Release PR
0.2.0 (2025-12-19)
Full Changelog: v0.2.0...v0.2.0
Features
Bug Fixes
model_dumpandmodel_dump_jsonfor Pydantic v1 (bd1df12)Chores
httpx-aiohttpversion to 0.1.9 (6b5f606)uvversion (cb3f674)--fixargument to lint script (b25908b)Refactors
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions
Note
Introduces MCP server/credential and tool-choice types with richer model settings, refactors response-format types to use
JSONObjectInput, overhauls chat/client tests, and adds new encryption and MCP wire serialization tests.shared_params(e.g.,ModelSettings,Reasoning,MCPServers,MCPServerSpec,MCPCredentials,Credential,FunctionDefinition,tool_choice).ResponseFormatJSONSchema/JSONObject/Textenhanced; JSON schema fields now useJSONObjectInput.DedalusModelnow referencesModelSettings;DedalusModelChoicesimplified toUnion[str, DedalusModel].ChatCompletion; switch toopenai/gpt-5; align params (e.g.,automatic_tool_execution,credentials,mcp_servers, structuredtool_choice,system_instruction).POST /v1/chat/completions.x_api_keysupport.shared/tool_choicefor non-params usage.Written by Cursor Bugbot for commit 5897085. This will update automatically on new commits. Configure here.