mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 21:36:47 +00:00
The refusal named a cause that cannot happen. `_vendor_gateway` never contacts the network, so "unreachable" was wrong for the no-identity, failed-lookup and not-entitled cases alike — and a guest was told it had no Nous identity when it holds a perfectly good one. Root of the guest case: `_error_info` dropped `account_tier`, so a guest whose account lookup failed — precisely the state where the tier can no longer be read from the JWT, because the token is inside its refresh window — came back looking like a registered identity. Carry the stored tier through the error snapshot, and both this refusal and every other tier-aware surface see it. Pick the reason in priority order (guest / no usable identity / unreachable) in one helper beside `fast_search_entitled`, so the predicate and its explanation cannot drift, and phrase it as a clause for `selection_error`'s "but …" template — the canonical `FREE_TIER_NEEDS_ACCOUNT` strings are standalone sentences and read wrong embedded mid-sentence. Also record why the `error` clause in `fast_search_entitled` is load-bearing rather than defensive, so it is not removed as belt-and-braces. The test helper now mirrors what anon_auth actually persists (the tier alongside the token), which is what makes the failed-lookup case reproducible at all.