mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
on_post_llm_call extracted usage via `if response is not None:`, taking the response-object path. But post_api_request delivers `response` as a sanitized dict (no `.usage` attribute) alongside a separate `usage` summary dict, so `getattr(response, "usage")` was always None and token/cost data was dropped for every gateway turn (traces showed usage 0 / cost 0). Gate on a real `.usage` attribute so the existing usage-dict fallback is reached. Real response objects (post_llm_call / legacy) still take the response-object path. Adds regression tests for both paths. |
||
|---|---|---|
| .. | ||
| langfuse | ||
| nemo_relay | ||