mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 05:17:15 +00:00
Review finding (P2, #144640): LazyHeaders was a read-only Mapping, so a user provider override doing get_provider_profile('gmi').default_headers.copy() (or |, update, json.dumps, ==) raised AttributeError and the provider disappeared, in-process and under plugins.isolation: host. LazyHeaders is now a dict subclass that stores every key up front and resolves callable values (the release-carrying User-Agent) on first value read. Every value-reading/mutating method resolves first; __iter__ is overridden so dict(x)/{**x}/f(**x) leave CPython's raw-storage fast path; json.dumps takes items() because the stored keys make it non-empty. .copy()/|/copy/pickle yield plain resolved dicts. Importing provider plugins still runs no git. The plugin-host Mapping materialization is gone: encode() reads a dict subclass through items(), which resolves.