Skip to content

cache_state: afk/cache-editing/thinking latches are dead-stores; 1h prompt-cache allowlist never populated #285

Description

@ericleepi314

File: src/state/cache_state.py:85-103

Per the in-code audit notes (M9):

  • fast_mode_header_latched is the only latch with a real integration (src/utils/fast_mode.py).
  • afk_mode_header_latched — dead-store; AFK toggle component not implemented.
  • cache_editing_header_latched — dead-store; no Python equivalent of TS's GrowthBook cache-editing treatment.
  • thinking_clear_latched — dead-store; src/utils/effort.py does not expose the thinking-flip-after-cache-miss event.
  • prompt_cache_1h_allowlist defaults to empty, so 1h caching is permanently dormant (only 5m caching works). Population was left to a future GrowthBook-integration WI.

Impact: Cache-telemetry headers under-report toggle activity vs the TS reference, and 1h prompt caching can never engage regardless of model/config.

Fix sketch: Wire each latch at its source event as the corresponding feature lands, and add a config-backed (non-GrowthBook) way to populate prompt_cache_1h_allowlist so 1h caching is reachable in the Python port.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions