[hotfix][mcp] Fix MCPTool Jackson deserialization by ignoring unknown properties#532
[hotfix][mcp] Fix MCPTool Jackson deserialization by ignoring unknown properties#532avichaym wants to merge 1 commit intoapache:mainfrom
Conversation
|
Hi, @avichaym, thanks for your contribution, and introducing Amazon integrations to Flink-Agents. I'll strive to start the review before the Chinese Spring Festival holiday. I notice there are some test failures because of code style check, you can format the code by |
69065f8 to
26f7b33
Compare
|
thank you @wenjin272 ... i fixed the code-styling issues. Now the python related tests fails in all 3 PR's due to what seems to be a worker issue , not related to the code -> The test_long_term_memory_async_execution_in_action test fails because the nomic-embed-text model download didn't complete in time. The CI log shows the pull was still at 35% (95/274 MB at 7.3 KB/s) when pulling 970aa74c0a90: 35% ▕██████ ▏ 95 MB/274 MB 7.3 KB/s 6h48m The pull_model() helper in test_utils.py has a 120s timeout and silently and seems to swallow the timeout exception, so the test proceeds without the model and fails with model "nomic-embed-text" not found. This is |
yanand0909
left a comment
There was a problem hiding this comment.
Thanks @avichaym, this looks good to me.
What is the purpose of the change
MCPTooldeserialization fails withUnrecognizedPropertyExceptionwhen a defaultObjectMapperencounters thenameanddescriptionfields serialized from the parentToolclass. These fields are not declared inMCPTool's@JsonCreatorconstructor.This breaks checkpoint/restore and any JSON round-trip of
MCPTool.Brief change log
@JsonIgnoreProperties(ignoreUnknown = true)toMCPTooltestJsonDeserializationWithDefaultMapperthat uses a defaultObjectMapper(the existingtestJsonSerializationmasked the bug by disablingFAIL_ON_UNKNOWN_PROPERTIESglobally)Does this pull request potentially affect one of the following parts
Documentation
N/A — bug fix only
Documentation
doc-neededdoc-not-neededdoc-included