Repository navigation
refactor(tools): model_dump() instead of the deprecated Pydantic dict() - #197
Merged
Merged
Conversation
Every tool result model serialized through Pydantic v1's .dict(), which Pydantic 2.x answers with PydanticDeprecatedSince20 — 157 of the suite's 172 warnings. All 34 call sites now use .model_dump(); the returned dict is unchanged (no aliases or custom config), which the full suite proves.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Why
Every tool result model serialized through Pydantic v1's
.dict(); Pydantic 2.x answers each call withPydanticDeprecatedSince20. That was 157 of the suite's 172 warnings — real signal drowned in deprecation noise.What
All 34 call sites in
mcp_server/tools/now use.model_dump()— memory (5), ops (16), session/episodic/graph (2 each), forget/project (2 each), think/dream/evolve (1 each).The returned dict is unchanged: every receiver is a
*Resultinheriting_ResultBase(BaseModel)withextra="forbid"and no aliases or customdict(), and all 34 calls are argument-free. Proven:test_think_declared.py -W error::DeprecationWarningfails on base withPydanticDeprecatedSince20, passes here;