Skip to content

Commit b981a33

Browse files
committed
Add warning thresholds and new task summary feature
1 parent 27cf18c commit b981a33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1242
-267
lines changed

src/exports/roo-code.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ type ProviderSettings = {
205205
fuzzyMatchThreshold?: number | undefined
206206
modelTemperature?: (number | null) | undefined
207207
rateLimitSeconds?: number | undefined
208+
warningThreshold?:
209+
| {
210+
context?: number | undefined
211+
tokens?: number | undefined
212+
cost?: number | undefined
213+
}
214+
| undefined
208215
modelMaxTokens?: number | undefined
209216
modelMaxThinkingTokens?: number | undefined
210217
apiModelId?: string | undefined

src/exports/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ type ProviderSettings = {
207207
fuzzyMatchThreshold?: number | undefined
208208
modelTemperature?: (number | null) | undefined
209209
rateLimitSeconds?: number | undefined
210+
warningThreshold?:
211+
| {
212+
context?: number | undefined
213+
tokens?: number | undefined
214+
cost?: number | undefined
215+
}
216+
| undefined
210217
modelMaxTokens?: number | undefined
211218
modelMaxThinkingTokens?: number | undefined
212219
apiModelId?: string | undefined

src/schemas/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ type _AssertExperiments = AssertEqual<Equals<ExperimentId, Keys<Experiments>>>
334334
* ProviderSettingsEntry
335335
*/
336336

337+
export const warningThresholdSchema = z.object({
338+
context: z.number().optional(), // Context window warning threshold
339+
tokens: z.number().optional(), // Total tokens warning threshold
340+
cost: z.number().optional(), // Cost warning threshold
341+
})
342+
343+
export type WarningThreshold = z.infer<typeof warningThresholdSchema>
344+
337345
export const providerSettingsEntrySchema = z.object({
338346
id: z.string(),
339347
name: z.string(),
@@ -353,6 +361,7 @@ const baseProviderSettingsSchema = z.object({
353361
fuzzyMatchThreshold: z.number().optional(),
354362
modelTemperature: z.number().nullish(),
355363
rateLimitSeconds: z.number().optional(),
364+
warningThreshold: warningThresholdSchema.optional(),
356365
// Claude 3.7 Sonnet Thinking
357366
modelMaxTokens: z.number().optional(),
358367
modelMaxThinkingTokens: z.number().optional(),
@@ -633,6 +642,7 @@ const providerSettingsRecord: ProviderSettingsRecord = {
633642
fuzzyMatchThreshold: undefined,
634643
modelTemperature: undefined,
635644
rateLimitSeconds: undefined,
645+
warningThreshold: undefined,
636646
// Fake AI
637647
fakeAi: undefined,
638648
// X.AI (Grok)

src/shared/support-prompt.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ Please provide:
122122
NEW_TASK: {
123123
template: `\${userInput}`,
124124
},
125+
SUMMARY_AND_START_NEW_TASK: {
126+
template: `STOP CURRENT TASK AND Provide a concise summary of the current task status and progress then create a new task using new_task tool.
127+
Create a follow-up task that:
128+
- Continues from the current progress point
129+
- Maintains context from previous work
130+
- Clearly defines next objectives
131+
- Links to relevant artifacts and dependencies
132+
133+
Please include:
134+
- Key decisions and outcomes from current task
135+
- Blocking issues or dependencies
136+
- Suggested next steps
137+
- Related @-mentions and code references`,
138+
},
125139
} as const
126140

127141
type SupportPromptType = keyof typeof supportPromptConfigs

0 commit comments

Comments
 (0)