fix(docker): copy dify-agent source into production stage#36757
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #36757 +/- ##
=======================================
Coverage 85.86% 85.86%
=======================================
Files 4538 4538
Lines 220738 220738
Branches 40681 40681
=======================================
Hits 189538 189538
Misses 27630 27630
Partials 3570 3570
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
#36735 switched dify-agent to an editable install, which writes a .pth file pointing to /app/dify-agent/src. The production stage copied the venv but not the source, making the path dead at runtime and causing ModuleNotFoundError: No module named 'agenton'. --no-editable installs all editable deps as regular wheel installs, copying packages into site-packages. No source directory needed at runtime. Local dev is unaffected — editable behavior is preserved when running uv sync without this flag.
0ab33e2 to
1f8f193
Compare
QuantumGhost
approved these changes
May 28, 2026
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.
Summary
#36735 switched
dify-agentto an editable install, which writes a.pthfile pointing to/app/dify-agent/srcat build time. Theproductionstage copied the venv (including the.pth) but not the source directory itself — making the path dead at runtime and raisingModuleNotFoundError: No module named 'agenton'.Fix
Add
--no-editabletouv syncin thepackagesstage. This installs all editable deps as regular wheel installs, copying packages directly into site-packages. No source directory is needed at runtime, and future editable local packages will work automatically without additionalCOPYlines.Local developer workflow is unaffected — editable behavior is preserved when running
uv syncwithout this flag.Test plan
flask db upgradecompletes withoutModuleNotFoundErroragentonis importable inside the running container