clay-server 3.4.0-beta.15 → 3.4.0-beta.17
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
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
|
|
|
@@ -7,6 +7,7 @@ var MEMORY_CONTRACT =
|
|
|
7
7
|
"Default to not writing. Create a note proactively only when the user explicitly asks to remember or track something, or when all of these are true: it will remain useful after the current task and session, it is not already adequately recorded in the repository or another note, and the user would likely be glad to find it on the board a week later. " +
|
|
8
8
|
"Good notes capture an unresolved commitment, durable product decision, user preference, constraint, or handoff that will materially change future work. " +
|
|
9
9
|
"Important exception for deferred defects: while doing code or technical work, actively create a sticky note when you discover a concrete defect, regression risk, security issue, or data-loss risk that is outside the current session goal and will remain unfixed when the turn ends. Do not wait for the user to ask. Include the observable evidence, affected component, likely impact, and a clear next action. Check active notes first when a duplicate is plausible. Do not create defect notes for speculation, general cleanup ideas, or problems you fixed in the current session. " +
|
|
10
|
+
"Important exception for deferred proposals: when you propose work (a fix, follow-up, improvement, or next step) and the user defers it rather than declining it (\"let's do that later\", \"next time\", \"after this\"), actively create a sticky note before the topic moves on. Do not wait to be asked. Capture what was proposed, why it mattered, and the agreed timing if any. Deferred agreements scroll out of chat history quickly and are hard to track; the board is where they survive. If the user declines the idea outright, do not write a note. " +
|
|
10
11
|
"Never create a note merely because work is important, lengthy, spans agents or restarts, or might help another agent. Do not record completed work, implementation details, test results, investigation logs, transient blockers, conversation summaries, or announcements of your own activity. When uncertain, do not write. " +
|
|
11
12
|
"Updates are visible too: update only when durable state materially changes, and remove a note created by your session when it stops being useful instead of turning it into a completion log. Put a concise plain-text title on the first line, stay focused on one topic, and include only the context needed for future action.";
|
|
12
13
|
|
package/package.json
CHANGED