Files
hermes-agent/website/docs/developer-guide
teknium1 41ce3104a7 fix(telemetry): provider_setup counts only a new provider credential or endpoint (M13, m18)
Every PUT /api/env write of a provider-shaped variable recorded
started+completed: an empty value (a clear), a same-value re-save,
GITHUB_TOKEN/GH_TOKEN (-> copilot), HF_TOKEN, and keys the TTS/STT/image
panels also save (GEMINI_API_KEY, XAI_API_KEY, DEEPINFRA_API_KEY). TUI
model.save_key counted re-saves; editing a custom endpoint counted as a new
setup.

- record_api_key_saved takes the value and the stored value read before the
  save: only a non-empty, changed value counts.
- provider_for_api_key_env returns None for ecosystem tokens (GITHUB_TOKEN,
  GH_TOKEN, HF_TOKEN) and any key a TOOL_CATEGORIES panel asks for: a bare
  key save cannot tell a provider connection from a tool setting (the PUT
  body has no provider flag; adding one is Desktop work, see NOT_COVERED).
  Provider pickers (CLI, TUI model.save_key with its explicit slug) still
  count those providers.
- model.save_key skips a same-key re-save.
- upsert_custom_endpoint records only when the endpoint did not exist.

Probe p4_web_double.py (real route functions):
  before: openrouter started x3/completed x3 (save, re-save, clear),
          copilot x1 from GITHUB_TOKEN, custom x3 (create + 2 edits)
  after:  openrouter x1, no copilot row, custom x1
Tests test_web_forms_count_only_a_new_provider_key_or_endpoint and the
extended test_api_key_env_maps_to_provider_only are RED on base.
2026-09-28 12:43:03 -07:00
..