@deepseek-ai/dsh-repeat-tool-reminder 0.2.2-rc.4 → 0.2.3-alpha.1

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/README.i18n.yaml CHANGED
@@ -24,8 +24,8 @@
24
24
  en: fc64919ff223096d
25
25
  zh: dd22a19eeffa9192
26
26
  /deepseek-ai-dsh-repeat-tool-reminder/use-this-package/what-you-get:
27
- en: 5cf91a5809d2c68a
28
- zh: 8f60231436b863b8
27
+ en: 63f2cbe9cd9dcf67
28
+ zh: e3596bcaa6d7934a
29
29
  /deepseek-ai-dsh-repeat-tool-reminder/understand-the-implementation:
30
30
  en: dd6d7a1571af5a9a
31
31
  zh: eba00095dfc1c92a
@@ -33,8 +33,8 @@
33
33
  en: 7bca56e3cba01338
34
34
  zh: 530fda764d226f39
35
35
  /deepseek-ai-dsh-repeat-tool-reminder/understand-the-implementation/detection-the-repeat-chain:
36
- en: b76a432aad14aa90
37
- zh: b0cd916f7897fb42
36
+ en: d55398671c75e51c
37
+ zh: 3b0fcdb438c2152d
38
38
  /deepseek-ai-dsh-repeat-tool-reminder/understand-the-implementation/reminder-delivery:
39
39
  en: e11bb31ae82954cd
40
40
  zh: 14f9c32ca93e7096
