mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-16 19:36:54 +00:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
OpenRouter (_generate_via_chat, _generate_via_image_api) and OpenAI gpt-image called record_token_usage only after image extraction and save succeeded. A token-billed 200 that returned text but no image (the "returned no image" fallback case), an empty `data` list, or a failed save therefore consumed billed tokens that never reached session_model_usage; on the fallback chain only the fallback model's tokens were recorded. Move the call to immediately after a successful post_json / SDK call, before extraction/save, in all three paths. One call per HTTP success, so no double count; failure responses (non-2xx, timeouts) still record nothing because there is no body to read usage from. Tests: the parametrized invariant in test_openrouter_compat_provider gains the no-image-with-usage case for both surfaces (result is `empty_response`, one row still recorded); the OpenAI test is parametrized on has_image the same way. |
||
| .. | ||
| __init__.py | ||
| plugin.yaml | ||