From 8991231294de10921bd0a37ea862a56d10d59101 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 16:46:08 +0000 Subject: configs/hermes: no second timestamp in the gateway's journal lines The gateway formats its stderr log lines with a timestamp of their own, which journald adds anyway. Patch hermes-agent's source to leave it out when stderr is the journal (JOURNAL_STREAM is set); the log files in ~/.hermes/logs keep theirs. --- configs/hermes.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/configs/hermes.nix b/configs/hermes.nix index 7255fc3..ab04b15 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -38,11 +38,21 @@ let # Fetched with the host's pkgs (see default.nix), as imports need it. # Bump rev and hash together. - src = hostPkgs.fetchFromGitHub { - owner = "NousResearch"; - repo = "hermes-agent"; - rev = "9f47677483d1b4de4d1a88d37b3b7ca18b18b215"; - hash = "sha256-4fRnt5Dh7bbuNR6XODpuhoXP/XOrZP0Fc5XqYuvj+/Y="; + src = hostPkgs.applyPatches { + name = "hermes-agent-source"; + src = hostPkgs.fetchFromGitHub { + owner = "NousResearch"; + repo = "hermes-agent"; + rev = "9f47677483d1b4de4d1a88d37b3b7ca18b18b215"; + hash = "sha256-4fRnt5Dh7bbuNR6XODpuhoXP/XOrZP0Fc5XqYuvj+/Y="; + }; + # The gateway's log lines on stderr get a timestamp of their own, which + # journald adds anyway: leave it out when stderr is the journal. + postPatch = '' + substituteInPlace gateway/run.py --replace-fail \ + 'RedactingFormatter("%(asctime)s %(levelname)s %(name)s: %(message)s")' \ + 'RedactingFormatter(("" if os.environ.get("JOURNAL_STREAM") else "%(asctime)s ") + "%(levelname)s %(name)s: %(message)s")' + ''; }; # hermes-agent's flake without flakes, like flake-compat, but with this -- cgit v1.3.1