@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.
package/dist/cli.js CHANGED
@@ -5048,13 +5048,11 @@ function createExecuteLlmStage(dependencies) {
5048
5048
  "llmCallStartedAt",
5049
5049
  "llmResp",
5050
5050
  "llmCallDurationMs",
5051
- "executorLocalPatch",
5052
5051
  "contextUsage"
5053
5052
  ],
5054
5053
  async run(ctx) {
5055
5054
  let cloudQuotaFallbackAppliedModelId;
5056
5055
  let modelFallbackAudit;
5057
- let lastSuccessfulLlmModelId;
5058
5056
  let contextUsage;
5059
5057
  const modelFallbackRejections = [];
5060
5058
  const promptBudget = ctx.promptBudget;
@@ -5075,8 +5073,7 @@ function createExecuteLlmStage(dependencies) {
5075
5073
  onCloudQuotaFallbackApplied(fallbackModelId) {
5076
5074
  cloudQuotaFallbackAppliedModelId = readNonEmptyString3(fallbackModelId);
5077
5075
  },
5078
- onLlmAttemptSucceeded(activeModelId, attemptContextUsage) {
5079
- lastSuccessfulLlmModelId = readNonEmptyString3(activeModelId);
5076
+ onLlmAttemptSucceeded(_activeModelId, attemptContextUsage) {
5080
5077
  contextUsage = attemptContextUsage;
5081
5078
  },
5082
5079
  onModelFallbackApplied(info) {
@@ -5177,7 +5174,6 @@ function createExecuteLlmStage(dependencies) {
5177
5174
  llmCallStartedAt,
5178
5175
  llmResp,
5179
5176
  llmCallDurationMs,
5180
- executorLocalPatch: lastSuccessfulLlmModelId ? { lastSuccessfulLlmModelId } : void 0,
5181
5177
  contextUsage
5182
5178
  };
5183
5179
  }
@@ -8359,6 +8355,12 @@ function parseToolArgs(call) {
8359
8355
  };
8360
8356
  }
8361
8357
  }
8358
+ function readRunLockedModelId(local) {
8359
+ const executorLocal = local.executorLocal;
8360
+ if (!isRecord9(executorLocal)) return void 0;
8361
+ const lockedModelId = executorLocal.runLockedModelId;
8362
+ return typeof lockedModelId === "string" && lockedModelId.trim() ? lockedModelId : void 0;
8363
+ }
8362
8364
  function prepareToolNodeContext(state) {
8363
8365
  const local = state.local || {};
8364
8366
  const toolContext = isRecord9(local.toolContext) ? local.toolContext : {};
@@ -8376,6 +8378,7 @@ function prepareToolNodeContext(state) {
8376
8378
  }
8377
8379
  });
8378
8380
  attachWorkingHistoryView({ state, toolContext });
8381
+ toolContext.activeModelId = readRunLockedModelId(local) ?? toolContext.modelId;
8379
8382
  return {
8380
8383
  state,
8381
8384
  local,
@@ -9641,6 +9644,7 @@ var executor = z.object({
9641
9644
  systemReminderPolicy: AgentSpecSystemReminderPolicy.optional(),
9642
9645
  toolObservationPolicy: AgentSpecToolObservationGovernancePolicy.optional(),
9643
9646
  runLockedModelId: z.string().optional(),
9647
+ // 0.45 及更早的 checkpoint 可能带这个已删除字段;照常接受,读入时丢弃。
9644
9648
  lastSuccessfulLlmModelId: z.string().optional(),
9645
9649
  llmInvocationKind: z.enum(["user_initiated", "continuation"]).optional(),
9646
9650
  llmInvocationCount: counter.optional(),
@@ -9650,7 +9654,7 @@ var executor = z.object({
9650
9654
  committedCount: counter,
9651
9655
  lastCommittedFingerprint: z.string().optional()
9652
9656
  }).strict().optional()
9653
- }).strict();
9657
+ }).strict().transform(({ lastSuccessfulLlmModelId: _retired, ...state }) => state);
9654
9658
  var checkpoint = z.object({
9655
9659
  nodeId: z.string().min(1),
9656
9660
  schemaVersion: z.literal(ENGINE_STATE_SCHEMA_VERSION).optional(),