authorgravatar for maria@kuuro.netmaria <maria@kuuro.net> 2026-10-04 18:38:32-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-04 21:38:32+00:00
log2188bdd8b5c0251f40daebdb66647dd0150cf076
treee8ee228704c6e1b4b6f70da7082b6831a459d3de
parentb4381985db55755ff15340d118160c14006ced13
signature Signed by PGP key B5690EEEBB952194

revert(web): remove automatic compaction before resume (#15771)


1 files changed, 2 insertions(+), 29 deletions(-)

apps/web/src/components/ChatView.tsx+2-29
...@@ -8874,18 +8874,7 @@ export default function ChatView(props: ChatViewProps) {...@@ -8874,18 +8874,7 @@ export default function ChatView(props: ChatViewProps) {
8874 );8874 );
8875 const messageIdForSend = newMessageId();8875 const messageIdForSend = newMessageId();
8876 const messageCreatedAt = new Date().toISOString();8876 const messageCreatedAt = new Date().toISOString();
8877 // Sending past the resume banner compacts first so the turn does not resend the stale8877 const shouldQueueBehindActiveRun = phase === "running" && dispatchMode === "queue";
8878 // history. The message queues behind the /compact run; steering into it is rejected,
8879 // and a held queue would strand it.
8880 const compactBeforeSend =
8881 resumeCompactionBannerItem !== null &&
8882 !compactDisabled &&
8883 !hasHeldQueuedRuns &&
8884 multipleModelSelections === null &&
8885 messageTextForSend.toLowerCase() !== "/compact";
8886 const turnDispatchMode = compactBeforeSend ? "queue" : dispatchMode;
8887 const shouldQueueBehindActiveRun =
8888 compactBeforeSend || (phase === "running" && dispatchMode === "queue");
8889 const outgoingMessageText = formatOutgoingPrompt({8878 const outgoingMessageText = formatOutgoingPrompt({
8890 provider: ctxSelectedProvider,8879 provider: ctxSelectedProvider,
8891 model: ctxSelectedModel,8880 model: ctxSelectedModel,
...@@ -9451,22 +9440,6 @@ export default function ChatView(props: ChatViewProps) {...@@ -9451,22 +9440,6 @@ export default function ChatView(props: ChatViewProps) {
9451 failure = turnAttachmentsResult;9440 failure = turnAttachmentsResult;
9452 }9441 }
94539442
9454 if (failure === null && compactBeforeSend) {
9455 const compactResult = await startThreadTurn({
9456 environmentId,
9457 input: {
9458 threadId: threadIdForSend,
9459 message: { messageId: newMessageId(), role: "user", text: "/compact", attachments: [] },
9460 modelSelection: ctxSelectedModelSelection,
9461 runtimeMode,
9462 interactionMode: sendInteractionMode,
9463 },
9464 });
9465 if (compactResult._tag === "Failure") {
9466 failure = compactResult;
9467 }
9468 }
9469
9470 let backgroundDraftOpened = false;9443 let backgroundDraftOpened = false;
9471 let turnStartSucceeded = false;9444 let turnStartSucceeded = false;
9472 if (failure === null && turnAttachmentsResult._tag === "Success") {9445 if (failure === null && turnAttachmentsResult._tag === "Success") {
...@@ -9544,7 +9517,7 @@ export default function ChatView(props: ChatViewProps) {...@@ -9544,7 +9517,7 @@ export default function ChatView(props: ChatViewProps) {
9544 titleSeed: title,9517 titleSeed: title,
9545 runtimeMode,9518 runtimeMode,
9546 interactionMode: sendInteractionMode,9519 interactionMode: sendInteractionMode,
9547 dispatchMode: turnDispatchMode,9520 dispatchMode,
9548 ...(bootstrap ? { bootstrap } : {}),9521 ...(bootstrap ? { bootstrap } : {}),
9549 createdAt: messageCreatedAt,9522 createdAt: messageCreatedAt,
9550 },9523 },