The best way to control Claude Code, Codex and more from any computer or phone
fix(web): sending past the resume banner compacts first (#15290)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
maria committed
Oct 3, 2026 at 20:47 UTC
a976f8c74ca4eab6e16bb47b5fa446154b743371
1 file changed
+29
-2
apps/web/src/components/ChatView.tsx
+29
-2
@@ -8733,7 +8733,18 @@ export default function ChatView(props: ChatViewProps) {
8733
);
8734
const messageIdForSend = newMessageId();
8735
const messageCreatedAt = new Date().toISOString();
8736
- const shouldQueueBehindActiveRun = phase === "running" && dispatchMode === "queue";
8736
+ // Sending past the resume banner compacts first so the turn does not resend the stale
8737
+ // history. The message queues behind the /compact run; steering into it is rejected,
8738
+ // and a held queue would strand it.
8739
+ const compactBeforeSend =
8740
+ resumeCompactionBannerItem !== null &&
8741
+ !compactDisabled &&
8742
+ !hasHeldQueuedRuns &&
8743
+ multipleModelSelections === null &&
8744
+ messageTextForSend.toLowerCase() !== "/compact";
8745
+ const turnDispatchMode = compactBeforeSend ? "queue" : dispatchMode;
8746
+ const shouldQueueBehindActiveRun =
8747
+ compactBeforeSend || (phase === "running" && dispatchMode === "queue");
8748
const outgoingMessageText = formatOutgoingPrompt({
8749
provider: ctxSelectedProvider,
8750
model: ctxSelectedModel,
@@ -9299,6 +9310,22 @@ export default function ChatView(props: ChatViewProps) {
9310
failure = turnAttachmentsResult;
9311
}
9312
9313
+ if (failure === null && compactBeforeSend) {
9314
+ const compactResult = await startThreadTurn({
9315
+ environmentId,
9316
+ input: {
9317
+ threadId: threadIdForSend,
9318
+ message: { messageId: newMessageId(), role: "user", text: "/compact", attachments: [] },
9319
+ modelSelection: ctxSelectedModelSelection,
9320
+ runtimeMode,
9321
+ interactionMode: sendInteractionMode,
9322
+ },
9323
+ });
9324
+ if (compactResult._tag === "Failure") {
9325
+ failure = compactResult;
9326
+ }
9327
+ }
9328
+
9329
let backgroundDraftOpened = false;
9330
let turnStartSucceeded = false;
9331
if (failure === null && turnAttachmentsResult._tag === "Success") {
@@ -9376,7 +9403,7 @@ export default function ChatView(props: ChatViewProps) {
9403
titleSeed: title,
9404
runtimeMode,
9405
interactionMode: sendInteractionMode,
9379
- dispatchMode,
9406
+ dispatchMode: turnDispatchMode,
9407
...(bootstrap ? { bootstrap } : {}),
9408
createdAt: messageCreatedAt,
9409
},