hermes-agent/agent
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
..
lsp
pet
secret_sources
transports fix(usage): read DeepSeek's native prompt_cache_hit_tokens cache field (#65678) 2026-07-16 07:29:53 -07:00
__init__.py
account_usage.py
agent_init.py feat: add LM Studio JIT load mode 2026-07-16 15:23:14 +05:30
agent_runtime_helpers.py chore(agent): tripwire — warn when a turn starts before the previous turn's persist 2026-07-16 04:56:10 -07:00
anthropic_adapter.py fix(auxiliary): apply review fixes to #36043 — guard named-custom routing, drop dead key assignment, tighten Palantir host match 2026-07-16 07:28:07 -07:00
async_utils.py
aux_accounting.py feat(analytics): record auxiliary model usage per task in session accounting (#65537) 2026-07-16 04:23:12 -07:00
auxiliary_client.py fix(auxiliary): apply review fixes to #36043 — guard named-custom routing, drop dead key assignment, tighten Palantir host match 2026-07-16 07:28:07 -07:00
azure_identity_adapter.py
background_review.py
bedrock_adapter.py fix(bedrock): streaming fallback to Converse API + image base64 decode + bearer token routing 2026-07-15 09:59:38 -07:00
billing_view.py
bounded_response.py
browser_provider.py
browser_registry.py
chat_completion_helpers.py
codex_responses_adapter.py fix(agent): treat Codex incomplete content filter as refusal 2026-07-15 09:47:37 -07:00
codex_runtime.py
coding_context.py
context_breakdown.py
context_compressor.py fix(context): harden compression failure feedback 2026-07-16 14:34:03 +05:30
context_engine.py
context_references.py
conversation_compression.py
conversation_loop.py fix(bedrock): streaming fallback to Converse API + image base64 decode + bearer token routing 2026-07-15 09:59:38 -07:00
copilot_acp_client.py
credential_persistence.py
credential_pool.py fix(auth): preserve fallback routes and OAuth state 2026-07-16 06:14:56 -07:00
credential_sources.py
credits_tracker.py
curator.py
curator_backup.py
display.py
error_classifier.py fix(plugins): classify stale-call circuit breaker as failover, not retry 2026-07-16 00:27:39 +05:30
errors.py
file_safety.py
gemini_native_adapter.py
gemini_schema.py
i18n.py
image_gen_provider.py
image_gen_registry.py
image_routing.py
insights.py fix(insights): include auxiliary usage in overview token totals (#65603) 2026-07-16 05:39:33 -07:00
iteration_budget.py
jiter_preload.py
kanban_stop.py
learn_prompt.py
learning_graph.py
learning_graph_render.py
learning_mutations.py
lmstudio_reasoning.py
manual_compression_feedback.py fix(context): harden compression failure feedback 2026-07-16 14:34:03 +05:30
markdown_tables.py
memory_manager.py
memory_provider.py
message_content.py
message_sanitization.py
moa_loop.py feat(portal): ambient conversation context entangles aux/MoA/delegate calls 2026-07-16 01:13:43 -07:00
moa_trace.py
model_metadata.py
models_dev.py
moonshot_schema.py
nous_rate_guard.py
onboarding.py
oneshot.py
plugin_llm.py
portal_tags.py feat(portal): ambient conversation context entangles aux/MoA/delegate calls 2026-07-16 01:13:43 -07:00
process_bootstrap.py
prompt_builder.py fix(agent): scope install-tree guard to fallback-picked cwds, allow cli/tui in-tree dev 2026-07-16 04:32:23 -07:00
prompt_caching.py
rate_limit_tracker.py
reactions.py
reasoning_timeouts.py
redact.py
replay_cleanup.py
retry_utils.py
runtime_cwd.py fix(agent): scope install-tree guard to fallback-picked cwds, allow cli/tui in-tree dev 2026-07-16 04:32:23 -07:00
secret_scope.py
shell_hooks.py
skill_bundles.py
skill_commands.py
skill_preprocessing.py
skill_utils.py
ssl_guard.py
ssl_verify.py
stream_diag.py
subdirectory_hints.py
system_prompt.py fix(agent): scope install-tree guard to fallback-picked cwds, allow cli/tui in-tree dev 2026-07-16 04:32:23 -07:00
think_scrubber.py fix(agent): re-arm think scrubber boundary after stream flush 2026-07-16 01:07:29 +05:30
thinking_timeout_guidance.py
thread_scoped_output.py
title_generator.py feat(analytics): record auxiliary model usage per task in session accounting (#65537) 2026-07-16 04:23:12 -07:00
tool_dispatch_helpers.py fix(agent): canonicalise paths in parallel-batch planner to prevent same-file concurrent mutation 2026-07-16 04:26:32 -07:00
tool_executor.py fix(agent): canonicalise paths in parallel-batch planner to prevent same-file concurrent mutation 2026-07-16 04:26:32 -07:00
tool_guardrails.py
tool_result_classification.py
trace_upload.py
trajectory.py
transcription_provider.py
transcription_registry.py
tts_provider.py
tts_registry.py
turn_context.py chore(agent): tripwire — warn when a turn starts before the previous turn's persist 2026-07-16 04:56:10 -07:00
turn_finalizer.py
turn_retry_state.py
usage_pricing.py fix(usage): read DeepSeek's native prompt_cache_hit_tokens cache field (#65678) 2026-07-16 07:29:53 -07:00
verification_evidence.py
verification_stop.py
verify_hooks.py
vertex_adapter.py
video_gen_provider.py
video_gen_registry.py
web_search_provider.py
web_search_registry.py