Skip to content

chore(deps): align API and Agent dependency locks - #46210

Open
BeautyyuYanli wants to merge 1 commit into
mainfrom
chore/align-api-agent-deps-44777
Open

BeautyyuYanli wants to merge 1 commit into
mainfrom
chore/align-api-agent-deps-44777

Conversation

@BeautyyuYanli

Copy link
Copy Markdown
Contributor

This PR is made with gpt-6.1-sol (Codex) and gemini-4-carbon (Google Antigravity), while I'm responsible for all the changes.

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes #44777.

Completes the alignment of dependency declarations and uv.lock resolutions across api and dify-agent (including the server extra) for the four dependencies tracked in #44777:

Dependency api (before -> after) dify-agent / server extra (before -> after) Notes
pydantic-ai-slim 2.53.0 -> 2.53.0 2.53.0 -> 2.53.0 (==2.53.0 on core & server) Already aligned on main via #45041
Pillow 13.0.0 -> 13.0.0 13.0.0 -> 13.0.0 (>=13.0.0,<14 on server) Already aligned on main via #44871 & #44917
pypdf 6.21.4 -> 6.21.4 6.21.4 -> 6.21.4 Already aligned on main via #44778, #45215 & #45259
filelock 3.20.3 -> 4.2.10 4.2.1 -> 4.2.10 Aligned across both locks; clears remaining <=4.2.0 advisories (CVE-2026-112909, CVE-2026-112910) in api/uv.lock
unstructured 0.27.5 -> 0.27.37 0.24.1 -> 0.27.37 0.27.37 natively declares filelock>=4.2.1,<5.0.0

Changes

  • dify-agent/pyproject.toml: Remove the temporary [tool.uv] override-dependencies = ["filelock==4.2.1"] block introduced in chore(deps): bump Agent filelock to 4.2.1 #44793, fulfilling its TODO now that upstream unstructured==0.27.37 natively permits filelock>=4.2.1,<5.0.0.
  • dify-agent/uv.lock & api/uv.lock: Perform targeted upgrades (--upgrade-package unstructured --upgrade-package filelock) so both projects lock unstructured==0.27.37 and filelock==4.2.10 with zero unrelated package drift while preserving pydantic-ai-slim==2.53.0, pillow==13.0.0, and pypdf==6.21.4.

Verification

  • Lock consistency: uv lock --check --directory api and uv lock --check --directory dify-agent pass cleanly; programmatic diff of all locked packages confirms only unstructured and filelock changed.
  • Clean frozen installs (Python 3.13.13, uv 0.12.23):
    • uv sync --directory api --frozen --group dev
    • uv sync --directory dify-agent --frozen --extra server --dev
    • uv sync --directory dify-agent --frozen --no-dev
    • Verified identical installed versions (pydantic-ai-slim==2.53.0, pillow==13.0.0, pypdf==6.21.4, filelock==4.2.10, unstructured==0.27.37) across api and dify-agent[server], plus clean client-only dify_agent.Client import without server extras.
  • Test suites & static checks:
    • dify-agent local suite (pytest tests/local -m 'not integration' with --extra server): 1080 passed, 14 subtests passed (covering packaging contracts, agent_stub knowledge image handling, LLM/runtime layers).
    • api unit tests (api/tests/unit_tests/core/rag/extractor, test_package_resource_importer.py, knowledge_fs image tests): 397 passed.
    • Runtime library smoke checks in both frozen environments: FileLock contention/release, huggingface_hub WeakFileLock, Pillow PNG/JPEG/WebP encode/decode, pypdf write/read, and unstructured DOCX/PPTX/Markdown partitioning all succeeded.
    • Lint & type-check: ruff check and pyrefly passed in both dify-agent (0 errors) and touched api modules.

Screenshots

N/A (dependency manifest and lockfile alignment only).

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've verified the change and added or updated tests where meaningful regression risk justifies coverage.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods

@github-actions github-actions Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.35%. Comparing base (39374db) to head (9e9104c).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #46210    +/-   ##
========================================
  Coverage   90.34%   90.35%            
========================================
  Files        6309     6310     +1     
  Lines      394170   394284   +114     
  Branches    79216    79221     +5     
========================================
+ Hits       356126   356246   +120     
+ Misses      31930    31927     -3     
+ Partials     6114     6111     -3     
Flag Coverage Δ
api 90.03% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BeautyyuYanli
BeautyyuYanli marked this pull request as ready for review November 13, 2026 05:27
@BeautyyuYanli
BeautyyuYanli requested a review from a team November 13, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] Align API and Agent dependency updates

1 participant