Keep local edits from delaying cache refresh
| @@ -540,7 +540,10 @@ function onMessageReceived(_messageId, type) { | ||
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | function onChatContentChanged() { |
| 543 | - markActivity(); | |
| 543 | + // Editing, deleting, or swiping local chat content does not contact the text provider and | |
| 544 | + // therefore cannot refresh its prompt cache. Rebuild the replay payload, but preserve the | |
| 545 | + // deadline from the last real text generation/keepalive. This also keeps image-message edits | |
| 546 | + // and gallery activity from postponing text keepalives. | |
| 544 | 547 | if (armed && isKeepaliveEnabledForActive()) { |
| 545 | 548 | queueJobRefresh(); |
| 546 | 549 | } |
| @@ -581,9 +584,9 @@ async function init() { | ||
| 581 | 584 | // not send a new message (regenerate/swipe/continue) are armed by onGenerationStarted instead. |
| 582 | 585 | eventSource.on(event_types.MESSAGE_SENT, onMessageSent); |
| 583 | 586 | |
| 584 | - // Activity resets the backend deadline but never arms keepalive on its own. A completed | |
| 587 | + // Only actual text-provider generations reset the cache deadline. Local chat edits still | |
| 585 | 588 | // generation or a chat edit also refreshesrefresh the stored request so the server always replays the latest prompt without pretending that |
| 586 | 589 | // the latest promptthose assemblededits byrefreshed the UIprovider cache. |
| 587 | 590 | eventSource.on(event_types.MESSAGE_RECEIVED, onMessageReceived); |
| 588 | 591 | eventSource.on(event_types.GENERATION_STARTED, onGenerationStarted); |
| 589 | 592 | eventSource.on(event_types.GENERATION_ENDED, onGenerationEnded); |
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | "js": "index.js", |
| 7 | 7 | "css": "", |
| 8 | 8 | "author": "SillyTavern", |
| 9 | 9 | "version": "1.1.45", |
| 10 | 10 | "homePage": "https://github.com/SillyTavern/SillyTavern", |
| 11 | 11 | "hooks": { |
| 12 | 12 | "activate": "init" |