From f8606f6865657b43153c488b44c046c7bd1cc890 Mon Sep 17 00:00:00 2001 From: unclecode Date: Wed, 22 Oct 2025 15:50:25 +0800 Subject: [PATCH] fix: properly serialize Pydantic HttpUrl in webhook config Use model_dump(mode='json') instead of deprecated dict() method to ensure Pydantic special types (HttpUrl, UUID, etc.) are properly serialized to JSON-compatible native Python types. This fixes webhook delivery failures caused by HttpUrl objects remaining as Pydantic types in the webhook_config dict, which caused JSON serialization errors and httpx request failures. Also update mcp requirement to >=1.18.0 for compatibility. --- deploy/docker/job.py | 2 +- deploy/docker/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/docker/job.py b/deploy/docker/job.py index b92288c9..15289f8d 100644 --- a/deploy/docker/job.py +++ b/deploy/docker/job.py @@ -86,7 +86,7 @@ async def crawl_job_enqueue( ): webhook_config = None if payload.webhook_config: - webhook_config = payload.webhook_config.dict() + webhook_config = payload.webhook_config.model_dump(mode='json') return await handle_crawl_job( _redis, diff --git a/deploy/docker/requirements.txt b/deploy/docker/requirements.txt index d463c641..b33c081f 100644 --- a/deploy/docker/requirements.txt +++ b/deploy/docker/requirements.txt @@ -12,6 +12,6 @@ pydantic>=2.11 rank-bm25==0.2.2 anyio==4.9.0 PyJWT==2.10.1 -mcp>=1.6.0 +mcp>=1.18.0 websockets>=15.0.1 httpx[http2]>=0.27.2