Skip to content

revert: back out prompt_caching.enabled toggle (#56105) for re-evaluation - #56126

Merged
teknium1 merged 2 commits into
mainfrom
revert/prompt-caching-enabled-56105
Jul 1, 2026
Merged

revert: back out prompt_caching.enabled toggle (#56105) for re-evaluation#56126
teknium1 merged 2 commits into
mainfrom
revert/prompt-caching-enabled-56105

Conversation

@teknium1

@teknium1 teknium1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Reverts #56105 (both commits: c1c1a12fe "allow disabling prompt caching" + 36f9f5014 "honor prompt_caching.enabled across model switch + fallback"). Backing the prompt_caching.enabled toggle out of main so it can be properly evaluated before shipping.

Why

The toggle added a load_config()-driven gate inside anthropic_prompt_cache_policy — the function that decides whether Anthropic-style cache_control markers are emitted. Prompt caching is cost-critical for every Claude user (native Anthropic AND OpenRouter Claude), so any change to that decision path carries broad blast radius and needs a careful review pass before it lands.

State after revert

main is back to the pre-#56105 behavior:

  • prompt_caching config default is cache_ttl-only (no enabled key).
  • anthropic_prompt_cache_policy has no config gate — markers are emitted per the existing per-endpoint policy, unchanged.

Validation

path after revert
OpenRouter Claude (True, False) — markers ON
Native Anthropic (True, True) — markers ON

Verified via direct policy call with real imports. Caching markers are emitted exactly as before #56105 on both paths.

Original issue #13477 (LiteLLM proxy cache_control overload) remains open for a properly-reviewed fix.

Infographic

revert prompt caching toggle

@teknium1
teknium1 merged commit 8d78be5 into main Jul 1, 2026
18 checks passed
@teknium1
teknium1 deleted the revert/prompt-caching-enabled-56105 branch July 1, 2026 07:20
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades P2 Medium — degraded but workaround exists labels Jul 1, 2026
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…or re-evaluation (NousResearch#56126)

* Revert "fix(caching): honor prompt_caching.enabled across model switch + fallback"

This reverts commit 1f86e39.

* Revert "fix: allow disabling prompt caching"

This reverts commit 7e81b23.
Jasper6439 pushed a commit to Jasper6439/hermes-agent that referenced this pull request Jul 5, 2026
…or re-evaluation (NousResearch#56126)

* Revert "fix(caching): honor prompt_caching.enabled across model switch + fallback"

This reverts commit 36f9f50.

* Revert "fix: allow disabling prompt caching"

This reverts commit c1c1a12.
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
…or re-evaluation (NousResearch#56126)

* Revert "fix(caching): honor prompt_caching.enabled across model switch + fallback"

This reverts commit 969477b.

* Revert "fix: allow disabling prompt caching"

This reverts commit 58d8548.
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…or re-evaluation (NousResearch#56126)

* Revert "fix(caching): honor prompt_caching.enabled across model switch + fallback"

This reverts commit c5b2feb.

* Revert "fix: allow disabling prompt caching"

This reverts commit 64a756d.
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…or re-evaluation (NousResearch#56126)

* Revert "fix(caching): honor prompt_caching.enabled across model switch + fallback"

This reverts commit 36f9f50.

* Revert "fix: allow disabling prompt caching"

This reverts commit c1c1a12.
kshitijk4poor pushed a commit to kshitijk4poor/hermes-agent that referenced this pull request Aug 1, 2026
Setting prompt_caching.cache_ttl to a falsy value (false, null, off,
disabled, no, none) now fully disables prompt caching instead of
being silently ignored.

The disable propagates through anthropic_prompt_cache_policy() (early
return when _cache_disabled flag is set) and restore_primary_runtime()
(override after snapshot restore), so it survives /model switches and
fallback re-derivation — the gap that caused NousResearch#56105 to be reverted in
NousResearch#56126.

Salvage of NousResearch#33555 by @BB-light, with model-switch/fallback survival
gap fixed on top.

Co-authored-by: BB-light <BB-light@users.noreply.github.com>
kshitijk4poor pushed a commit that referenced this pull request Aug 1, 2026
Setting prompt_caching.cache_ttl to a falsy value (false, null, off,
disabled, no, none) now fully disables prompt caching instead of
being silently ignored.

The disable propagates through anthropic_prompt_cache_policy() (early
return when _cache_disabled flag is set) and restore_primary_runtime()
(override after snapshot restore), so it survives /model switches and
fallback re-derivation — the gap that caused #56105 to be reverted in
#56126.

Salvage of #33555 by @BB-light, with model-switch/fallback survival
gap fixed on top.

Co-authored-by: BB-light <BB-light@users.noreply.github.com>
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…or re-evaluation (NousResearch#56126)

* Revert "fix(caching): honor prompt_caching.enabled across model switch + fallback"

This reverts commit 36f9f50.

* Revert "fix: allow disabling prompt caching"

This reverts commit c1c1a12.
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Setting prompt_caching.cache_ttl to a falsy value (false, null, off,
disabled, no, none) now fully disables prompt caching instead of
being silently ignored.

The disable propagates through anthropic_prompt_cache_policy() (early
return when _cache_disabled flag is set) and restore_primary_runtime()
(override after snapshot restore), so it survives /model switches and
fallback re-derivation — the gap that caused NousResearch#56105 to be reverted in
NousResearch#56126.

Salvage of NousResearch#33555 by @BB-light, with model-switch/fallback survival
gap fixed on top.

Co-authored-by: BB-light <BB-light@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants