Skip to content

Conversation

@Tarquinen
Copy link
Collaborator

No description provided.

- Add protectedTurns config option to protect recent tools from pruning
- Track currentTurn in session state using step-start parts
- Store turn number on each cached tool parameter entry
- Skip caching tools that are within the protected turn window
- Exclude turn-protected tools from nudge counter
Reject prune requests for IDs not found in the tool cache, which catches
both hallucinated IDs and turn-protected tools that aren't shown in the
<prunable-tools> list.
When the last tool used was prune, inject a cooldown message instead
of the full prunable-tools list. This prevents the model from
repeatedly invoking the prune tool in successive turns.

Also refactors magic strings into named constants for better
maintainability.
- Note that some tools in context may not appear in the list (expected)
- Clarify that the list is only injected when tools are available
Renames the flat protectedTurns config to a nested turnProtection
object matching the structure of nudge. Now has:
- enabled: boolean to toggle the feature
- turns: number of turns to protect tools after use
@Tarquinen Tarquinen merged commit 3d926eb into dev Dec 19, 2025
1 check passed
@Tarquinen Tarquinen deleted the feat/turn-based-tool-protection branch December 19, 2025 01:00
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