Skip to content

Stable prompt caching - Performance and cost improvements - #355

Open
TimeJunkie wants to merge 2 commits into
SimonSchubert:mainfrom
TimeJunkie:stable_prompt_caching
Open

Stable prompt caching - Performance and cost improvements#355
TimeJunkie wants to merge 2 commits into
SimonSchubert:mainfrom
TimeJunkie:stable_prompt_caching

Conversation

@TimeJunkie

Copy link
Copy Markdown
  • Moves the current date/time out of the system prompt's ## Context section (which busted the prompt cache on every request) and prepends it to the latest user message instead. ## Context now only carries the stable IANA timezone.
  • Adds Anthropic ephemeral cache_control on the system prompt block and a cache breakpoint on the penultimate user turn, so accumulated conversation history is reused across requests.
  • Bumps the default request timeout for OpenAI-compatible services (local llama.cpp/Ollama/LM Studio backends) from 60s to 120s — long local-context generations without token streaming were frequently timing out and retriggering a duplicate request.
  • Updates schedule_task's tool description/error copy and the two affected feature docs (system-prompts.md, tasks.md) to match. They previously pointed the AI at a "Local time" context line that this change removes.

@TimeJunkie

Copy link
Copy Markdown
Author

This is directly related to same issues some others recently reported: #349

…er message turns so the main system prompt becomes stable. Added ephemeral caching support for anthropic.

increased the default timeout only for openai compatible servive to 120s instead of default 60s. For users running a local llm server, 60s is right on cusp of quite often being insufficient causing the request to be sent again and thus causing a request and reprocess loop potentially that fails to ever process.
Between the more stable prompt and this slight timeout bump should make for a much more speedier and cheaper experience for cloud api usage as well.
… user message location and documentation updated to reflect the change as well.
@TimeJunkie
TimeJunkie force-pushed the stable_prompt_caching branch from 9cbbd4e to 09720ab Compare July 9, 2026 02:10
@camdencarr84-jpg

Copy link
Copy Markdown

You need to make context APPEND ONLY this is a good idea.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants