feat(agentic): stabilize prompt cache reuse across skill and subagent updates#985
Merged
Conversation
…fix cache - snapshot turn-level skill and subagent listings to preserve the first-turn prompt baseline - inject incremental skill and agent listing updates into user input instead of rebuilding cached prefixes - persist and recover skill-agent snapshots across restore and rollback flows to keep prompt state consistent
- replace prompt-envelope reminder wrapping with explicit prepended reminder messages across coordinator, scheduler, goal mode, cron, /btw, init_agents_md, and session_message flows - add InternalReminderKind metadata and constructors so reminder messages can be classified, persisted, and filtered consistently, including fork-subagent and goal-continuation paths - persist a listing-baseline rebuild cutoff in session metadata and lazily strip stale skill/agent listing diff reminders when restoring or rolling back older context snapshots - teach fallback compression to drop transient reminder kinds and update related tests after removing legacy envelope-based expectations
…prompt cache reuse - document session-level prompt cache reuse strategy and persistence - document reuse across branching, /btw, fork_context, mode switching, and compression - clarify current per-turn tool-manifest cache-miss gap and a possible future direction - make hidden /btw child sessions clone the parent prompt cache on creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves agentic prompt-cache stability when skills, subagents, reminders, and session flows change at runtime.
What changed
/btwchild sessions inherit the parent prompt cache on creation<user_query>tagsWhy
Previously, dynamic skill/subagent changes or reminder rebuilding could invalidate cached prompt prefixes or create noisy diff/update behavior. This PR makes runtime updates more incremental and keeps prompt-cache state consistent across branching,
/btw, mode switching, restore/rollback, and compression paths.