@opengeni/worker-bundle 0.28.1-canary.0 → 0.28.3

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.
@@ -48,7 +48,7 @@ export type CompactionModelUsageEventState = {
48
48
  export declare function createModelResponseEventState(claimedSourceKeys?: Set<string>): ModelResponseEventState;
49
49
  export declare function createCompactionModelUsageEventState(claimedSourceKeys?: Set<string>): CompactionModelUsageEventState;
50
50
  export declare const createSessionTitleModelUsageEventState: typeof createCompactionModelUsageEventState;
51
- export declare function modelResponseContextSignal(state: ModelResponseEventState): {
51
+ export declare function modelResponseContextSignal(state: ModelResponseEventState, responseCountBeforeStream?: number): {
52
52
  revision: number;
53
53
  totalTokens: number;
54
54
  } | null;
@@ -33,7 +33,7 @@ import {
33
33
  scheduledUserMessagePayload,
34
34
  withFirstPartyTools,
35
35
  workflowIdForSession
36
- } from "./chunk-AKP6BKM2.js";
36
+ } from "./chunk-NNXLW6V7.js";
37
37
  import {
38
38
  inspectOpenSandboxKubernetesInventory,
39
39
  recordCreditBalanceGauges,
@@ -10350,4 +10350,4 @@ export {
10350
10350
  createControlActivities,
10351
10351
  createControlActivitiesFromServices
10352
10352
  };
10353
- //# sourceMappingURL=activities-control-VVK7RA7F.js.map
10353
+ //# sourceMappingURL=activities-control-UXGPMDL3.js.map
@@ -86,7 +86,7 @@ import {
86
86
  withFirstPartyTools,
87
87
  wrapLazyTurnBoxWithRouting,
88
88
  wrapTurnBoxWithRouting
89
- } from "./chunk-AKP6BKM2.js";
89
+ } from "./chunk-NNXLW6V7.js";
90
90
  import {
91
91
  StreamTimingMetrics,
92
92
  makeMachineOpObserver,
@@ -5006,8 +5006,13 @@ function createCompactionModelUsageEventState(claimedSourceKeys = /* @__PURE__ *
5006
5006
  return { usageCount: 0, claimedSourceKeys };
5007
5007
  }
5008
5008
  var createSessionTitleModelUsageEventState = createCompactionModelUsageEventState;
5009
- function modelResponseContextSignal(state) {
5010
- return state.contextSignal;
5009
+ function modelResponseContextSignal(state, responseCountBeforeStream = 0) {
5010
+ const signal = state.contextSignal;
5011
+ if (!signal || signal.revision <= responseCountBeforeStream) return null;
5012
+ return {
5013
+ revision: signal.revision - responseCountBeforeStream,
5014
+ totalTokens: signal.totalTokens
5015
+ };
5011
5016
  }
5012
5017
  function assertModelResponseLatencyMode(input) {
5013
5018
  if (input.requested === "standard") {
@@ -8261,7 +8266,7 @@ async function runTurnStreamAttempt(deps) {
8261
8266
  await toolResultSpill.materializeDeferred();
8262
8267
  }
8263
8268
  } : {},
8264
- contextCompactionSignal: () => modelResponseContextSignal(modelResponseState),
8269
+ contextCompactionSignal: () => modelResponseContextSignal(modelResponseState, responseCountBeforeStream),
8265
8270
  contextCompactionRequested: () => isSessionCompactionRequested(db, input.workspaceId, input.sessionId),
8266
8271
  onModelPreparationPhase: (measurement) => {
8267
8272
  recordTurnStartupPhase(observability, {
@@ -22046,4 +22051,4 @@ export {
22046
22051
  createTurnActivities,
22047
22052
  createTurnActivitiesFromServices
22048
22053
  };
22049
- //# sourceMappingURL=activities-turn-FOIZYY56.js.map
22054
+ //# sourceMappingURL=activities-turn-NOYDE7PX.js.map