Files
hermes-agent/agent
teknium1 f7b5ea6f7a fix(telemetry): loop metrics count only the user's real backend work and curator passes
Review findings M7, M8, m6, m7 and the browser half of m8 on the v4 loop metrics.

- M7: TUI/Desktop @-path completion on a non-local backend lists the directory through
  terminal_tool, so every keystroke added a hermes.execution_backend.count row as if the user
  ran a command. Hermes-owned calls now run inside shared_metrics_loop.unmetered_backend_calls()
  (a contextvar checked in record_execution_backend) instead of a flag threaded through
  terminal_tool. It was the only non-_host_local internal terminal_tool caller (bot DM runners
  already use _host_local; the prompt-builder probe calls env.execute directly).
- M8: a scheduled curator tick that finds the run claim held recorded scheduled/skipped every
  tick (5 ticks -> 5 rows for one pass). The holder's own pass is the one counted; the held
  branch now records nothing. Real dry runs still report skipped.
- m6: a foreground timeout returns exit 124 with partial output and no error field, so it was
  recorded as success. exit 124 now records outcome=failed, error_class=timeout.
- m7: vercel_sandbox (and managed_modal) are built-in backends in
  tools/terminal_tool_config._BUILTIN_BACKENDS but collapsed to other. Added to
  TERMINAL_BACKENDS and both schema enums; a test pins every built-in backend to its own bucket.
- m8 (browser): record_browser_call resolved the browser backend on every call even with
  collection off. The resolver is now passed lazily and only runs inside the gated builder.

The existing test asserting a held claim records scheduled/skipped encoded M8 itself and is
replaced by one asserting held ticks record nothing.
2026-09-28 12:43:03 -07:00
..
…
2026-09-11 09:31:13 -07:00