package/README.md CHANGED
@@ -55,7 +55,7 @@ Invalid configuration fails at startup with a clear error — an empty `threshol
55
55
 
56
56
  ### What you get
57
57
 
58
- With the defaults, a model that repeats the same call with identical arguments receives a short reminder on the third repeat — to analyze the previous result before calling again — and detailed reminders on the fifth and eighth, naming the tool and the repeated arguments so it can decide whether to change approach, gather more evidence, or finish. A new user message clears the count, so a fresh instruction is never treated as a loop. Reminders appear in the conversation after the repeated call's result, attributed to the plugin, so the model reads them like any other message.
58
+ With the defaults, a model that repeats the same call with identical arguments receives a short reminder on the third repeat — to analyze the previous result before calling again — and detailed reminders on the fifth and eighth, naming the tool and the repeated arguments so it can decide whether to change approach, gather more evidence, or finish. Only model-direct calls count, including `run_code`; calls inside a PTC program neither increment nor reset the count. A new user message clears the count, so a fresh instruction is never treated as a loop. Reminders appear in the conversation after the repeated call's result, attributed to the plugin, so the model reads them like any other message.
59
59
 
60
60
  -----
61
61
 
@@ -82,7 +82,7 @@ Each agent's chain is keyed by `(tool name, canonical arguments)` — two calls
82
82
 
83
83
  - **Untracked calls are transparent to the chain.** A call excluded by `include`/`exclude` neither increments nor resets the counter, so `grep X → todo_write → grep X` still counts as two consecutive `grep X` when `todo_write` is excluded — bookkeeping tools interleaved into a loop do not launder it.
84
84
  - **Denied calls count.** Detection sits on `tools/post-execute`, which also runs for calls a `tools/pre-execute` listener denied; a model hammering a denied call is exactly the loop worth breaking.
85
- - **Calls without an agent are ignored.** A direct `ctx.tools.execute()` caller has no model to remind and no live agent object to key on.
85
+ - **Nested calls and calls without an agent are ignored.** Calls with `exec.parent` neither increment nor reset the chain; calls without an agent have no model to remind or live agent object to key on.
86
86
  - **Per-agent keying, reset on user prompts.** One agent's repetition never trips another's reminder; a user prompt (`agent/pre-step`) deletes the submitting agent's chain, and object lifetime bounds the weak entry without a disposal listener.
87
87
  - **In-memory only.** A session resumed from persistence starts with a fresh chain — the guard is a heuristic nudge, not a logged invariant, so reminders after a resume are the accepted cost.
88
88
 
package/README.zh.md CHANGED
@@ -55,7 +55,7 @@ kind: "package-reference"
55
55
 
56
56
  ### 你会得到什么
57
57
 
58
- 按默认值,以相同参数重复同一调用的模型会在第三次重复时收到简短提醒——先分析上一次结果再调用——并在第五次和第八次收到详细提醒,列出工具与重复参数,使其决定改变方法、收集更多证据还是结束任务。新的用户消息会清零计数,因此全新指令绝不会被当作循环。提醒出现在重复调用的结果之后、归属于插件,模型像阅读任何其他消息一样阅读它。
58
+ 按默认值,以相同参数重复同一调用的模型会在第三次重复时收到简短提醒——先分析上一次结果再调用——并在第五次和第八次收到详细提醒,列出工具与重复参数,使其决定改变方法、收集更多证据还是结束任务。只统计模型直接发起的调用,包括 `run_code`;PTC 程序内部的调用既不递增也不重置计数。新的用户消息会清零计数,因此全新指令绝不会被当作循环。提醒出现在重复调用的结果之后、归属于插件,模型像阅读任何其他消息一样阅读它。
59
59
 
60
60
  -----
61
61
 
@@ -82,7 +82,7 @@ guard 建立在四项承诺之上:
82
82
 
83
83
  - **不受跟踪的调用对链透明。** 被 `include`/`exclude` 排除的调用既不递增也不重置计数器,因此 `grep X → todo_write → grep X` 在 `todo_write` 被排除时仍算作连续两次 `grep X`——穿插进循环的记录类工具不能掩盖循环。
84
84
  - **被拒绝的调用也计数。** 检测位于 `tools/post-execute`,被 `tools/pre-execute` 监听器拒绝的调用同样会经过它;模型反复尝试被拒绝的调用,恰恰是需要打破的循环。
85
- - **忽略没有 agent 的调用。** 直接调用 `ctx.tools.execute()` 的调用方没有需要提醒的模型,也没有可作为键的活跃 agent 对象。
85
+ - **忽略内部子调用和没有 agent 的调用。** 带有 `exec.parent` 的调用既不递增也不重置链;没有 agent 的调用没有需要提醒的模型,也没有可作为键的活跃 agent 对象。
86
86
  - **按 agent 分键,用户提示词时重置。** 一个 agent 的重复绝不会触发另一个 agent 的提醒;用户提示词(`agent/pre-step`)会删除提交该提示词的 agent 链,对象生命周期限制弱引用条目的寿命,无需 dispose(资源释放)监听器。
87
87
  - **仅驻留内存。** 从持久化恢复的会话以全新链开始——guard 是启发式提醒,而非记录在案的不变量,因此恢复后的提醒延后是可接受的代价。
88
88
 
package/lib/index.js CHANGED
@@ -1,15 +1,39 @@
1
1
  import { createRequire } from "node:module";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { Context, Service } from "@deepseek-ai/cordis";
4
+ //#region ../../util/error/src/index.ts
5
+ /**
6
+ * Harness error base with a stable machine-routable code and chained cause.
7
+ * Package errors extend it so tool results and replay can retain failure class.
8
+ * @module @deepseek-ai/dsh-error
9
+ */
10
+ /**
11
+ * Base class for all harness errors. Carries a `code` (stable, programmatic —
12
+ * e.g. `NO_ADAPTER`, `INVALID_ARGS`) distinct from the
13
+ * human-readable `message`, and supports `cause` chaining via the standard
14
+ * `ErrorOptions`. `name` defaults to the subclass constructor name.
15
+ */
16
+ var HarnessError = class extends Error {
17
+ /** Stable machine-routable failure class (e.g. `RATE_LIMIT`); route on this, never by parsing `message`. */
18
+ code;
19
+ constructor(message, code, options) {
20
+ super(message, options);
21
+ this.code = code;
22
+ this.name = new.target.name;
23
+ }
24
+ };
25
+ //#endregion
4
26
  //#region ../../typert/protocol/src/remote-error.ts
27
+ /** The one Remote failure class shared by owners, the Gateway, and consumers. */
5
28
  /**
6
- * One Remote call failure: a real Error carrying its stable code and typed
29
+ * One Remote call failure: a `HarnessError` carrying its stable code and typed
7
30
  * details. Owners throw it at the failure point; the Host Gateway encodes it
8
31
  * onto the wire unchanged; the Client face rebuilds an instance for the
9
32
  * `RemoteResult` error branch, so `throw result.error` keeps throw semantics.
10
- * Discrimination is always by `code`, never by instanceof.
33
+ * A tool body that throws it records `name: 'RemoteError'` and its Remote code
34
+ * on `tool/result`. Discrimination is always by `code`, never by instanceof.
11
35
  */
12
- var RemoteError = class extends Error {
36
+ var RemoteError = class extends HarnessError {
13
37
  code;
14
38
  details;
15
39
  /** Structural marker: cross-realm/bundle identification never uses instanceof. */
@@ -21,7 +45,7 @@ var RemoteError = class extends Error {
21
45
  * @param options - standard Error options (`cause` survives in-process only).
22
46
  */
23
47
  constructor(code, message, details, options) {
24
- super(message, options);
48
+ super(message, code, options);
25
49
  this.code = code;
26
50
  this.details = details;
27
51
  this.name = "RemoteError";
@@ -89,8 +113,8 @@ var TypertRemoteService = class extends Service {
89
113
  * tree registers it on the root, where it outlives any one Service.
90
114
  */
91
115
  function provideInvocationAccessor(ctx) {
92
- if (Object.hasOwn(ctx.root.reflect.props, "invocation")) return;
93
- ctx.root.accessor("invocation", { get: () => void 0 });
116
+ if (Object.hasOwn(ctx[Context.root].reflect.props, "invocation")) return;
117
+ ctx[Context.root].accessor("invocation", { get: () => void 0 });
94
118
  }
95
119
  function Remote(methodExportOrOptions, context) {
96
120
  if (typeof methodExportOrOptions === "string") {
@@ -885,65 +909,6 @@ function brandString(value) {
885
909
  return value;
886
910
  }
887
911
  //#endregion
888
- //#region ../../llm/llm/src/message.ts
889
- /** Message value types, identity, and immutable construction helpers. */
890
- /**
891
- * Detach and deep-freeze a message whose identity already exists.
892
- * @param message - complete message, including its stable identity.
893
- * @returns an immutable snapshot that preserves the identity.
894
- */
895
- function freezeMessage(message) {
896
- return deepFreeze(structuredClone(message));
897
- }
898
- /**
899
- * Create one identified message and freeze it before publication.
900
- * @param input - complete role, content, and source for a new message.
901
- * @returns an immutable message with a fresh stable identity.
902
- */
903
- function createMessage(input) {
904
- return deepFreeze(structuredClone({
905
- ...input,
906
- id: brandString(randomUUID())
907
- }));
908
- }
909
- /**
910
- * Create one identified user-role message and freeze it before publication.
911
- * @param input - complete content and source for a new user message.
912
- * @returns an immutable user message with a fresh stable identity.
913
- */
914
- function createUserMessage(input) {
915
- return createMessage({
916
- ...input,
917
- role: "user"
918
- });
919
- }
920
- //#endregion
921
- //#region ../../util/timeout/src/index.ts
922
- /** Largest delay Node schedules without clamping it to one millisecond. */
923
- const MAX_TIMER_DELAY_MS = 2147483647;
924
- //#endregion
925
- //#region ../../util/error/src/index.ts
926
- /**
927
- * Harness error base with a stable machine-routable code and chained cause.
928
- * Package errors extend it so tool results and replay can retain failure class.
929
- * @module @deepseek-ai/dsh-error
930
- */
931
- /**
932
- * Base class for all harness errors. Carries a `code` (stable, programmatic —
933
- * e.g. `NO_ADAPTER`, `INVALID_ARGS`) distinct from the
934
- * human-readable `message`, and supports `cause` chaining via the standard
935
- * `ErrorOptions`. `name` defaults to the subclass constructor name.
936
- */
937
- var HarnessError = class extends Error {
938
- /** Stable machine-routable failure class (e.g. `RATE_LIMIT`); route on this, never by parsing `message`. */
939
- code;
940
- constructor(message, code, options) {
941
- super(message, options);
942
- this.code = code;
943
- this.name = new.target.name;
944
- }
945
- };
946
- //#endregion
947
912
  //#region ../../llm/llm/src/error.ts
948
913
  /**
949
914
  * LLM failure codes and helpers over the shared Harness error base. The base
@@ -1027,6 +992,43 @@ new RegExp(String.raw`(?:^|[^a-z0-9])context[\s_-](?:length|window)[\s_-]` + Str
1027
992
  new RegExp(String.raw`\b(?:request|prompt|input|messages?)\s+(?:is\s+|are\s+)?` + String.raw`too\s+(?:large|long)\s+for\s+(?:(?:this|the)\s+)?` + String.raw`(?:model(?:'s)?\s+)?context(?:\s+window)?\b`, "i");
1028
993
  new RegExp(String.raw`\b(?:input|prompt|request|messages?)\b.{0,40}` + String.raw`\b(?:exceed(?:s|ed)?|overflows?|is\s+larger\s+than)\b.{0,40}` + String.raw`\b(?:the\s+)?(?:model(?:'s)?\s+)?context(?:\s+(?:length|window))?\b`, "i");
1029
994
  //#endregion
995
+ //#region ../../llm/llm/src/message.ts
996
+ /** Message value types, content text extraction, identity, and immutable construction helpers. */
997
+ /**
998
+ * Detach and deep-freeze a message whose identity already exists.
999
+ * @param message - complete message, including its stable identity.
1000
+ * @returns an immutable snapshot that preserves the identity.
1001
+ */
1002
+ function freezeMessage(message) {
1003
+ return deepFreeze(structuredClone(message));
1004
+ }
1005
+ /**
1006
+ * Create one identified message and freeze it before publication.
1007
+ * @param input - complete role, content, and source for a new message.
1008
+ * @returns an immutable message with a fresh stable identity.
1009
+ */
1010
+ function createMessage(input) {
1011
+ return deepFreeze(structuredClone({
1012
+ ...input,
1013
+ id: brandString(randomUUID())
1014
+ }));
1015
+ }
1016
+ /**
1017
+ * Create one identified user-role message and freeze it before publication.
1018
+ * @param input - complete content and source for a new user message.
1019
+ * @returns an immutable user message with a fresh stable identity.
1020
+ */
1021
+ function createUserMessage(input) {
1022
+ return createMessage({
1023
+ ...input,
1024
+ role: "user"
1025
+ });
1026
+ }
1027
+ //#endregion
1028
+ //#region ../../util/timeout/src/index.ts
1029
+ /** Largest delay Node schedules without clamping it to one millisecond. */
1030
+ const MAX_TIMER_DELAY_MS = 2147483647;
1031
+ //#endregion
1030
1032
  //#region ../../llm/llm/src/retry-policy.ts
1031
1033
  /**
1032
1034
  * Provider-owned request-retry policy configuration and resolution.
@@ -1226,10 +1228,11 @@ function failureSnapshot(value) {
1226
1228
  }
1227
1229
  /** Read an SDK error message without letting an accessor replace the primary failure. */
1228
1230
  function errorMessage(error) {
1231
+ let message;
1229
1232
  try {
1230
- const message = error.message;
1231
- if (typeof message === "string" && message.length > 0) return message;
1233
+ message = error.message;
1232
1234
  } catch (_sdkMessageGetter) {}
1235
+ if (typeof message === "string" && message.length > 0) return message;
1233
1236
  return "LLM adapter failed";
1234
1237
  }
1235
1238
  /** Trust only Harness-owned codes; third-party SDK codes are not our taxonomy. */
@@ -1845,7 +1848,7 @@ var LlmError = class LlmError extends HarnessError {
1845
1848
  * @param provider - registered provider route.
1846
1849
  * @param model - exact model id.
1847
1850
  * @param image - normalized image reference.
1848
- * @returns dimensions and byte target used by the adapter's request serializer.
1851
+ * @returns maximum dimensions and byte budgets used by the request serializer; readImageRequest returns the actual encoded dimensions.
1849
1852
  */
1850
1853
  imageRequestTarget(provider, model, image) {
1851
1854
  return this.registration(provider).adapter.imageRequestTarget(provider, model, image);
@@ -2220,7 +2223,7 @@ function detachDirectoryEntry(entry) {
2220
2223
  //#endregion
2221
2224
  //#region lib/types/index.js
2222
2225
  /**
2223
- * Advisory per-agent repeat-call detector. It enriches post-execute decisions
2226
+ * Advisory per-agent detector for model-direct repeat calls. It enriches post-execute decisions
2224
2227
  * with logged model context without vetoing or rewriting calls. Configuration
2225
2228
  * and chain semantics live in the package README; rationale lives in the
2226
2229
  * repeat-tool-reminder Agent Note.
@@ -2326,15 +2329,15 @@ function apply(ctx, config) {
2326
2329
  return !excludePatterns.some((pattern) => pattern.test(toolName));
2327
2330
  }
2328
2331
  /**
2329
- * Advance the calling agent's chain for one attempt and return the reminder
2330
- * to deliver, if this attempt's run length hits a configured threshold.
2332
+ * Advance the calling agent's chain for one model-direct attempt and return
2333
+ * the reminder at a configured threshold. Nested executions neither count nor reset.
2331
2334
  * Counting happens here — in post-execute — because denied calls also flow
2332
2335
  * through this waterfall (`ToolRuntime.execute` routes a deny through the
2333
2336
  * same pipeline), and a model hammering a denied call is exactly the loop
2334
2337
  * worth breaking.
2335
2338
  */
2336
2339
  function observe(exec) {
2337
- if (!exec.agent) return void 0;
2340
+ if (!exec.agent || exec.parent !== void 0) return void 0;
2338
2341
  if (!tracked(exec.name)) return void 0;
2339
2342
  const canonical = canonicalize(exec.arguments);
2340
2343
  const key = JSON.stringify([exec.name, canonical]);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Advisory per-agent repeat-call detector. It enriches post-execute decisions
2
+ * Advisory per-agent detector for model-direct repeat calls. It enriches post-execute decisions
3
3
  * with logged model context without vetoing or rewriting calls. Configuration
4
4
  * and chain semantics live in the package README; rationale lives in the
5
5
  * repeat-tool-reminder Agent Note.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAGxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,sBAAsB,EAAE;YAAE,IAAI,EAAE,sBAAsB,CAAA;SAAE,GAAG,aAAa,CAAA;KACzE;CACF;AAMD,eAAO,MAAM,IAAI,yBAAyB,CAAA;AAE1C;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAK3B,CAAA;AA2GF;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAiExD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAGxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,sBAAsB,EAAE;YAAE,IAAI,EAAE,sBAAsB,CAAA;SAAE,GAAG,aAAa,CAAA;KACzE;CACF;AAMD,eAAO,MAAM,IAAI,yBAAyB,CAAA;AAE1C;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAK3B,CAAA;AA2GF;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CA+DxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAYxD,MAAM,CAAC,MAAM,IAAI,GAAG,sBAAsB,CAAA;AA4B1C,M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CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-repeat-tool-reminder",
3
3
  "description": "Repeat-tool-call guard plugin: advisory reminders when an agent loops on identical tool calls",
4
- "version": "0.2.2-rc.4",
4
+ "version": "0.2.3-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -35,19 +35,20 @@
35
35
  "@deepseek-ai/schemastery": "~3.19.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@deepseek-ai/dsh-agent": "0.2.2-rc.4",
39
- "@deepseek-ai/dsh-tools": "0.2.2-rc.4",
38
+ "@deepseek-ai/dsh-agent": "0.2.3-alpha.1",
39
+ "@deepseek-ai/dsh-tools": "0.2.3-alpha.1",
40
40
  "@deepseek-ai/cordis": "~4.1.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@deepseek-ai/dsh-agent": "0.2.2-rc.4",
44
- "@deepseek-ai/dsh-agent-loop": "0.2.2-rc.4",
45
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-rc.4",
46
- "@deepseek-ai/dsh-llm": "0.2.2-rc.4",
47
- "@deepseek-ai/dsh-session": "0.2.2-rc.4",
48
- "@deepseek-ai/dsh-tool-testkit": "0.2.2-rc.4",
49
- "@deepseek-ai/dsh-tools": "0.2.2-rc.4",
43
+ "@deepseek-ai/dsh-brand": "0.2.3-alpha.1",
44
+ "@deepseek-ai/dsh-agent": "0.2.3-alpha.1",
45
+ "@deepseek-ai/dsh-agent-loop": "0.2.3-alpha.1",
46
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.3-alpha.1",
47
+ "@deepseek-ai/dsh-llm": "0.2.3-alpha.1",
48
+ "@deepseek-ai/dsh-session": "0.2.3-alpha.1",
49
+ "@deepseek-ai/dsh-tool-testkit": "0.2.3-alpha.1",
50
+ "@deepseek-ai/dsh-tools": "0.2.3-alpha.1",
50
51
  "@deepseek-ai/cordis": "~4.1.0",
51
- "@deepseek-ai/dsh-session-projection": "0.2.2-rc.4"
52
+ "@deepseek-ai/dsh-session-projection": "0.2.3-alpha.1"
52
53
  }
53
54
  }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Advisory per-agent repeat-call detector. It enriches post-execute decisions
2
+ * Advisory per-agent detector for model-direct repeat calls. It enriches post-execute decisions
3
3
  * with logged model context without vetoing or rewriting calls. Configuration
4
4
  * and chain semantics live in the package README; rationale lives in the
5
5
  * repeat-tool-reminder Agent Note.
@@ -186,17 +186,15 @@ export function apply(ctx: Context, config: Config): void {
186
186
  }
187
187
 
188
188
  /**
189
- * Advance the calling agent's chain for one attempt and return the reminder
190
- * to deliver, if this attempt's run length hits a configured threshold.
189
+ * Advance the calling agent's chain for one model-direct attempt and return
190
+ * the reminder at a configured threshold. Nested executions neither count nor reset.
191
191
  * Counting happens here — in post-execute — because denied calls also flow
192
192
  * through this waterfall (`ToolRuntime.execute` routes a deny through the
193
193
  * same pipeline), and a model hammering a denied call is exactly the loop
194
194
  * worth breaking.
195
195
  */
196
196
  function observe(exec: ToolExecution): UserMessage | undefined {
197
- // A direct `ctx.tools.execute()` caller has no model to remind and no id
198
- // to key on; only agent-loop calls participate.
199
- if (!exec.agent) return undefined
197
+ if (!exec.agent || exec.parent !== undefined) return undefined
200
198
  if (!tracked(exec.name)) return undefined
201
199
  const canonical = canonicalize(exec.arguments)
202
200
  const key = JSON.stringify([exec.name, canonical])