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

Aperta
#860 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@WH-2099 ci sta già lavorando.

Dal 20/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
Go
Stelle
462
Fork
326
Merge medio
22h 15m
PR unite (30g)
8

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di langgenius/dify-plugin-daemon

Tutte le issue di langgenius/dify-plugin-daemon

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.