Skip to content

Commit 7392f14

Browse files
SannidhyaSahdaniel-lxsmrubens
authored
feat: add profile-specific context condensing thresholds (#4456)
Co-authored-by: Daniel Riccio <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
1 parent 37ed013 commit 7392f14

33 files changed

+629
-67
lines changed

packages/types/src/global-settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const globalSettingsSchema = z.object({
103103
customSupportPrompts: customSupportPromptsSchema.optional(),
104104
enhancementApiConfigId: z.string().optional(),
105105
historyPreviewCollapsed: z.boolean().optional(),
106+
profileThresholds: z.record(z.string(), z.number()).optional(),
106107
})
107108

108109
export type GlobalSettings = z.infer<typeof globalSettingsSchema>

src/core/condense/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { ApiMessage } from "../task-persistence/apiMessages"
88
import { maybeRemoveImageBlocks } from "../../api/transform/image-cleaning"
99

1010
export const N_MESSAGES_TO_KEEP = 3
11+
export const MIN_CONDENSE_THRESHOLD = 5 // Minimum percentage of context window to trigger condensing
12+
export const MAX_CONDENSE_THRESHOLD = 100 // Maximum percentage of context window to trigger condensing
1113

1214
const SUMMARY_PROMPT = `\
1315
Your task is to create a detailed summary of the conversation so far, paying close attention to the user's explicit requests and your previous actions.

0 commit comments

Comments
 (0)