Skip to content

Split Cache Read/Write Configuration #6

Description

@ccjoel

Problem

Currently, the LLM cache uses a single COSCIENTIST_CACHE_ENABLED flag that controls both reading from and writing to the cache. This creates limitations for certain development and testing workflows.

Current behavior:

  • COSCIENTIST_CACHE_ENABLED=true → reads from cache AND writes to cache
  • COSCIENTIST_CACHE_ENABLED=false → no reads, no writes

Unsupported Use Cases

  1. Write-only mode (populate cache without using it)
  • Testing with a new model/prompt and want fresh responses
  • Populating cache for future runs without using stale cached data
  • Debugging to force fresh LLM calls while still building cache2.

Read-only mode (use cache but don't update it)

  • Using existing cache but preventing accidental overwrites
  • Testing cache behavior without modifying it

Proposed Solution

Split the cache configuration. Use single variable with explicit modes

**COSCIENTIST_CACHE_MODE=read_write # Options: read_write, read_only, write_only, disabled

Implementation Details

The changes would need to be made in:
src/open_coscientist/cache.py - LLMCache class get() and set() methods, get_cache()
src/open_coscientist/llm.py - All cache.get() and cache.set() calls

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions