clay-server 2.36.2-beta.7 → 2.36.2-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -733,6 +733,10 @@ export function processMessage(msg) {
|
|
|
733
733
|
// applied at history_done time.
|
|
734
734
|
store.set({ sessionIsProcessing: true });
|
|
735
735
|
applyDeadSessionTodoCompaction();
|
|
736
|
+
// Server confirmed the turn started: pre-thinking dots have done
|
|
737
|
+
// their job, drop them so they aren't stranded if no further
|
|
738
|
+
// events make it through.
|
|
739
|
+
removeMatePreThinking();
|
|
736
740
|
if (!(store.get('dmMode') && store.get('dmTargetUser') && store.get('dmTargetUser').isMate) && !store.get('matePreThinkingEl')) {
|
|
737
741
|
setActivity("thinking");
|
|
738
742
|
}
|
|
@@ -740,6 +744,10 @@ export function processMessage(msg) {
|
|
|
740
744
|
break;
|
|
741
745
|
|
|
742
746
|
case "compacting":
|
|
747
|
+
// Compacting means the SDK is mid-turn doing context compaction.
|
|
748
|
+
// Pre-thinking dots have served their purpose, clear them so the
|
|
749
|
+
// user sees the compaction indicator instead.
|
|
750
|
+
removeMatePreThinking();
|
|
743
751
|
if (msg.active) {
|
|
744
752
|
setActivity("compacting");
|
|
745
753
|
} else if (!(store.get('dmMode') && store.get('dmTargetUser') && store.get('dmTargetUser').isMate)) {
|
|
@@ -934,6 +942,10 @@ export function processMessage(msg) {
|
|
|
934
942
|
break;
|
|
935
943
|
|
|
936
944
|
case "result":
|
|
945
|
+
// Result marks turn end. Drop pre-thinking even if no delta/tool
|
|
946
|
+
// event ever arrived (e.g. tool-only turn whose progress signals
|
|
947
|
+
// were missed by the client).
|
|
948
|
+
removeMatePreThinking();
|
|
937
949
|
setActivity(null);
|
|
938
950
|
stopThinking();
|
|
939
951
|
markAllToolsDone();
|
|
@@ -623,6 +623,23 @@ function doShowMatePreThinking(mateName, mateAvatar) {
|
|
|
623
623
|
}
|
|
624
624
|
refreshIcons();
|
|
625
625
|
scrollToBottom();
|
|
626
|
+
// Safety net: if no server event ever clears these dots (lost in transit,
|
|
627
|
+
// missed handler, etc.) the user sees them forever and assumes the
|
|
628
|
+
// session is hung. After 90s with zero progress, clear the indicator
|
|
629
|
+
// and log a system note so the user knows to retry.
|
|
630
|
+
if (matePreThinkingTimer) clearTimeout(matePreThinkingTimer);
|
|
631
|
+
matePreThinkingTimer = setTimeout(function () {
|
|
632
|
+
var stillThere = store.get('matePreThinkingEl');
|
|
633
|
+
if (!stillThere) return;
|
|
634
|
+
stillThere.remove();
|
|
635
|
+
store.set({ matePreThinkingEl: null });
|
|
636
|
+
matePreThinkingTimer = null;
|
|
637
|
+
var note = document.createElement("div");
|
|
638
|
+
note.className = "system-msg";
|
|
639
|
+
note.textContent = "No response received in 90s. The server may have stalled. Send another message to retry.";
|
|
640
|
+
addToMessages(note);
|
|
641
|
+
scrollToBottom();
|
|
642
|
+
}, 90000);
|
|
626
643
|
}
|
|
627
644
|
|
|
628
645
|
export function removeMatePreThinking() {
|
package/package.json
CHANGED