Skip to content

fix(update): ignore shared deps when refreshing lazy backends - #65744

Closed
Gigisanta wants to merge 2 commits into
NousResearch:mainfrom
Gigisanta:fix/lazy-refresh-primary-package
Closed

fix(update): ignore shared deps when refreshing lazy backends#65744
Gigisanta wants to merge 2 commits into
NousResearch:mainfrom
Gigisanta:fix/lazy-refresh-primary-package

Conversation

@Gigisanta

Copy link
Copy Markdown

Summary

hermes update currently treats a lazy backend as active when any declared package is installed. Shared secondary dependencies such as aiohttp therefore mark platform.matrix active even when Matrix was never configured or installed. Every update then attempts to build mautrix[encryption] / python-olm, producing a recurring optional-backend warning on current macOS toolchains.

Use each feature's first declared spec as its primary activation anchor. Secondary/shared packages no longer trigger unrelated backend installs.

Reproduction

On a standard Hermes environment with aiohttp installed but no mautrix:

  • before: platform.matrix in active_features() is True
  • after: False

The existing multi-package partial-install behavior remains covered through the primary package (slack-bolt).

Verification

  • python -m pytest tests/tools/test_lazy_deps.py -q
  • 65 passed
  • live refresh probe: 25 current, 0 failed; platform.matrix absent

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation labels Jul 16, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #27878: both use the same primary-package activation fix. This PR also changes the trace-upload dependency pin, so it is not a mechanical duplicate; please consider splitting that independent delta.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Fix ignores shared deps when refreshing lazy backends (+19 -9). Clean dependency management fix.


Reviewed by Hermes Agent

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused reproduction. The false-positive premise remains present on current main: tools/lazy_deps.py:870 activates a feature when any dependency is installed, and hermes_cli/main.py:7714-7726 passes that list into the update refresh.

Problems

  • The replacement at tools/lazy_deps.py:870 drops the existing partial-install recovery contract documented in tests/tools/test_lazy_deps.py:319-327: a remaining non-primary package no longer causes hermes update to repair the feature.
  • tools/lazy_deps.py:242 also changes the trace-upload huggingface-hub pin. This is independent of activation detection, matching the split request in the existing member comment.

Suggested changes

  • Split the trace dependency change.
  • Preserve both requirements with durable activation state rather than inferring activation from tuple order; add tests for aiohttp-only Matrix and a non-primary partial installation.

Automated hermes-sweeper review.

Comment thread tools/lazy_deps.py
Used by ``hermes update`` to figure out which lazy backends need a
refresh pass when pins move in :data:`LAZY_DEPS`.
"""
active = []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes shared-dependency false positives, but it also removes the existing partial-install recovery behavior documented by the prior test: if slack-bolt is missing while another Slack-specific dependency remains, update will no longer detect and repair Slack. Please use activation state (or preserve that case) rather than making tuple position the activation record.

Comment thread tools/lazy_deps.py
),
# HF Agent Trace Viewer upload (hermes trace upload / /upload-trace).
"tool.trace_upload": ("huggingface-hub==1.2.3",),
"tool.trace_upload": ("huggingface-hub==1.23.0",),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this trace-upload dependency pin into a separate change. It is independent of lazy-feature activation, as the existing member comment also notes.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/install-update Installer, updater, packaging, wheels, doctor labels Jul 18, 2026
@Gigisanta Gigisanta closed this Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install-update Installer, updater, packaging, wheels, doctor comp/cli CLI entry point, hermes_cli/, setup wizard needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants