Files
hermes-agent/tests/providers
holny d154248eb6 perf(providers): memoize the bare-name custom check on the config signature
Review follow-up on #120901: has_named_custom_provider walks the provider
registry (_shadowed_by_builtin -> resolve_provider, which formats an
AuthError for unregistered names) and loads config on every call — ~2.5ms
per miss, and this sits on the profile-miss path that
model_metadata._strip_provider_prefix reaches per model/prefix.

Memo per home keyed on the config file's file_signature — the same
invalidation signal load_config uses — so an edit re-arms the next lookup
and multiplex homes never borrow each other's answers (keyed by
hermes_home_key, resolved at call time).

Measured on this machine: raw helper 2.319 ms/call, memoized 0.005
ms/call (437x). Tests: 3 new contracts (memo hit, config-change
invalidation, home-key isolation); providers suite 69/69.
2026-10-05 16:39:20 -05:00
..