@opengeni/worker-bundle 1.1.0 → 1.2.0
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/dist/activities/agent-turn/admission.d.ts +3 -2
- package/dist/activities/agent-turn/compaction-prep.d.ts +1 -0
- package/dist/activities/agent-turn/finalization-monitor.d.ts +6 -1
- package/dist/activities/agent-turn/model-usage.d.ts +10 -0
- package/dist/{activities-control-XZAIMFQJ.js → activities-control-QSDPXLLD.js} +5 -5
- package/dist/activities-control-QSDPXLLD.js.map +1 -0
- package/dist/{activities-turn-4EEVNZCC.js → activities-turn-BMY3CDKL.js} +96 -32
- package/dist/activities-turn-BMY3CDKL.js.map +1 -0
- package/dist/{chunk-OT64XARC.js → chunk-JKMG5ZHH.js} +18 -6
- package/dist/{chunk-OT64XARC.js.map → chunk-JKMG5ZHH.js.map} +1 -1
- package/dist/{chunk-3ZTRWDMN.js → chunk-XONQEVAD.js} +1 -1
- package/dist/chunk-XONQEVAD.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/observability-metrics.d.ts +1 -1
- package/package.json +21 -21
- package/src/activities/agent-turn/admission.ts +11 -5
- package/src/activities/agent-turn/claim.ts +1 -0
- package/src/activities/agent-turn/compaction-prep.ts +20 -1
- package/src/activities/agent-turn/errors.ts +21 -4
- package/src/activities/agent-turn/failure-settlement.ts +9 -1
- package/src/activities/agent-turn/finalization-monitor.ts +14 -1
- package/src/activities/agent-turn/finalization.ts +5 -0
- package/src/activities/agent-turn/model-usage.ts +38 -0
- package/src/activities/agent-turn/run.ts +1 -0
- package/src/activities/agent-turn/stream-attempt.ts +22 -16
- package/src/activities/knowledge-indexing.ts +2 -2
- package/src/observability-metrics.ts +1 -0
- package/dist/activities-control-XZAIMFQJ.js.map +0 -1
- package/dist/activities-turn-4EEVNZCC.js.map +0 -1
- package/dist/chunk-3ZTRWDMN.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
observabilityEventBusOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XONQEVAD.js";
|
|
4
4
|
|
|
5
5
|
// src/activity-services.ts
|
|
6
6
|
import {
|
|
@@ -9086,6 +9086,7 @@ import {
|
|
|
9086
9086
|
safeDatabaseErrorFacts,
|
|
9087
9087
|
isRetryableDatabaseTransportFailure,
|
|
9088
9088
|
isSessionEventPersistenceError,
|
|
9089
|
+
DatabaseTransactionError,
|
|
9089
9090
|
SandboxLeaseTransitionError as SandboxLeaseTransitionError3
|
|
9090
9091
|
} from "@opengeni/db";
|
|
9091
9092
|
import {
|
|
@@ -9932,6 +9933,11 @@ function retryableDatabaseFailureCode(error, requireDatabaseProvenance = false)
|
|
|
9932
9933
|
const boundaries = /* @__PURE__ */ new Set();
|
|
9933
9934
|
const ownDatabaseNodes = /* @__PURE__ */ new Set();
|
|
9934
9935
|
const codes = /* @__PURE__ */ new Set();
|
|
9936
|
+
const ownChildren = (node) => node instanceof DatabaseTransactionError ? (
|
|
9937
|
+
// Callback failures retained beside a failed rollback supply vetoes,
|
|
9938
|
+
// never driver provenance for a provider's connection-looking error.
|
|
9939
|
+
[...graph.get(node)].filter((child) => child === node.cause)
|
|
9940
|
+
) : [...graph.get(node)];
|
|
9935
9941
|
for (const node of graph.keys()) {
|
|
9936
9942
|
if (isRoutingMutationOutcomeUnknownError(node)) return null;
|
|
9937
9943
|
const record = node;
|
|
@@ -9940,12 +9946,12 @@ function retryableDatabaseFailureCode(error, requireDatabaseProvenance = false)
|
|
|
9940
9946
|
const sqlState = isSessionEventPersistenceError(node) ? node.details.sqlState : record.name === "PostgresError" && typeof record.code === "string" ? record.code : null;
|
|
9941
9947
|
if (requireDatabaseProvenance ? isRunningTurnDatabaseConnectionSqlState(sqlState) : isDatabaseConnectionSqlState(sqlState))
|
|
9942
9948
|
transports.add(node);
|
|
9943
|
-
if (node instanceof DrizzleQueryError || isSessionEventPersistenceError(node)) {
|
|
9949
|
+
if (node instanceof DrizzleQueryError || node instanceof DatabaseTransactionError || isSessionEventPersistenceError(node)) {
|
|
9944
9950
|
const queue = [node];
|
|
9945
9951
|
for (const source of queue) {
|
|
9946
9952
|
if (ownDatabaseNodes.has(source)) continue;
|
|
9947
9953
|
ownDatabaseNodes.add(source);
|
|
9948
|
-
queue.push(...
|
|
9954
|
+
queue.push(...ownChildren(source));
|
|
9949
9955
|
}
|
|
9950
9956
|
}
|
|
9951
9957
|
}
|
|
@@ -9956,13 +9962,13 @@ function retryableDatabaseFailureCode(error, requireDatabaseProvenance = false)
|
|
|
9956
9962
|
if (seen.has(node)) continue;
|
|
9957
9963
|
seen.add(node);
|
|
9958
9964
|
if (transports.has(node)) return true;
|
|
9959
|
-
queue.push(...
|
|
9965
|
+
queue.push(...ownChildren(node));
|
|
9960
9966
|
}
|
|
9961
9967
|
return false;
|
|
9962
9968
|
};
|
|
9963
9969
|
for (const node of graph.keys()) {
|
|
9964
9970
|
const record = node;
|
|
9965
|
-
if (node instanceof DrizzleQueryError) {
|
|
9971
|
+
if (node instanceof DrizzleQueryError || node instanceof DatabaseTransactionError) {
|
|
9966
9972
|
boundaries.add(node);
|
|
9967
9973
|
if (hasOwnTransport(node)) codes.add("db_failure");
|
|
9968
9974
|
}
|
|
@@ -9986,6 +9992,12 @@ function retryableDatabaseFailureCode(error, requireDatabaseProvenance = false)
|
|
|
9986
9992
|
}
|
|
9987
9993
|
}
|
|
9988
9994
|
var RUNNING_TURN_DATABASE_TRANSPORT_CODES = /* @__PURE__ */ new Set([
|
|
9995
|
+
// postgres.js reports these for a physically lost connection, including
|
|
9996
|
+
// transaction cleanup after its socket has already closed. Own-client
|
|
9997
|
+
// provenance and the unknown-outcome veto remain mandatory above.
|
|
9998
|
+
"CONNECTION_CLOSED",
|
|
9999
|
+
"CONNECTION_DESTROYED",
|
|
10000
|
+
"CONNECTION_ENDED",
|
|
9989
10001
|
"ECONNREFUSED",
|
|
9990
10002
|
"ECONNRESET",
|
|
9991
10003
|
"CONNECT_TIMEOUT"
|
|
@@ -10913,4 +10925,4 @@ export {
|
|
|
10913
10925
|
CODEX_USAGE_LIMIT_MAX_RESUME_MS,
|
|
10914
10926
|
classifyClaudeCredentialFailure
|
|
10915
10927
|
};
|
|
10916
|
-
//# sourceMappingURL=chunk-
|
|
10928
|
+
//# sourceMappingURL=chunk-JKMG5ZHH.js.map
|