fix(sdk): allow clearing Python skill client defaults - #749
Open
RerankerGuo wants to merge 1 commit into
Open
Conversation
Signed-off-by: RerankerGuo <121015044+RerankerGuo@users.noreply.github.com>
Collaborator
|
Thanks for all your submissions! |
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.
Description | 描述
SkillClient.with_defaults()andAsyncSkillClient.with_defaults()currentlyuse
Noneas the default value for every keyword argument. As a result, theclone operation cannot distinguish an omitted argument from an explicit
request to clear an optional default:
retains the existing
task_idinstead of removing it from subsequent requestbodies. This can keep stale optional isolation fields attached when an
application reuses a client for a broader scope.
This change:
with_defaults()arguments;Noneas a request to clear that default;The approach matches the sentinel pattern already used by the Python v3 data
client for clearable isolation fields.
Related Issue | 关联 Issue
L3/L4 Python SDK behavior audit finding; no existing issue or active PR modifies
the affected v3 Skill client files.
Change Type | 修改类型
Self-test Checklist | 自测清单
Verification | 验证方式
PYTHONPATH=. /usr/bin/python3 -m pytest -q tests/test_v3_skill_defaults.py(2/2)
PYTHONPATH=. /usr/bin/python3 -m pytest -q(2/2 collected tests)/usr/bin/python3 -m compileall -q tencentdb_agent_memory tests/usr/bin/python3 -m pip check/usr/bin/python3 -m pip wheel --no-deps .(wheel built and inspected)git diff --checkThe regression tests exercise both sync and async clients. They verify that an
argument omitted from
with_defaults()is inherited, while an explicitlycleared value is absent from the next serialized
/v3/skill/listrequest.Additional Notes | 其他说明
This PR changes only clone-time handling of optional Skill client defaults.
Constructor behavior, per-request override behavior, transport sharing,
dependencies, and package metadata are unchanged. Existing calls that omit
arguments retain their current behavior; explicit
Nonenow performs theclear operation that the public optional-value API could not previously
express.