From 6604aa1cbe3ba340edbdafb7a2d3d9cffa7b94a9 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 6 Jul 2026 12:49:05 -0700 Subject: [PATCH] chore(trace): drop external porting references from docstrings Describe the trace-upload design in Hermes' own terms. --- agent/trace_upload.py | 27 ++++++++++++--------------- hermes_cli/trace.py | 2 -- tests/agent/test_trace_upload.py | 7 +++---- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/agent/trace_upload.py b/agent/trace_upload.py index a44d0cf2fa8..f65547440c7 100644 --- a/agent/trace_upload.py +++ b/agent/trace_upload.py @@ -1,29 +1,26 @@ """Upload a Hermes session transcript to Hugging Face as an agent trace. -Ported from qwibitai/nanoclaw#2648 ("/upload-trace"), adapted to Hermes' -architecture. NanoClaw could push its Claude Code ``.jsonl`` files as-is -because its runner *is* Claude Code. Hermes stores sessions in its own -SQLite store (``hermes_state.SessionDB``), so we reconstruct the -conversation and emit it in the **Claude Code JSONL** shape — one of the -three formats the Hugging Face Agent Trace Viewer auto-detects -(Claude Code / Codex / Pi). No dataset-side preprocessing is needed; the -Hub tags the dataset ``agent-traces`` and opens it in the viewer. +Hermes stores sessions in its own SQLite store (``hermes_state.SessionDB``), +so we reconstruct the conversation and emit it in the **Claude Code JSONL** +shape — one of the three formats the Hugging Face Agent Trace Viewer +auto-detects (Claude Code / Codex / Pi). No dataset-side preprocessing is +needed; the Hub tags the dataset ``agent-traces`` and opens it in the viewer. Docs: https://huggingface.co/docs/hub/agent-traces Design notes ------------ -* **Zero LLM turn.** Like NanoClaw's runner-handled command, this is a - deterministic export — it never spends a model call. The ``hermes trace - upload`` subcommand calls :func:`upload_session_trace` directly. +* **Zero LLM turn.** This is a deterministic export — it never spends a + model call. The ``hermes trace upload`` subcommand calls + :func:`upload_session_trace` directly. * **Private by default.** Traces can contain prompts, tool output, local paths, and secrets. The dataset is created private and every text body is passed through Hermes' secret redactor (``force=True``) unless the caller explicitly opts out with ``redact=False``. -* **Never raises.** Returns a user-facing status string so the slash - handlers can echo it straight back to the user (matches the NanoClaw - contract). Programmatic callers that need the URL can use - :func:`build_trace_jsonl` + :func:`_do_upload` directly. +* **Never raises.** Returns a user-facing status string so command + handlers can echo it straight back to the user. Programmatic callers + that need the URL can use :func:`build_trace_jsonl` + :func:`_do_upload` + directly. """ from __future__ import annotations diff --git a/hermes_cli/trace.py b/hermes_cli/trace.py index 7cb75536540..640dea16127 100644 --- a/hermes_cli/trace.py +++ b/hermes_cli/trace.py @@ -3,8 +3,6 @@ Thin CLI wrapper over :mod:`agent.trace_upload`. The heavy lifting (session load, Claude Code JSONL conversion, HF upload) lives there so the command handler stays small and deterministic. - -Ported from qwibitai/nanoclaw#2648. """ from __future__ import annotations diff --git a/tests/agent/test_trace_upload.py b/tests/agent/test_trace_upload.py index 88ace784ccf..db8a8925074 100644 --- a/tests/agent/test_trace_upload.py +++ b/tests/agent/test_trace_upload.py @@ -1,9 +1,8 @@ """Tests for agent.trace_upload — Hugging Face session-trace upload. -Ported from qwibitai/nanoclaw#2648. Covers the Claude Code JSONL converter, -HF token resolution, the no-token message path, and the upload path with a -mocked ``HfApi`` (verifying repo id, file path, and content without touching -the network). +Covers the Claude Code JSONL converter, HF token resolution, the no-token +message path, and the upload path with a mocked ``HfApi`` (verifying repo +id, file path, and content without touching the network). """ import json