We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b91b5d9 commit 31f2a6aCopy full SHA for 31f2a6a
backend/src/util/messages.ts
@@ -367,16 +367,7 @@ export function getCoreMessagesSubset(
367
otherTokens: number,
368
includeCacheControl: boolean = true
369
): CodebuffMessage[] {
370
- const indexLastSubgoalComplete = messages.findLastIndex(({ content }) => {
371
- JSON.stringify(content).includes('COMPLETE')
372
- })
373
-
374
- const messagesSubset = trimCoreMessagesToFitTokenLimit(
375
- indexLastSubgoalComplete === -1
376
- ? messages
377
- : messages.slice(indexLastSubgoalComplete),
378
- otherTokens
379
- )
+ const messagesSubset = trimCoreMessagesToFitTokenLimit(messages, otherTokens)
380
381
// Remove cache_control from all messages
382
for (const message of messagesSubset) {
0 commit comments