Skip to content

[Bug]: Nix messaging build fails due to stale workspace npmDepsHash #48318

Closed

Description

@smg1024

Bug Description

The Nix messaging package currently fails to build from the latest main commit because the workspace-level npmDepsHash in nix/lib.nix is stale.

This was observed when updating a downstream NixOS flake that consumes:

inputs.hermes-agent.url = "github:NousResearch/hermes-agent";
inputs.hermes-agent.inputs.nixpkgs.follows = "nixpkgs";

and installs:

inputs.hermes-agent.packages.${system}.messaging

The failing upstream revision is:

737007e3356d7d16fbc9b7f8e70f1806b2f2d074
hermes-agent-0.16.0

I found the related open issue #37692 for a similar Nix/npm hash drift on the desktop renderer. This report is for the messaging package path, where the failure comes from the shared workspace npmDepsHash in nix/lib.nix.

Steps to Reproduce

On an x86_64-linux Nix builder with a clean store, build the messaging package from the current main revision:

nix build github:NousResearch/hermes-agent/737007e3356d7d16fbc9b7f8e70f1806b2f2d074#packages.x86_64-linux.messaging

A downstream NixOS system closure that includes the same package also reproduces it:

nix build .#nixosConfigurations.midgard.config.system.build.toplevel

where the Home Manager profile includes inputs.hermes-agent.packages.x86_64-linux.messaging.

Expected Behavior

The messaging package should build successfully from the pinned flake revision.

Actual Behavior

The build fails in a fixed-output npm-deps derivation with a hash mismatch:

error: hash mismatch in fixed-output derivation '/nix/store/i32dfb0m9lnyi2mvqfqwc0ckb6qynnaz-npm-deps.drv':
         specified: sha256-m9cjbjzi4SaFCjODfdrawS5e+1ag+MpRn528/upSNqo=
            got:    sha256-kbjJksq7limRIYqP3DwI+GNgCXkG96tXcsQqmuEedxo=
error: Cannot build '/nix/store/awpl2v326n9k376k77cki5qfwrxaclya-hermes-tui-0.0.1.drv'.
       Reason: 1 dependency failed.
error: Cannot build '/nix/store/yd3is0hjsjlsbz1304xwv7d6yba4vqjp-hermes-web-0.0.0.drv'.
       Reason: 1 dependency failed.
error: Cannot build '/nix/store/4wh3r1ixfx2dnbdwx2k955gqa7fw9bmr-hermes-agent-0.16.0.drv'.
       Reason: 1 dependency failed.

Affected Component

  • Setup / Installation
  • Other: Nix flake package build

Messaging Platform (if gateway-related)

  • N/A (CLI only)

Debug Report

Not available. The package fails during Nix build before Hermes can be installed or run, so hermes debug share cannot be executed from this failing package.

Operating System

GitHub Actions Ubuntu runner building x86_64-linux Nix derivations. The downstream flake uses nixpkgs nixos-26.05 at:

a0374025a863d007d98e3297f6aa46cc3141c2f0

Python Version

N/A for the reproduction. The failure happens in the Nix fixed-output npm dependency fetch before the Python package environment is the root issue.

Hermes Version

hermes-agent-0.16.0
commit 737007e3356d7d16fbc9b7f8e70f1806b2f2d074

Additional Logs / Traceback (optional)

The dependency chain from the downstream NixOS system closure includes:

/nix/store/i32dfb0m9lnyi2mvqfqwc0ckb6qynnaz-npm-deps.drv
/nix/store/awpl2v326n9k376k77cki5qfwrxaclya-hermes-tui-0.0.1.drv
/nix/store/yd3is0hjsjlsbz1304xwv7d6yba4vqjp-hermes-web-0.0.0.drv
/nix/store/4wh3r1ixfx2dnbdwx2k955gqa7fw9bmr-hermes-agent-0.16.0.drv

Root Cause Analysis (optional)

At this revision, nix/lib.nix defines a single workspace-level npm dependency hash:

npmDepsHash = "sha256-m9cjbjzi4SaFCjODfdrawS5e+1ag+MpRn528/upSNqo=";

npmDeps = pkgs.fetchNpmDeps {
  inherit src;
  fetcherVersion = 2;
  hash = npmDepsHash;
};

The committed workspace package-lock.json content no longer matches that hash. Nix reports the actual hash as:

sha256-kbjJksq7limRIYqP3DwI+GNgCXkG96tXcsQqmuEedxo=

This appears to be the same class of issue as #37692: package-lock / npm dependency content changed without refreshing the corresponding Nix fixed-output hash.

Proposed Fix (optional)

Short term, update the workspace npmDepsHash in nix/lib.nix to:

npmDepsHash = "sha256-kbjJksq7limRIYqP3DwI+GNgCXkG96tXcsQqmuEedxo=";

Longer term, the approach mentioned in #37692 / #48213 would be preferable if it removes this hash-drift class entirely by deriving npm dependencies directly from lockfile integrity data or by adding CI that builds all Nix package outputs on a fresh store.

Are you willing to submit a PR for this?

Not at the moment. I can help validate a proposed fix against the downstream NixOS flake once available.

Activity

  1. added
    type/bugSomething isn't working
    P1High — major feature broken, no workaround
    on Jun 18, 2026
  2. alt-glitch commented on Jun 18, 2026

    @alt-glitch

    Related: #37692 (same stale-npmDepsHash class on the hermes-desktop-renderer hash in nix/desktop.nix) and #48213 (fix(nix): hashless npm deps via importNpmLock — the longer-term fix that removes this hash-drift class entirely).

    Confirmed still live on main: nix/lib.nix:24 carries the stale npmDepsHash = "sha256-m9cjbjzi4SaFCjODfdrawS5e+1ag+MpRn528/upSNqo=", which fails the fixed-output npm-deps derivation and breaks the messaging/tui/web package builds. Not a duplicate of #37692 — that one is the desktop-renderer hash in a different file (nix/desktop.nix); this is the shared workspace-level hash in nix/lib.nix. Short-term a one-liner hash refresh fixes it; #48213 would eliminate the class.

  3. teknium1 commented on Jun 21, 2026

    @teknium1
    Collaborator

    Closing as resolved on current main — nix/lib.nix now uses importNpmLock (hashless), eliminating the npmDepsHash drift class. Thanks for the report.

  4. added
    area/install-updateInstaller, updater, packaging, wheels, doctor
    and removed on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundarea/install-updateInstaller, updater, packaging, wheels, doctortype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions