clay-server 3.4.0-beta.15 → 3.4.0-beta.16
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/lib/sdk-bridge.js +10 -0
- package/lib/sdk-message-processor.js +2 -0
- package/package.json +1 -1
package/lib/sdk-bridge.js
CHANGED
|
@@ -878,6 +878,8 @@ function createSDKBridge(opts) {
|
|
|
878
878
|
var stillOwnsRuntime = session.queryInstance === myQueryInstance;
|
|
879
879
|
if (session.isProcessing && session.taskStopRequested && stillOwnsRuntime) {
|
|
880
880
|
session.isProcessing = false;
|
|
881
|
+
session._awaitingTurnResult = false;
|
|
882
|
+
session._queuedTurnCount = 0;
|
|
881
883
|
onProcessingChanged();
|
|
882
884
|
send({ type: "status", processing: false });
|
|
883
885
|
sendAndRecord(session, { type: "thinking_stop" });
|
|
@@ -892,6 +894,8 @@ function createSDKBridge(opts) {
|
|
|
892
894
|
// iterator without a result event. Treat any result-less stream end as
|
|
893
895
|
// a failed turn so the UI cannot remain on processing forever.
|
|
894
896
|
session.isProcessing = false;
|
|
897
|
+
session._awaitingTurnResult = false;
|
|
898
|
+
session._queuedTurnCount = 0;
|
|
895
899
|
onProcessingChanged();
|
|
896
900
|
if (!session._lastAdapterError) {
|
|
897
901
|
sendAndRecord(session, {
|
|
@@ -906,6 +910,8 @@ function createSDKBridge(opts) {
|
|
|
906
910
|
} catch (err) {
|
|
907
911
|
if (session.isProcessing && session.queryInstance === myQueryInstance) {
|
|
908
912
|
session.isProcessing = false;
|
|
913
|
+
session._awaitingTurnResult = false;
|
|
914
|
+
session._queuedTurnCount = 0;
|
|
909
915
|
onProcessingChanged();
|
|
910
916
|
if (err.name === "AbortError" || (myAbortController && myAbortController.signal.aborted) || session.taskStopRequested) {
|
|
911
917
|
if (!session.destroying) {
|
|
@@ -1584,6 +1590,8 @@ function createSDKBridge(opts) {
|
|
|
1584
1590
|
console.error("[sdk-bridge] cliSessionId:", session.cliSessionId, "resume:", !!session.cliSessionId);
|
|
1585
1591
|
console.error("[sdk-bridge] Stack:", e.stack || "(no stack)");
|
|
1586
1592
|
session.isProcessing = false;
|
|
1593
|
+
session._awaitingTurnResult = false;
|
|
1594
|
+
session._queuedTurnCount = 0;
|
|
1587
1595
|
onProcessingChanged();
|
|
1588
1596
|
session.queryInstance = null;
|
|
1589
1597
|
session.messageQueue = null;
|
|
@@ -1625,6 +1633,8 @@ function createSDKBridge(opts) {
|
|
|
1625
1633
|
session.messageQueue = null;
|
|
1626
1634
|
session.abortController = null;
|
|
1627
1635
|
session.isProcessing = false;
|
|
1636
|
+
session._awaitingTurnResult = false;
|
|
1637
|
+
session._queuedTurnCount = 0;
|
|
1628
1638
|
onProcessingChanged();
|
|
1629
1639
|
sendAndRecord(session, { type: "error", text: "The agent connection closed before it received your message. Please send it again." });
|
|
1630
1640
|
sendAndRecord(session, { type: "done", code: 1 });
|
|
@@ -796,6 +796,8 @@ function attachMessageProcessor(ctx) {
|
|
|
796
796
|
// app-server returned an unauthorized/token-revoked error). Trigger the
|
|
797
797
|
// same login flow as the Claude login-prompt path.
|
|
798
798
|
session.isProcessing = false;
|
|
799
|
+
session._awaitingTurnResult = false;
|
|
800
|
+
session._queuedTurnCount = 0;
|
|
799
801
|
onProcessingChanged();
|
|
800
802
|
emitAuthRequired(session);
|
|
801
803
|
|
package/package.json
CHANGED