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