hermes-agent/tests/agent/transports
Teknium 03c0b00f45
fix(usage): read DeepSeek's native prompt_cache_hit_tokens cache field (#65678)
DeepSeek's own API (api.deepseek.com) reports context-cache hits as
top-level usage.prompt_cache_hit_tokens / prompt_cache_miss_tokens
(prompt_tokens = hit + miss), not the OpenAI nested
prompt_tokens_details.cached_tokens shape. Neither normalize_usage()
nor the chat_completions transport's extract_cache_stats() read those
fields, so direct DeepSeek sessions always showed 0 cache-hit tokens:
invisible in accounting, mis-billed at the full input rate, and 0%
cache display.

Both layers now fall back to prompt_cache_hit_tokens when the nested
shape is absent; the nested value wins when both are present (proxies).

Fixes #61871.
2026-07-16 07:29:53 -07:00
..
__init__.py
…
test_bedrock_transport.py
…
test_chat_completions.py fix(usage): read DeepSeek's native prompt_cache_hit_tokens cache field (#65678) 2026-07-16 07:29:53 -07:00
test_codex_app_server_runtime.py
…
test_codex_app_server_session.py
…
test_codex_event_projector.py
…
test_codex_transport.py fix(agent): treat Codex incomplete content filter as refusal 2026-07-15 09:47:37 -07:00
test_hermes_tools_mcp_server.py
…
test_transport.py
…
test_types.py
…