eca icon indicating copy to clipboard operation
eca copied to clipboard

Preserve prompt caching by propagating static instruction changes as incremental messages

Open zikajk opened this issue 4 months ago • 2 comments

Detect changes to session-scoped instructions such as AGENTS.md, skills, and rules.
Keep the original system/developer instruction prefix unchanged to preserve provider prompt-cache hits.
Represent updates and removals as explicit incremental user (developer) messages that supersede previous versions.
Ensure subsequent turns use the latest instruction state without rebuilding the existing conversation context.

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

zikajk avatar Jul 13 '26 14:07 zikajk

A possible approach when system/developer in-chat instructions can't be used: plan_mode_in_qwen_harness.md

zikajk avatar Jul 20 '26 14:07 zikajk

I believe we can achieve that simply supporting develoepr messages when the API supports that (anthropic, openai-responses, bedrock?), we would just need to make sure we don't change system prompt for when this happen + include a new UI in each client to represent the developer message, a different color maybe or similar to system messages color.

ericdallo avatar Jul 20 '26 15:07 ericdallo