deepagents 1.13.3 → 1.13.4

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.
@@ -3475,6 +3475,24 @@ const DEFAULT_SUBAGENT_PROMPT = "In order to complete the objective that the use
3475
3475
  const FORKED_CONTEXT_KEY = "_deepagentsForkedContext";
3476
3476
  const FORK_RECURSION_REFUSAL = "You are a subagent and cannot delegate to another subagent. Complete this task yourself instead of calling this tool again.";
3477
3477
  /**
3478
+ * Per-graph call accounting owned by the upstream limit middlewares. Upstream
3479
+ * declares these as plain values, so LangGraph gives them single-writer
3480
+ * `LastValue` channels: forwarding them crashed parallel delegation and let a
3481
+ * subagent's reset overwrite the parent's budget. Each agent counts its own
3482
+ * calls, so they never cross the boundary.
3483
+ *
3484
+ * Matching by name is targeted, not structural — other middleware declaring
3485
+ * plain state still collide, notably in a fork. A later change should derive
3486
+ * these keys from each subagent's middleware `stateSchema` and forward only
3487
+ * mergeable (`ReducedValue`) channels.
3488
+ */
3489
+ const CALL_COUNT_STATE_KEYS = [
3490
+ "threadModelCallCount",
3491
+ "runModelCallCount",
3492
+ "threadToolCallCount",
3493
+ "runToolCallCount"
3494
+ ];
3495
+ /**
3478
3496
  * State keys excluded when passing state to subagents and when returning
3479
3497
  * updates from subagents. Summarization keys are excluded because their
3480
3498
  * cutoffIndex is only valid against the message list it was computed from.
@@ -3485,6 +3503,7 @@ const EXCLUDED_STATE_KEYS = [
3485
3503
  "structuredResponse",
3486
3504
  "skillsMetadata",
3487
3505
  "memoryContents",
3506
+ ...CALL_COUNT_STATE_KEYS,
3488
3507
  "_summarizationEvent",
3489
3508
  "_summarizationSessionId",
3490
3509
  FORKED_CONTEXT_KEY
@@ -3494,9 +3513,13 @@ const EXCLUDED_STATE_KEYS = [
3494
3513
  * Narrower than `EXCLUDED_STATE_KEYS`: a fork's mirrored middleware needs
3495
3514
  * the parent's private channels (skills metadata, memory contents, etc.)
3496
3515
  * to rebuild an equivalent prompt.
3516
+ *
3517
+ * Call counts stay excluded: a fork inherits the parent's middleware, so
3518
+ * sharing them collides on the parent's channel.
3497
3519
  */
3498
3520
  const FORK_EXCLUDED_STATE_KEYS = [
3499
3521
  "structuredResponse",
3522
+ ...CALL_COUNT_STATE_KEYS,
3500
3523
  "_summarizationEvent",
3501
3524
  "_summarizationSessionId"
3502
3525
  ];
@@ -9072,4 +9095,4 @@ Object.defineProperty(exports, "serializeProfile", {
9072
9095
  }
9073
9096
  });
9074
9097
 
9075
- //# sourceMappingURL=langsmith-Ynj9VKxb.cjs.map
9098
+ //# sourceMappingURL=langsmith-yA3yhBRa.cjs.map