Skip to content

Commit 1ec47c3

Browse files
committed
fixes
1 parent 9a40cde commit 1ec47c3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/core/condense/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ export async function summarizeConversation(
9797
const response: SummarizeResponse = { messages, cost: 0, summary: "" }
9898
const messagesToSummarize = getMessagesSinceLastSummary(messages.slice(0, -N_MESSAGES_TO_KEEP))
9999
if (messagesToSummarize.length <= 1) {
100-
const error = t("common:errors.condense_not_enough_messages")
100+
const error =
101+
messages.length <= N_MESSAGES_TO_KEEP + 1
102+
? t("common:errors.condense_not_enough_messages")
103+
: t("common:errors.condensed_recently")
101104
return { ...response, error }
102105
}
103106
const keepMessages = messages.slice(-N_MESSAGES_TO_KEEP)

webview-ui/src/components/chat/ContextCondenseRow.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ export const CondensingContextRow = () => {
6363
export const CondenseContextErrorRow = ({ errorText }: { errorText?: string }) => {
6464
const { t } = useTranslation()
6565
return (
66-
<div className="flex items-center gap-2">
67-
<span className="text-sm text-vscode-editorWarning-foreground opacity-80 mb-[0.125rem]"></span>
68-
<span className="font-bold text-vscode-foreground">{t("common:contextCondense.errorHeader")}</span>
66+
<div className="flex flex-col gap-1">
67+
<div className="flex items-center gap-2">
68+
<span className="codicon codicon-warning text-vscode-editorWarning-foreground opacity-80 text-base -mb-0.5"></span>
69+
<span className="font-bold text-vscode-foreground">{t("chat:contextCondense.errorHeader")}</span>
70+
</div>
6971
<span className="text-vscode-descriptionForeground text-sm">{errorText}</span>
7072
</div>
7173
)

webview-ui/src/i18n/locales/en/chat.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
"contextCondense": {
134134
"title": "Context Condensed",
135135
"condensing": "Condensing context...",
136+
"errorHeader": "Failed to condense context",
136137
"tokens": "tokens"
137138
},
138139
"instructions": {

0 commit comments

Comments
 (0)