kamonspecial
9f1c16a7fb
fix(langfuse): restore usage/cost when post_api_request sends a sanitized response
...
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.
2026-06-07 00:06:39 +09:00
..
2026-06-04 17:54:59 -07:00
2026-06-06 13:18:18 +05:30
2026-06-05 18:05:05 -07:00
2026-06-05 20:23:54 -07:00
2026-06-04 03:03:35 -07:00
2026-05-28 22:26:25 -07:00
2026-06-02 12:37:40 -04:00
2026-06-06 13:18:18 +05:30
2026-06-06 02:44:50 -07:00
2026-06-02 17:00:04 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 17:40:33 -07:00
2026-06-07 00:06:39 +09:00
2026-05-28 22:26:25 -07:00
2026-06-06 13:18:18 +05:30
2026-06-05 13:30:02 +10:00
2026-05-28 22:26:25 -07:00
2026-06-05 23:34:00 -07:00
2026-06-05 12:22:55 -05:00
2026-06-01 19:52:28 -07:00
2026-06-01 19:51:03 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-03 07:32:00 +07:00
2026-06-04 03:03:35 -07:00
2026-06-01 16:06:44 +10:00
2026-06-01 13:32:55 +10:00
2026-06-05 02:54:34 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-03 19:37:29 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 21:40:39 -07:00
2026-06-04 10:07:20 -07:00
2026-05-29 22:29:48 -07:00
2026-06-01 20:13:42 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 18:04:47 -07:00
2026-06-03 06:36:46 -07:00
2026-05-28 22:26:25 -07:00
2026-06-03 12:00:27 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 08:54:38 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-03 06:36:46 -07:00
2026-06-05 17:44:45 +00:00
2026-06-03 12:00:27 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00