Skip to content

The agent that grows with you

fix(pm): an index without upload times names the index, not a plugin conflict

Teknium25d6fa11d702
diff --git a/pm/environment.py b/pm/environment.py
index dd31668f0e1..e60b0d9a6a7 100644
--- a/pm/environment.py
+++ b/pm/environment.py
@@ -49,6 +49,17 @@ _RESOLVER_MARKERS = (
# A package's own build ran and failed; a fetch/download failure never prints this.
_BUILD_MARKERS = ("the build backend returned an error",)
+# The index omitted upload times (no PEP 700 metadata), so the release-age cutoff
+# cannot date the file. uv words it as "no solution", but the index is at fault,
+# not the requested set, so it must never read as a dependency conflict (#135589).
+# A seeded lock says "has no publish time"; a cold one only warns the date is missing
+# and hints the version was filtered, so that case needs both lines.
+_UNDATED_PIN = "has no publish time"
+_UNDATED_FILE = ("is missing an upload date", "was filtered by `exclude-newer")
+UNDATED_INDEX_HINT = ("the package index did not report upload times, which Hermes needs to apply its "
+ "14-day release-age check. Use https://pypi.org/simple or a mirror that serves "
+ "upload times (pip.conf index-url / UV_INDEX_URL), then retry.")
+
class ResolutionConflict(InstallError):
"""uv's resolver proved the union has no valid solution."""
@@ -67,6 +78,8 @@ def classify_uv_failure(stage: str, returncode: int, output: str) -> InstallErro
"""
cause = f"uv {stage} exited {returncode}: {output.strip()[-600:]}"
lowered = output.lower()
+ if _UNDATED_PIN in lowered or all(marker in lowered for marker in _UNDATED_FILE):
+ return InstallError("venv", cause, UNDATED_INDEX_HINT)
if any(marker in lowered for marker in _RESOLVER_MARKERS):
return ResolutionConflict("venv", cause)
if any(marker in lowered for marker in _BUILD_MARKERS):
diff --git a/tests/pm/test_workspace.py b/tests/pm/test_workspace.py
index ccb261424c3..5d0aadd9dd2 100644
--- a/tests/pm/test_workspace.py
+++ b/tests/pm/test_workspace.py
@@ -107,6 +107,27 @@ def test_classify_network_failure_stays_generic():
assert not isinstance(err, ResolutionConflict)
+def test_undated_index_failure_names_the_index_not_a_conflict():
+ """uv's "has no publish time" is the index omitting upload times (#135589), not a conflict."""
+ from pm.workspace import ResolutionConflict, classify_uv_failure
+
+ seeded = (" x No solution found when resolving dependencies:\n"
+ " Because resvg-py==0.4.0 has no publish time and hermes-agent depends on resvg-py==0.4.0, "
+ "we can conclude that hermes-agent's requirements are unsatisfiable.")
+ cold = ("warning: cffi-2.0.0.tar.gz is missing an upload date, but user provided: 2026-09-25T00:00:00Z\n"
+ " x No solution found when resolving dependencies:\n"
+ " Because there are no versions of cffi and you require cffi>=2.0.0, we can conclude that "
+ "your requirements are unsatisfiable.\n"
+ "hint: `cffi` was filtered by `exclude-newer` to only include packages uploaded before 2026-09-25")
+ for output in (seeded, cold):
+ err = classify_uv_failure("lock", 1, output)
+ assert not isinstance(err, ResolutionConflict)
+ assert "upload times" in err.remedy and "pypi.org" in err.remedy
+ # A real conflict on a partly undated mirror still reads as a conflict.
+ conflict = cold.splitlines()[0] + "\n x No solution found: Because a==1 depends on b<2 and c==1 depends on b>=2"
+ assert isinstance(classify_uv_failure("lock", 1, conflict), ResolutionConflict)
+
+
def test_sync_failure_is_never_a_conflict(layout, monkeypatch):
from pm.package import InstallError