The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs+smoke(telemetry): failure_class/registry appendix rows; relay smoke asserts a real failed plugin install and a failed update run
Tekniumab6f123eb4bf
diff --git a/scripts/smoke_nemo_relay_shared_metrics.py b/scripts/smoke_nemo_relay_shared_metrics.pyindex 9d539dc9c82..21eb631bd4d 100644--- a/scripts/smoke_nemo_relay_shared_metrics.py+++ b/scripts/smoke_nemo_relay_shared_metrics.py@@ -277,6 +277,32 @@ telemetry:)+# ---- iuf c1 ----+# The offline probes in the skill-lifecycle subprocess: one failed URL plugin install and one failed+# update run (refused before the checkout moved), identical in SQLite and in the export.+FAILURE_EXPECTED_DIMENSIONS = {+ "hermes.extension.install.count": {+ "failure_class": "clone_failed", "kind": "plugin", "name": "custom", "outcome": "failed",+ "registry": "none", "source": "local",+ },+ "hermes.update.run": {+ "apply_mode": "unknown", "duration_bucket": "lt_30s", "failed_stage": "apply",+ "failure_class": "aborted_before_apply", "from_version_age_bucket": "unknown", "kind": "cli",+ "outcome": "failed",+ },+}+++def _validate_failure_rows(rows: dict[str, list[dict[str, Any]]]) -> None:+ for name, dimensions in FAILURE_EXPECTED_DIMENSIONS.items():+ if [row["dimensions"] for row in rows[name]] != [dimensions] or rows[name][0]["value"] != 1:+ raise AssertionError(f"Unexpected {name}: {rows[name]}")+ stages = sorted((row["dimensions"]["stage"], row["dimensions"]["outcome"]) for row in rows["hermes.update.stage"])+ if stages != [("plan", "success"), ("snapshot", "skipped")]:+ raise AssertionError(f"Unexpected update stages: {rows['hermes.update.stage']}")+# ---- end iuf c1 ----++# One interactive turn (2 model calls, 1 read_file) on the canary custom model: the v5 per-turn,# per-conversation rows it must produce, identical in SQLite and in the export. The agent-created# skill is Hermes' own work, so it records no feature_adoption row (the exact name sets assert that).@@ -330,6 +356,7 @@ def _validate_store(database_path: Path) -> list[dict[str, Any]]:if set(by_name) != {"hermes.client.active","hermes.context_peak.count",+ "hermes.extension.install.count", # iuf c1"hermes.install.milestone","hermes.install.snapshot","hermes.model_reply_issue.count",@@ -350,6 +377,8 @@ def _validate_store(database_path: Path) -> list[dict[str, Any]]:"hermes.tool_enabled_unused.count","hermes.tool_output_truncation.count","hermes.tool_overhead.count",+ "hermes.update.run", # iuf c1+ "hermes.update.stage", # iuf c1}:raise AssertionError(f"Unexpected SQLite counters:\n{json.dumps(counters, indent=2)}"@@ -500,6 +529,7 @@ def _validate_store(database_path: Path) -> list[dict[str, Any]]:):raise AssertionError(f"Unexpected skill load counters: {loads}")_validate_v5_rows(by_name)+ _validate_failure_rows(by_name) # iuf c1return counters@@ -554,6 +584,7 @@ def _validate_packages(if set(metrics) != {"hermes.client.active","hermes.context_peak.count",+ "hermes.extension.install.count", # iuf c1"hermes.install.milestone","hermes.install.snapshot","hermes.model_reply_issue.count",@@ -574,6 +605,8 @@ def _validate_packages("hermes.tool_enabled_unused.count","hermes.tool_output_truncation.count","hermes.tool_overhead.count",+ "hermes.update.run", # iuf c1+ "hermes.update.stage", # iuf c1}:raise AssertionError(f"Unexpected package metrics:\n{json.dumps(metrics, indent=2)}"@@ -644,6 +677,7 @@ def _validate_packages(}:raise AssertionError(f"Unexpected skill load metrics: {loads}")_validate_v5_rows(metrics)+ _validate_failure_rows(metrics) # iuf c1return package_paths, packages@@ -783,6 +817,25 @@ def main() -> int:"set_state(skill, STATE_ARCHIVED)","set_state(skill, STATE_ACTIVE)","record_installed(installed)",+ # A real failing plugin install (offline: a file:// repo that does not exist) and a+ # dirty-tree-shaped final update receipt: each emits one row with a failure_class.+ "from pathlib import Path",+ "from hermes_cli.plugins_cmd import PluginOperationError, _install_plugin_core",+ "from hermes_cli.plugins_cmd_install import recorded_install",+ "missing = (Path.cwd() / 'no-such-plugin-repo').as_uri()",+ "try:",+ " recorded_install(lambda: _install_plugin_core(missing, force=False),",+ " catalog_name=None, identifier=missing)",+ " raise SystemExit('bogus plugin install succeeded')",+ "except PluginOperationError:",+ " pass",+ "from hermes_cli.observability.shared_metrics_update import record_update_receipt",+ "record_update_receipt({'schema': 1, 'update_id': '0123456789abcdef',",+ " 'started_at': '2026-10-06T10:00:00+00:00', 'finished_at': '2026-10-06T10:00:01+00:00',",+ " 'outcome': 'failed', 'exit_code': 1, 'stop_reason': 'sys.exit(1)', 'pre_update': {},",+ " 'stages': [{'name': 'plan', 'outcome': 'success', 'at': '2026-10-06T10:00:00+00:00'},",+ " {'name': 'snapshot', 'outcome': 'skipped', 'at': '2026-10-06T10:00:00+00:00'}],",+ " 'steps': [], 'fleet': []})","runtime = relay_shared_metrics._get_runtime()","assert runtime is not None","runtime.shutdown()",diff --git a/website/docs/developer-guide/relay-shared-metrics.md b/website/docs/developer-guide/relay-shared-metrics.mdindex 43bf44eb443..22635676786 100644--- a/website/docs/developer-guide/relay-shared-metrics.md+++ b/website/docs/developer-guide/relay-shared-metrics.md@@ -497,6 +497,18 @@ database and the count is not reported.| `hermes.feature_disabled.count` | kind (`toolset`, `skill`, `plugin`, `platform`, `setting`, `memory`, `curator`, `compression`), name, surface (`cli_tools`, `cli_config`, `cli_slash`, `tui`, `desktop`, `dashboard`), event (`disabled`, `re_enabled`) | What users turn off. Diffed at the config write itself: a default-on toolset removed, a skill or plugin added to its disabled list, a default-`true` setting set false (and each moved back). Names are public only when shipped — toolset key, bundled/catalog skill, bundled/catalog plugin (messaging-platform plugins report as `platform`), `DEFAULT_CONFIG` key path (never a value) — else `custom`. Uninstalling a catalog skill counts as `disabled`. Only user entry points record (`hermes tools` / `config` / `skills` / `plugins`, chat slash commands, TUI/Desktop, dashboard); setup and migrations do not, even when a migration runs inside one of them (`hermes config migrate`, a profile created from the dashboard). A setting whose value is a `${VAR}` template is not compared. The diff and the record run on a background thread after the write, outside every config lock. At most once per (kind, name, event) per day. |<!-- ---- end v5 signals ---- -->+<!-- ---- iuf c1 ---- -->+#### Install and update failure reasons++Since package schema v4 (extended in place while v4 was canary-only), two existing metrics say why+they failed. Rows recorded before the change keep their old field set and still package.++| Metric | Dimensions added | Question it answers |+|---|---|---|+| `hermes.extension.install.count` | failure class, registry | Why skill, plugin and MCP installs fail, and which skills-hub source fails. `failure_class` is `none` on success, else a closed name for the failure exit that stopped the install. Skills: `ambiguous`, `auth_rejected`, `fetch_failed`, `invalid_bundle`, `invalid_name`, `not_found`, `rate_limited`, `scan_blocked`, `stale_index`. Plugins: `already_installed`, `clone_failed`, `deps_declined`, `deps_failed`, `git_missing`, `incompatible`, `invalid_source`, `manifest_invalid`, `non_interactive`, `removed_from_catalog`, `scan_blocked`. MCP servers: `auth_required`, `bootstrap_failed`, `clone_failed`, `config_invalid`, `config_rejected`, `connect_failed`, `git_missing`, `missing_credentials`, `server_start_failed`. Every kind may also read `exception`, `filesystem_error`, `network`, `other`, `permission`. A raised error without a named class is classified by its Python type only (`PermissionError` reads `permission`, connection and timeout errors `network`, other `OSError`s `filesystem_error`, anything else `exception`, its type name dropped). `registry` is set on skill rows only: the skills-hub adapter that resolved or served the skill, one of `browse-sh`, `clawhub`, `github`, `hermes-index`, `lobehub`, `official`, `skills-sh`, `url`, `well-known` (the adapter ids `tools/skills_hub_search.py::create_source_router` builds), `unresolved` when no adapter answered, `none` for built-in restores and every plugin/MCP row, `other` otherwise. Never the identifier, URL, error text or path; `name` keeps its existing catalog-or-`custom` rule. |+| `hermes.update.run` | failure class | Why `hermes update` fails, next to where (`failed_stage`). `none` unless the outcome is `failed` or `refused`. Derived from the final update receipt only: `aborted_before_apply`, `build_failed`, `deps_failed`, `exception`, `fleet_stale`, `fleet_unverified`, `git_failed`, `interrupted`, `lock_held`, `managed_install`, `os_error`, `restart_failed`, `subprocess_failed`, else `other`; Desktop packaged self-updates report `unknown` (their RPC carries a stage, never a reason). An exception that ended the run is read by its type name alone, never its message. A failed run whose every stage mark passed now reads `failed_stage` `verify` (the post-restart verification wrote `partial`) or `restart` (a skipped restart left the fleet owing one) instead of `other`. |+<!-- ---- end iuf c1 ---- -->+Local state is written under:```text@@ -518,7 +530,9 @@ locally for 30 days. Pending package rows and counters with unexported deltasare never pruned.Package schemas v1, v2 and v3 remain unchanged for existing outbox files. Newpackages use v4, which adds `failure_class` to `hermes.compression.count` and-`hermes.memory.op.count` and still accepts their v3 field sets, as v3 accepted the v2+`hermes.memory.op.count` and still accepts their v3 field sets (and, extended in place,+`failure_class` on `hermes.extension.install.count` / `hermes.update.run` plus `registry` on the+former, still accepting their earlier v4 field sets), as v3 accepted the v2field sets of `hermes.model_route.count`, `hermes.tool_call.count` and the taskcounters, so counters recorded before an upgrade drain safely.Vocabularies derived from in-repo registries (tool names, platforms, memory