Skip to main content

Module sticky_tools

Module sticky_tools 

Source
Expand description

Sticky CCR tool injection for provider prefix-cache stability.

Once a conversation has seen at least one CCR handle, the ctx_expand tool definition stays in tools[] for the remainder of the session, even on turns with no active markers. This prevents the tool-list change from busting the provider prompt-cache prefix.

That injection is the developer-mode path only. Under protection the proxy declares nothing: a declaration it adds is no evidence that the host can execute the call. There a recovery stub is issued only per block, for a tool result whose very call is on record in this proxy’s store as answered by an Engine of this store, and it names the expand tool the host listed under the same prefix as the tool that produced the block (expand_tool_for). Nothing marks a conversation under protection: the mark is read by the injection only.

Functions§

ensure_tool_present
Ensure ctx_expand is present in the tools array when CCR is active. Returns true if the tool was injected.
is_ccr_active
Returns true if this conversation has ever used CCR.
mark_ccr_active
Mark a conversation as having used CCR.