dsh-cursor-subscription 0.6.2 → 0.6.3

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.md CHANGED
@@ -60,7 +60,7 @@ Then add `dsh-cursor-subscription` to the `dsh.profile.bundles` array in `packag
60
60
 
61
61
  When a tool is required, the agent converts Cursor's tool request into a local DSH tool execution. The result is returned to the model through the conversation history; Cursor's filesystem tools are not used.
62
62
 
63
- The **Runtime settings** card controls the maximum tool rounds in one Cursor run and the HTTP retry policy. Retry count means additional attempts and defaults to `0` (disabled). Cursor's streaming POST protocol cannot prove that a failed attempt was not processed remotely, so enabling retries may repeat model work or usage. Retries occur only before any response output when the initial HTTP status matches the configured list.
63
+ The **Runtime settings** card controls the maximum tool rounds in one Cursor run and the HTTP retry policy. The tool-round cap defaults to `200` (range 1–1000) and ends the run with `TOOL_LIMIT` when exceeded. Retry count means additional attempts and defaults to `0` (disabled). Cursor's streaming POST protocol cannot prove that a failed attempt was not processed remotely, so enabling retries may repeat model work or usage. Retries occur only before any response output when the initial HTTP status matches the configured list.
64
64
 
65
65
  ## Updating and Removing
66
66
 
package/README_zh.md CHANGED
@@ -71,7 +71,8 @@ pnpm add file:D:/mcp/dsh-cursor-subscription
71
71
  需要调用工具时,Agent 会把 Cursor 侧的工具请求转成 DSH 本地工具执行,结果通过
72
72
  对话历史回传给模型,全程不经过 Cursor 的文件系统工具。
73
73
 
74
- 「运行设置」卡片可以调整单次 Cursor 任务的最大工具轮次和 HTTP 重试策略。重试次数指
74
+ 「运行设置」卡片可以调整单次 Cursor 任务的最大工具轮次和 HTTP 重试策略。工具轮次上限
75
+ 默认 `200`(范围 1–1000),超过后以 `TOOL_LIMIT` 终止该次运行。重试次数指
75
76
  首次请求之外的额外尝试次数,默认 `0`(关闭)。Cursor 的流式 POST 协议无法证明失败请求
76
77
  未被远端处理,因此启用重试可能重复模型工作或用量;仅当尚未产生任何输出且初始 HTTP
77
78
  状态码匹配列表时才会重试。
package/lib/index.js CHANGED
@@ -172,7 +172,7 @@ export const STREAM_PROGRESS_TIMEOUT_MS = 60 * 1000;
172
172
  /** Retain checkpoints/live tool bridges for inactive DSH sessions. */
173
173
  export const SESSION_STATE_TTL_MS = 30 * 60 * 1000;
174
174
  /** Stop one Cursor Run before an unconstrained agent can loop forever. */
175
- export const MAX_TOOL_ROUNDS = 64;
175
+ export const MAX_TOOL_ROUNDS = 200;
176
176
  export const DEFAULT_RETRY_COUNT = 0;
177
177
  export const DEFAULT_RETRY_INTERVAL_MS = 1000;
178
178
  export const DEFAULT_RETRY_HTTP_STATUS_CODES = Object.freeze([408, 425, 429, 500, 502, 503, 504]);
@@ -2646,6 +2646,18 @@ export class CursorAdapter extends LlmAdapter {
2646
2646
  }
2647
2647
  } else if (update.type === "toolCallStarted" || update.type === "toolCallCompleted" || update.type === "toolCallDelta") {
2648
2648
  emittedToolCall = true;
2649
+ } else if (update.type === "turnEnded") {
2650
+ // Cursor ends every assistant turn with this update, but it does
2651
+ // not reliably close the HTTP/2 stream afterwards: the server can
2652
+ // keep the run alive with heartbeats only. Ignoring the update
2653
+ // therefore left a finished answer waiting until the progress
2654
+ // watchdog aborted the run, and the resulting retryable TIMEOUT
2655
+ // made DSH discard the answer the user had already read and
2656
+ // re-run the whole step. The trailing conversation checkpoint
2657
+ // always arrives before turnEnded, so stopping here keeps
2658
+ // everything a later run needs. A pending MCP tool call still
2659
+ // waits for its checkpoint so the live bridge stays resumable.
2660
+ if (!toolCallPending) break;
2649
2661
  }
2650
2662
  } else if (message.case === "kvServerMessage") {
2651
2663
  const kv = message.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cursor-subscription",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "packageManager": "pnpm@11.19.0",
5
5
  "description": "Cursor subscription for DeepSeek Harness with browser login, token refresh, model discovery, and the Cursor Agent chat protocol",
6
6
  "type": "module",