bunnyquery 1.1.3 → 1.1.4
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.
- package/bunnyquery.js +15 -1
- package/package.json +1 -1
package/bunnyquery.js
CHANGED
|
@@ -982,7 +982,11 @@
|
|
|
982
982
|
}
|
|
983
983
|
if (userTurn) out.push({ role: 'user', content: userTurn, id: item.id });
|
|
984
984
|
|
|
985
|
-
|
|
985
|
+
// Treat 'running' (worker has claimed the item) identically to
|
|
986
|
+
// 'pending'. The list endpoint returns the raw stts value; the
|
|
987
|
+
// single-item polling path normalises it server-side but the list
|
|
988
|
+
// path does not — same fix as agent.vue mapHistoryListToMessages.
|
|
989
|
+
if (item.status === 'pending' || item.status === 'running') {
|
|
986
990
|
out.push({ role: 'assistant', content: '', id: item.id, isPending: true });
|
|
987
991
|
} else if (item.status === 'failed' || isErrorResponseBody(res)) {
|
|
988
992
|
out.push({
|
|
@@ -2303,6 +2307,16 @@
|
|
|
2303
2307
|
async _runPendingPoll() {
|
|
2304
2308
|
// Defensive: if somehow re-entered, drop the duplicate.
|
|
2305
2309
|
if (this._pollingPending) return;
|
|
2310
|
+
// When _sendMessage is actively dispatching or the typewriter is
|
|
2311
|
+
// running, skip replacing this.messages. The locally-pushed
|
|
2312
|
+
// optimistic messages (user turn + pending assistant) have no
|
|
2313
|
+
// server id and would be silently dropped by the merge, causing
|
|
2314
|
+
// the message to transiently disappear. Reschedule so polling
|
|
2315
|
+
// resumes as soon as the send/typewrite finishes.
|
|
2316
|
+
if (this.sending || this.typing) {
|
|
2317
|
+
this._schedulePendingPoll();
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2306
2320
|
this._pollingPending = true;
|
|
2307
2321
|
try {
|
|
2308
2322
|
const res = await getChatHistory(
|