| ... | ... | @@ -8874,18 +8874,7 @@ export default function ChatView(props: ChatViewProps) { |
| 8874 | 8874 | ); |
| 8875 | 8875 | const messageIdForSend = newMessageId(); |
| 8876 | 8876 | const messageCreatedAt = new Date().toISOString(); |
| 8877 | | // Sending past the resume banner compacts first so the turn does not resend the stale |
| 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"); |
| 8877 | const shouldQueueBehindActiveRun = phase === "running" && dispatchMode === "queue"; |
| 8889 | 8878 | const outgoingMessageText = formatOutgoingPrompt({ |
| 8890 | 8879 | provider: ctxSelectedProvider, |
| 8891 | 8880 | model: ctxSelectedModel, |
| ... | ... | @@ -9451,22 +9440,6 @@ export default function ChatView(props: ChatViewProps) { |
| 9451 | 9440 | failure = turnAttachmentsResult; |
| 9452 | 9441 | } |
| 9453 | 9442 | |
| 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 | 9443 | let backgroundDraftOpened = false; |
| 9471 | 9444 | let turnStartSucceeded = false; |
| 9472 | 9445 | if (failure === null && turnAttachmentsResult._tag === "Success") { |
| ... | ... | @@ -9544,7 +9517,7 @@ export default function ChatView(props: ChatViewProps) { |
| 9544 | 9517 | titleSeed: title, |
| 9545 | 9518 | runtimeMode, |
| 9546 | 9519 | interactionMode: sendInteractionMode, |
| 9547 | | dispatchMode: turnDispatchMode, |
| 9520 | dispatchMode, |
| 9548 | 9521 | ...(bootstrap ? { bootstrap } : {}), |
| 9549 | 9522 | createdAt: messageCreatedAt, |
| 9550 | 9523 | }, |