diff --git a/src/lib/components/chat/ChatTabs/Browser.svelte b/src/lib/components/chat/ChatTabs/Browser.svelte index e926fed6c5..afa17fa306 100644 --- a/src/lib/components/chat/ChatTabs/Browser.svelte +++ b/src/lib/components/chat/ChatTabs/Browser.svelte @@ -407,7 +407,7 @@ >{/if} {#if error} - + {:else if connectionStatus}

{$i18n.t(connectionStatus)} diff --git a/src/lib/components/chat/ChatTabs/GitBar.svelte b/src/lib/components/chat/ChatTabs/GitBar.svelte index cfdf607763..d9312b7769 100644 --- a/src/lib/components/chat/ChatTabs/GitBar.svelte +++ b/src/lib/components/chat/ChatTabs/GitBar.svelte @@ -593,7 +593,7 @@ >{/if} {#if additions || deletions}+{additions}-{deletions}-{deletions}{/if} @@ -621,7 +621,7 @@ on:click={toggle}> - {#if error}

diff --git a/src/lib/components/chat/ChatTabs/GitDiff.svelte b/src/lib/components/chat/ChatTabs/GitDiff.svelte index 0363b07a6f..630210b544 100644 --- a/src/lib/components/chat/ChatTabs/GitDiff.svelte +++ b/src/lib/components/chat/ChatTabs/GitDiff.svelte @@ -135,13 +135,13 @@ } .removed { background-color: var(--color-red-100); - color: var(--color-red-900); + color: var(--color-gray-600); } .added .prefix { color: var(--color-green-600); } .removed .prefix { - color: var(--color-red-500); + color: var(--color-gray-500); } .git-diff:not(.split) .added { box-shadow: inset 0.1875rem 0 0 #22c55e; @@ -196,12 +196,12 @@ } :global(.dark) .removed { background-color: #ef444426; - color: var(--color-red-300); + color: var(--color-gray-400); } :global(.dark) .added .prefix { color: var(--color-green-400); } :global(.dark) .removed .prefix { - color: var(--color-red-400); + color: var(--color-gray-400); } diff --git a/src/lib/components/chat/ChatTabs/GitPullRequests.svelte b/src/lib/components/chat/ChatTabs/GitPullRequests.svelte index 001967f6f8..4629d6a9aa 100644 --- a/src/lib/components/chat/ChatTabs/GitPullRequests.svelte +++ b/src/lib/components/chat/ChatTabs/GitPullRequests.svelte @@ -203,7 +203,7 @@ {#if error && !selected && !creating && !editing}{/if} @@ -281,7 +281,7 @@ {/if} - {#if error}{/if} + {#if error}{/if} {#if creating || editing}
{$i18n.t(method[0].toUpperCase() + method.slice(1))}{/each} diff --git a/src/lib/components/chat/ChatTabs/SideChat.svelte b/src/lib/components/chat/ChatTabs/SideChat.svelte index ccc53e32e7..491ed670fa 100644 --- a/src/lib/components/chat/ChatTabs/SideChat.svelte +++ b/src/lib/components/chat/ChatTabs/SideChat.svelte @@ -47,9 +47,11 @@ } while (branch.at(-1)?.role === 'assistant' && !branch.at(-1)?.done) branch.pop(); return structuredClone( - branch.map(({ role, content, output, files }) => ({ + branch.map(({ id, role, content, output, files, contextSummary }) => ({ + id, role, files, + contextSummary, ...(output?.length && role === 'assistant' ? { output } : { content: content ?? '' }) })) ); @@ -113,6 +115,13 @@ const receive = (event: any, callback?: (value: any) => void) => { if (!id || event.chat_id !== id) return; const { type, data } = event.data ?? {}; + if (type === 'context_compaction') { + const checkpoint = [...context, ...messages].find( + (message) => message.id === data.checkpoint_message_id + ); + if (checkpoint && data.context_summary) checkpoint.contextSummary = data.context_summary; + return; + } if (type === 'request:interaction:done') { interactions = interactions.filter((item) => item.id !== data.interaction_id); return; @@ -240,12 +249,19 @@ if (messages.length) messages.at(-1).childrenIds.push(userMessage.id); const conversation = [...context, ...messages, userMessage].map((message) => { if (message.role === 'assistant' && message.output?.length) - return { role: message.role, output: message.output }; + return { + id: message.id, + role: message.role, + output: message.output, + contextSummary: message.contextSummary + }; const images = (message.files ?? []).filter( (file: any) => file.type === 'image' || isRasterImageContentType(file.content_type) ); return { + id: message.id, role: message.role, + contextSummary: message.contextSummary, content: images.length ? [ { type: 'text', text: message.content ?? '' }, @@ -274,6 +290,7 @@ chat_id: id, session_id: $socket.id, id: answer.id, + user_message: userMessage, params: { ...params, tool_approval_mode: toolApprovalMode }, files: requestFiles, tool_ids: selectedToolIds.filter((id) => !id.startsWith('direct_server:')), @@ -421,7 +438,7 @@ {/if}
- {#if error}{/if} + {#if error}{/if} {#if sideChatAllowed} {/each}{/if}
- {#if error}{/if} + {#if error}{/if}
{fullPath}
{:else if error} - +