fix(install): prevent mirror settings from changing dependency resolution inputs

Open
#860 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@WH-2099 is already working on this.

Since Nov 20, 2026.

Assessment

This issue has not been assessed yet.

Description

project#dify-plugin-daemon

Self Checks

To make sure we get to you in time, please check the following :)

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report.
  • This report is submitted in English.
  • "Please do not modify this template :) and fill in all the required fields."

Versions

  1. dify-plugin-daemon: source inspected at tags 0.6.10, 0.6.14, and main commit 1fa10988ce3fb69af48538d3a6d405fcd4769afc.
    The relevant dependency selection and command construction are the same in these revisions.
  2. dify-api: not required for the isolated installer reproduction; no full Dify deployment was exercised.
  3. Local dependency-resolution check: uv 0.13.8, using two locally generated fixture wheels.

Describe the bug

Changing the effective PipMirrorUrl changes which dependency file the daemon treats as authoritative.
For a plugin containing pyproject.toml and a fully pinned requirements.txt, but no uv.lock, the default installation path ignores the requirements pins and resolves from pyproject.toml.
The mirror path installs from requirements.txt instead.
The same plugin package can therefore install different versions even when both indexes provide identical packages.

The current selection is:

Package contents Empty PipMirrorUrl Nonempty PipMirrorUrl
Only requirements uv pip install -r requirements.txt Same requirements input
pyproject + requirements, no lock uv sync --no-dev; requirements pins are not read uv pip install -r requirements.txt -i <index>
pyproject + requirements + lock Normally uv sync --no-dev --frozen Installs from requirements

Mirror and logging arguments are abbreviated above.
This affects first installation and environment rebuilds; a previously accepted virtual environment can be reused without exercising these branches.

To Reproduce

  1. Prepare a valid Python plugin package containing the following dependency files and no uv.lock.
    Use a controlled index containing versions 1.0.0 and 1.1.0 of the dependency-free fixture package requirements-scope-demo.
    This is a synthetic fixture, not a package that must be downloaded from PyPI.
# pyproject.toml
[project]
name = "requirements-scope-plugin"
version = "0.0.0"
requires-python = ">=3.12"
dependencies = ["requirements-scope-demo>=1.0.0,<2"]
# requirements.txt
requirements-scope-demo==1.0.0
  1. In a fresh environment, disable mirror auto-detection and leave the effective PipMirrorUrl empty.
    Keep PIP_EXTRA_ARGS empty.
    The daemon selects uv sync --no-dev, which can install 1.1.0.
  2. Install the same package in another fresh environment with an explicit mirror URL exposing the same available versions.
    The daemon selects the requirements path, which installs 1.0.0.
  3. Compare installed distribution metadata, rather than relying on the presence of .venv or its validity marker.

The underlying commands were checked locally on 2026-11-17 with both fixture wheels supplied through --offline --no-index --find-links <fixture-wheel-directory>:

Command/input Installed fixture version
uv pip install -r requirements.txt, requirements only 1.0.0
uv sync --no-dev, pyproject + requirements without lock 1.1.0
uv pip install -r requirements.txt, with pyproject also present 1.0.0
uv sync --no-dev --frozen, consistent lock pinning 1.0.0 1.0.0
uv sync --no-dev, retaining that existing lock 1.0.0
uv sync --no-dev --upgrade, retaining that existing lock 1.1.0

These checks validate command behavior; they do not claim that the original release images or a complete daemon deployment were tested.

Expected behavior

Dependency-file precedence and the treatment of supplied pins should be explicit and consistent across mirror settings.
Changing the package download source should not silently change the dependency-resolution inputs.
For pyproject + exact requirements without a lock, define how the supplied exact resolution is used or reject an unsupported/conflicting combination with an actionable error.
Preserve valid-lock and requirements-only installations, and distinguish deliberate re-resolution or upgrades from normal installation.

Screenshots

Not applicable; the differing commands and installed versions are listed above.

Additional context

The relevant code path is InitPythonEnvironment() → detectDependencyFileType() → installDependencies() → prepareSyncArgs() / preparePipArgs().

PLUGIN_IGNORE_UV_LOCK=true only prevents the daemon from automatically adding --frozen; it does not delete the lock or force all packages to upgrade.
Existing versions may still be retained unless constraints require a change or an upgrade is requested.

Successful packaging alone does not prove that pyproject, the lock, and requirements agree.
Stale or conflicting inputs can make the different installation branches select incompatible dependency sets.

This is an existing daemon installation design issue, recorded for a separate follow-up.
It is deferred from the current native async SDK migration and is not a prerequisite for that work.
The migration should continue with consistent package dependency files; no SDK runtime workaround is requested by this issue.

Dominant language
Go
Stars
462
Forks
326
Avg merge
22h 15m
Merged PRs (30d)
8

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from langgenius/dify-plugin-daemon

All issues in langgenius/dify-plugin-daemon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.