Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 2 additions & 29 deletions apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8903,18 +8903,7 @@ export default function ChatView(props: ChatViewProps) {
);
const messageIdForSend = newMessageId();
const messageCreatedAt = new Date().toISOString();
// Sending past the resume banner compacts first so the turn does not resend the stale
// history. The message queues behind the /compact run; steering into it is rejected,
// and a held queue would strand it.
const compactBeforeSend =
resumeCompactionBannerItem !== null &&
!compactDisabled &&
!hasHeldQueuedRuns &&
multipleModelSelections === null &&
messageTextForSend.toLowerCase() !== "/compact";
const turnDispatchMode = compactBeforeSend ? "queue" : dispatchMode;
const shouldQueueBehindActiveRun =
compactBeforeSend || (phase === "running" && dispatchMode === "queue");
const shouldQueueBehindActiveRun = phase === "running" && dispatchMode === "queue";
const outgoingMessageText = formatOutgoingPrompt({
provider: ctxSelectedProvider,
model: ctxSelectedModel,
Expand Down Expand Up @@ -9483,22 +9472,6 @@ export default function ChatView(props: ChatViewProps) {
failure = turnAttachmentsResult;
}

if (failure === null && compactBeforeSend) {
const compactResult = await startThreadTurn({
environmentId,
input: {
threadId: threadIdForSend,
message: { messageId: newMessageId(), role: "user", text: "/compact", attachments: [] },
modelSelection: ctxSelectedModelSelection,
runtimeMode,
interactionMode: sendInteractionMode,
},
});
if (compactResult._tag === "Failure") {
failure = compactResult;
}
}

let backgroundDraftOpened = false;
let turnStartSucceeded = false;
if (failure === null && turnAttachmentsResult._tag === "Success") {
Expand Down Expand Up @@ -9579,7 +9552,7 @@ export default function ChatView(props: ChatViewProps) {
titleSeed: title,
runtimeMode,
interactionMode: sendInteractionMode,
dispatchMode: turnDispatchMode,
dispatchMode,
...(bootstrap ? { bootstrap } : {}),
createdAt: messageCreatedAt,
},
Expand Down
Loading