Skip to content

Commit 1eaaf51

Browse files
changed nudgeGap to make it do what I wanted in the first place
1 parent bb825a5 commit 1eaaf51

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

lib/messages/inject.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ export const insertCompressToolContext = (
199199
}
200200

201201
if (shouldInjectLimitNudge(config, state, messages, providerId, modelId)) {
202-
state.limitNudgeCounter++
203-
if (state.limitNudgeCounter >= config.tools.settings.limitNudgeInterval) {
202+
if (state.limitNudgeCounter === 0) {
204203
logger.info("Injecting context-limit nudge")
205204
contentParts.push(renderNudge("context-limit"))
206-
state.limitNudgeCounter = 0
207205
}
206+
state.limitNudgeCounter =
207+
(state.limitNudgeCounter + 1) % config.tools.settings.limitNudgeInterval
208208
}
209209

210210
if (

lib/state/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,5 @@ export function resetOnCompaction(state: SessionState): void {
5151
state.prune.messages = new Map<string, number>()
5252
state.compressSummaries = []
5353
state.nudgeCounter = 0
54-
state.limitNudgeCounter = 0
5554
state.lastToolPrune = false
5655
}

0 commit comments

Comments
 (0)