Allow message retries for "pending" status, refactor message context handling, remove workspace import/export routes, and add SQLite-backed rate limiting.
This commit is contained in:
@@ -77,7 +77,8 @@ export function createComposerController({
|
||||
const visible = () => state.activeChatId === chatId;
|
||||
let userCard, loadingMsg, rendering, completedReply = null;
|
||||
let completedThinking = "", completedSources = null;
|
||||
const userMessage = {role: "user", content: message, attachments};
|
||||
const userMessage = {role: "user", content: message, attachments,
|
||||
...(retryMessage?.id ? {id: retryMessage.id, deliveryStatus: retryMessage.deliveryStatus, errorMessage: retryMessage.errorMessage} : {})};
|
||||
if (!retryMessage) {
|
||||
msgInput.value = "";
|
||||
state.chatDrafts.set(chatId ?? "new", "");
|
||||
@@ -135,7 +136,9 @@ export function createComposerController({
|
||||
if (loadingBody) setMessageContent(loadingBody, text);
|
||||
})
|
||||
});
|
||||
await api.stream("/chat/stream", {message, attachments: attachments.map(item => item.id), model, chatId, webSearch, reasoning}, {
|
||||
await api.stream("/chat/stream", {message, attachments: attachments.map(item => item.id), model, chatId,
|
||||
...(retryMessage?.id && ["failed", "pending"].includes(retryMessage.deliveryStatus) ? {userMessageId: retryMessage.id} : {}),
|
||||
webSearch, reasoning}, {
|
||||
...rendering,
|
||||
onStatus: ({status, sourceCount, searchState}) => {
|
||||
if (status === "accepted" || !visible() || !loadingLabel) return;
|
||||
|
||||
Reference in New Issue
Block a user