mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 17:25:07 +02:00
Merge commit '2a74817f93dea568bcbc58b3bd7ed89dc92306e3' into concedo_experimental
# Conflicts: # ci/run.sh # docs/backend/SYCL.md # ggml/src/ggml-opencl/ggml-opencl.cpp # ggml/src/ggml-opencl/kernels/mul_mm_q4_k_f32_l4_lm.cl # ggml/src/ggml-opencl/kernels/mul_mm_q5_k_f32_l4_lm.cl # ggml/src/ggml-opencl/kernels/mul_mv_q4_k_f32_flat.cl # ggml/src/ggml-opencl/kernels/mul_mv_q5_k_f32_flat.cl # ggml/src/ggml-sycl/common.hpp # ggml/src/ggml-sycl/ggml-sycl.cpp # ggml/src/ggml-webgpu/ggml-webgpu.cpp # tests/test-backend-ops.cpp # tests/test-save-load-state.cpp
This commit is contained in:
@@ -7,7 +7,12 @@
|
||||
ChatMessageSystem,
|
||||
ChatMessageUser
|
||||
} from '$lib/components/app/chat';
|
||||
import { REASONING_TAGS, ROUTES, SYSTEM_MESSAGE_PLACEHOLDER } from '$lib/constants';
|
||||
import {
|
||||
AGENTIC_TEXT_COPY_SEPARATOR,
|
||||
REASONING_TAGS,
|
||||
ROUTES,
|
||||
SYSTEM_MESSAGE_PLACEHOLDER
|
||||
} from '$lib/constants';
|
||||
import { setChatMessageActionsContext, setChatMessageEditContext } from '$lib/contexts';
|
||||
import { AgenticSectionType, AttachmentType, MessageRole } from '$lib/enums';
|
||||
import { DatabaseService } from '$lib/services/database.service';
|
||||
@@ -237,6 +242,24 @@
|
||||
}
|
||||
|
||||
function handleCopy() {
|
||||
// Agentic sessions render as a single entry anchored on the first assistant
|
||||
// turn, whose own content is typically just the first tool call. Copy the
|
||||
// text sections of the whole session so the clipboard matches the visible
|
||||
// response instead of the anchor turn.
|
||||
if (message.role === MessageRole.ASSISTANT) {
|
||||
const sections = deriveAgenticSections(message, toolMessages, [], false);
|
||||
const text = sections
|
||||
.filter((section) => section.type === AgenticSectionType.TEXT)
|
||||
.map((section) => section.content)
|
||||
.join(AGENTIC_TEXT_COPY_SEPARATOR);
|
||||
|
||||
if (text) {
|
||||
chatActions.copy(message, text);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
chatActions.copy(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
refreshAllMessages();
|
||||
},
|
||||
|
||||
copy: async (message: DatabaseMessage) => {
|
||||
copy: async (message: DatabaseMessage, contentOverride?: string) => {
|
||||
const asPlainText = Boolean(currentConfig.copyTextAttachmentsAsPlainText);
|
||||
const clipboardContent = formatMessageForClipboard(
|
||||
message.content,
|
||||
contentOverride ?? message.content,
|
||||
message.extra,
|
||||
asPlainText
|
||||
);
|
||||
|
||||
@@ -20,6 +20,10 @@ export const SEARCH_SUMMARY = {
|
||||
// wraps mid-paragraph.
|
||||
export const RESULT_STAT_SEPARATOR = ' - ';
|
||||
|
||||
// Separator between the assistant text sections of a grouped agentic
|
||||
// session when they are joined for the clipboard.
|
||||
export const AGENTIC_TEXT_COPY_SEPARATOR = '\n\n';
|
||||
|
||||
export const DEFAULT_AGENTIC_CONFIG: AgenticConfig = {
|
||||
enabled: true,
|
||||
maxTurns: 100
|
||||
|
||||
Vendored
+1
-1
@@ -249,7 +249,7 @@ export interface ChatMessageDeletionInfo {
|
||||
* refresh + user-action notification), passed to each ChatMessage as a prop.
|
||||
*/
|
||||
export interface ChatMessageActions {
|
||||
copy: (message: DatabaseMessage) => void;
|
||||
copy: (message: DatabaseMessage, contentOverride?: string) => void;
|
||||
delete: (message: DatabaseMessage) => void;
|
||||
navigateToSibling: (siblingId: string) => void;
|
||||
editWithBranching: (
|
||||
|
||||
Reference in New Issue
Block a user