The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(telemetry): tool names a stable release shipped stay valid after leaving core
Tekniumb7ab3f7d8544
diff --git a/hermes_cli/observability/schemas/hermes.shared_metrics.v3.schema.json b/hermes_cli/observability/schemas/hermes.shared_metrics.v3.schema.jsonindex c8bfebf9801..01865d16162 100644--- a/hermes_cli/observability/schemas/hermes.shared_metrics.v3.schema.json+++ b/hermes_cli/observability/schemas/hermes.shared_metrics.v3.schema.json@@ -3274,6 +3274,7 @@"search","session_search","skills",+ "spotify","start_chat","terminal","todo",@@ -4285,6 +4286,13 @@"skill_manage","skill_view","skills_list",+ "spotify_albums",+ "spotify_devices",+ "spotify_library",+ "spotify_playback",+ "spotify_playlists",+ "spotify_queue",+ "spotify_search","terminal","text_to_speech","todo_list",diff --git a/hermes_cli/observability/schemas/hermes.shared_metrics.v4.schema.json b/hermes_cli/observability/schemas/hermes.shared_metrics.v4.schema.jsonindex 6beda53489f..4d7e0044b63 100644--- a/hermes_cli/observability/schemas/hermes.shared_metrics.v4.schema.json+++ b/hermes_cli/observability/schemas/hermes.shared_metrics.v4.schema.json@@ -3670,6 +3670,7 @@"session_search","setup","skills",+ "spotify","start_chat","terminal","todo",@@ -4622,6 +4623,7 @@"browser_scroll","browser_snapshot","browser_type",+ "browser_vault","browser_vault_enter_code","browser_vault_fill","browser_vault_list",@@ -4672,10 +4674,21 @@"read_window_below","search_files","session_search",+ "set_theme",+ "setup_beat",+ "setup_choose","show_tip","skill_manage","skill_view","skills_list",+ "spotify_albums",+ "spotify_devices",+ "spotify_library",+ "spotify_playback",+ "spotify_playlists",+ "spotify_queue",+ "spotify_search",+ "start_chat","terminal","text_to_speech","todo_list",diff --git a/hermes_cli/observability/shared_metrics_contract.py b/hermes_cli/observability/shared_metrics_contract.pyindex d05af295bf1..a50ca9c1341 100644--- a/hermes_cli/observability/shared_metrics_contract.py+++ b/hermes_cli/observability/shared_metrics_contract.py@@ -161,16 +161,21 @@ TASK_FAILURE_CLASSES = MODEL_ERROR_CLASSES | frozenset({_CORE_GATEWAY_PLATFORMS = (frozenset(PLATFORMS) - {"api_server", "cli", "cron"}) | {"none", "plugin", "relay"}# The Tool Search bridge tools are not in a toolset; every hosted connector tool reads ``connector``.BRIDGE_TOOL_NAMES = frozenset({"tool_call", "tool_describe", "tool_search"})-# Deleted core tools: setup_choose/start_chat with the old setup flow; the built-in browser_* tools with-# agent-browser (the camofox plugin's same-named tools record as ``plugin``). v4 only adds values, and rows-# older releases saved with these names must still package; recording maps through the live sets-# (tool_metric_name, toolset_metric_name).+# Core tools a stable release shipped that core no longer has: setup_choose/start_chat with the old setup+# flow; the built-in browser_* tools with agent-browser (the camofox plugin's same-named tools record as+# ``plugin``); the five browser_vault_* tools folded into one browser_vault; spotify_* when Spotify left core+# for its catalog plugin. v4 only adds values, and rows older releases saved with these names must still+# package; recording maps through the live sets (tool_metric_name, toolset_metric_name).RETIRED_TOOL_NAMES = frozenset({"setup_choose", "start_chat","browser_back", "browser_click", "browser_console", "browser_get_images", "browser_navigate","browser_press", "browser_scroll", "browser_snapshot", "browser_type", "browser_vision",+ "browser_vault_enter_code", "browser_vault_fill", "browser_vault_list", "browser_vault_save_login",+ "browser_vault_unlock",+ "spotify_albums", "spotify_devices", "spotify_library", "spotify_playback", "spotify_playlists",+ "spotify_queue", "spotify_search",})-RETIRED_TOOLSET_NAMES = frozenset({"setup", "start_chat"})+RETIRED_TOOLSET_NAMES = frozenset({"setup", "spotify", "start_chat"})_LIVE_TOOL_NAMES = BUILTIN_TOOL_NAMES | BRIDGE_TOOL_NAMES | {"connector", "mcp", "plugin", "unknown"}TOOL_NAMES = _LIVE_TOOL_NAMES | RETIRED_TOOL_NAMESTOOL_ERROR_CLASSES = frozenset({diff --git a/tests/hermes_cli/test_relay_shared_metrics.py b/tests/hermes_cli/test_relay_shared_metrics.pyindex 38ff899d2d0..2ad975c0c43 100644--- a/tests/hermes_cli/test_relay_shared_metrics.py+++ b/tests/hermes_cli/test_relay_shared_metrics.py@@ -1275,9 +1275,15 @@ def test_package_builder_rejects_tampered_dimensions(tmp_path):@pytest.mark.parametrize(("metric_name", "dimensions"), [("hermes.tool_enabled_unused.count", {"toolset": "start_chat", "used": "yes"}),("hermes.tool.usage.count", {"error_class": "none", "outcome": "success", "tool_name": "setup_choose"}),+ # Spotify left core after v0.21.6; the browser_vault_* tools became one browser_vault after v0.21.7.+ ("hermes.tool_enabled_unused.count", {"toolset": "spotify", "used": "no"}),+ ("hermes.tool.usage.count", {"error_class": "none", "outcome": "success", "tool_name": "spotify_search"}),+ ("hermes.tool_unavailable.count", {"model": "custom", "provider": "custom", "tool_name": "spotify_playback"}),+ ("hermes.tool_unavailable.count", {"model": "custom", "provider": "custom", "tool_name": "browser_vault_fill"}),])-def test_a_saved_row_naming_a_retired_setup_tool_or_toolset_still_packages(tmp_path, metric_name, dimensions):- # v0.21.6/7 recorded these names before the old setup flow was deleted; v4 only adds values.+def test_a_saved_row_naming_a_retired_tool_or_toolset_still_packages(tmp_path, metric_name, dimensions):+ # A stable release recorded these names before core dropped them; v4 only adds values, so the+ # row exports as recorded instead of re-bucketing (or, with no bucket, being left out).database_path = tmp_path / "metrics.sqlite3"store = SharedMetricsStore(database_path, tmp_path / "outbox")store.record_model_call(_dimensions(), _resource())diff --git a/tests/hermes_cli/test_shared_metrics_efficiency.py b/tests/hermes_cli/test_shared_metrics_efficiency.pyindex 1f30ad5ac00..a4a4c19742b 100644--- a/tests/hermes_cli/test_shared_metrics_efficiency.py+++ b/tests/hermes_cli/test_shared_metrics_efficiency.py@@ -237,7 +237,8 @@ def test_v3_schema_accepts_exactly_the_contract_values():by_name = {d["properties"]["name"]["const"]: d for d in schema["$defs"].values() if "properties" in d}refs = {item["$ref"].rsplit("/", 1)[1] for item in schema["properties"]["metrics"]["items"]["oneOf"]}for metric in (contract.TASK_COST_METRIC, contract.WASTED_TOKENS_METRIC, contract.TOOL_OUTPUT_TRUNCATION_METRIC,- contract.TOOL_OVERHEAD_METRIC, contract.TOOL_ENABLED_UNUSED_METRIC, contract.CACHE_BREAK_METRIC):+ contract.TOOL_OVERHEAD_METRIC, contract.TOOL_ENABLED_UNUSED_METRIC, contract.CACHE_BREAK_METRIC,+ contract.TOOL_UNAVAILABLE_METRIC):assert any(schema["$defs"][r]["properties"]["name"]["const"] == metric for r in refs if r.endswith("_counter"))dims = by_name[metric]["properties"]["dimensions"]["properties"]expected = contract._COUNTER_DIMENSION_VALUES[metric]diff --git a/website/docs/developer-guide/relay-shared-metrics.md b/website/docs/developer-guide/relay-shared-metrics.mdindex 99d60e9b4d1..f950604250c 100644--- a/website/docs/developer-guide/relay-shared-metrics.md+++ b/website/docs/developer-guide/relay-shared-metrics.md@@ -713,7 +713,10 @@ still drain: the removed built-in browser tools (`browser_navigate`,`browser_back`, `browser_press`, `browser_console`, `browser_get_images`,`browser_vision`) remain valid tool names, and `camofox` remains a valid browserbackend label. Camofox now ships as the `camofox` catalog plugin, so its tools-report `plugin`.+report `plugin`. The same holds for the five `browser_vault_*` tools that became+one `browser_vault` tool, and for the `spotify` toolset and its `spotify_*` tools,+which now ship as the `spotify` catalog plugin and report `plugin` / `custom`.+A value a stable release shipped never leaves the contract.Each package contains an `install_id` generated as a random UUID. Despite theschema field name, its current scope is one `HERMES_HOME`, so it is more