@linnlabs/linnkit 0.45.0 → 0.46.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.
@@ -5164,13 +5164,11 @@ function createExecuteLlmStage(dependencies) {
5164
5164
  "llmCallStartedAt",
5165
5165
  "llmResp",
5166
5166
  "llmCallDurationMs",
5167
- "executorLocalPatch",
5168
5167
  "contextUsage"
5169
5168
  ],
5170
5169
  async run(ctx) {
5171
5170
  let cloudQuotaFallbackAppliedModelId;
5172
5171
  let modelFallbackAudit;
5173
- let lastSuccessfulLlmModelId;
5174
5172
  let contextUsage;
5175
5173
  const modelFallbackRejections = [];
5176
5174
  const promptBudget = ctx.promptBudget;
@@ -5191,8 +5189,7 @@ function createExecuteLlmStage(dependencies) {
5191
5189
  onCloudQuotaFallbackApplied(fallbackModelId) {
5192
5190
  cloudQuotaFallbackAppliedModelId = readNonEmptyString3(fallbackModelId);
5193
5191
  },
5194
- onLlmAttemptSucceeded(activeModelId, attemptContextUsage) {
5195
- lastSuccessfulLlmModelId = readNonEmptyString3(activeModelId);
5192
+ onLlmAttemptSucceeded(_activeModelId, attemptContextUsage) {
5196
5193
  contextUsage = attemptContextUsage;
5197
5194
  },
5198
5195
  onModelFallbackApplied(info) {
@@ -5293,7 +5290,6 @@ function createExecuteLlmStage(dependencies) {
5293
5290
  llmCallStartedAt,
5294
5291
  llmResp,
5295
5292
  llmCallDurationMs,
5296
- executorLocalPatch: lastSuccessfulLlmModelId ? { lastSuccessfulLlmModelId } : void 0,
5297
5293
  contextUsage
5298
5294
  };
5299
5295
  }
@@ -8475,6 +8471,12 @@ function parseToolArgs(call) {
8475
8471
  };
8476
8472
  }
8477
8473
  }
8474
+ function readRunLockedModelId(local) {
8475
+ const executorLocal = local.executorLocal;
8476
+ if (!isRecord9(executorLocal)) return void 0;
8477
+ const lockedModelId = executorLocal.runLockedModelId;
8478
+ return typeof lockedModelId === "string" && lockedModelId.trim() ? lockedModelId : void 0;
8479
+ }
8478
8480
  function prepareToolNodeContext(state) {
8479
8481
  const local = state.local || {};
8480
8482
  const toolContext = isRecord9(local.toolContext) ? local.toolContext : {};
@@ -8492,6 +8494,7 @@ function prepareToolNodeContext(state) {
8492
8494
  }
8493
8495
  });
8494
8496
  attachWorkingHistoryView({ state, toolContext });
8497
+ toolContext.activeModelId = readRunLockedModelId(local) ?? toolContext.modelId;
8495
8498
  return {
8496
8499
  state,
8497
8500
  local,
@@ -9757,6 +9760,7 @@ var executor = zod.z.object({
9757
9760
  systemReminderPolicy: AgentSpecSystemReminderPolicy.optional(),
9758
9761
  toolObservationPolicy: AgentSpecToolObservationGovernancePolicy.optional(),
9759
9762
  runLockedModelId: zod.z.string().optional(),
9763
+ // 0.45 及更早的 checkpoint 可能带这个已删除字段;照常接受,读入时丢弃。
9760
9764
  lastSuccessfulLlmModelId: zod.z.string().optional(),
9761
9765
  llmInvocationKind: zod.z.enum(["user_initiated", "continuation"]).optional(),
9762
9766
  llmInvocationCount: counter.optional(),
@@ -9766,7 +9770,7 @@ var executor = zod.z.object({
9766
9770
  committedCount: counter,
9767
9771
  lastCommittedFingerprint: zod.z.string().optional()
9768
9772
  }).strict().optional()
9769
- }).strict();
9773
+ }).strict().transform(({ lastSuccessfulLlmModelId: _retired, ...state }) => state);
9770
9774
  var checkpoint = zod.z.object({
9771
9775
  nodeId: zod.z.string().min(1),
9772
9776
  schemaVersion: zod.z.literal(ENGINE_STATE_SCHEMA_VERSION).optional(),