@simonyea/holysheep-cli 1.7.128 → 1.7.129

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.7.128",
3
+ "version": "1.7.129",
4
4
  "description": "Claude Code/Cursor/Cline API relay for China — ¥1=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
5
5
  "keywords": [
6
6
  "openai-china",
@@ -103,7 +103,7 @@ async function readJsonResponse(response) {
103
103
  }
104
104
 
105
105
  // 向 relay 申请新 lease(启动时 + CONNECT 失败时被动重试)
106
- async function fetchFreshLease(config, sessionId) {
106
+ async function fetchFreshLease(config, sessionId, options = {}) {
107
107
  const controlPlaneUrl = getControlPlaneUrl(config)
108
108
  if (!controlPlaneUrl) throw new Error('Claude relay control plane is not configured')
109
109
 
@@ -116,6 +116,7 @@ async function fetchFreshLease(config, sessionId) {
116
116
  deviceId: config.deviceId || '',
117
117
  installSource: config.installSource || 'holysheep-cli',
118
118
  proxyMode: 'claude-process',
119
+ forceReassign: options.forceReassign === true,
119
120
  }),
120
121
  })
121
122
 
@@ -314,7 +315,9 @@ function createProcessProxyServer({ sessionId, configPath = CONFIG_PATH }) {
314
315
  if (shouldRefreshLeaseAfterError(lastError)) {
315
316
  await closeSession(configPath, sessionId)
316
317
  }
317
- const freshLease = await fetchFreshLease(config, sessionId)
318
+ const freshLease = await fetchFreshLease(config, sessionId, {
319
+ forceReassign: shouldRefreshLeaseAfterError(lastError),
320
+ })
318
321
  await doForward(freshLease)
319
322
  }
320
323
  lastError = null
@@ -378,7 +381,9 @@ function createProcessProxyServer({ sessionId, configPath = CONFIG_PATH }) {
378
381
  if (shouldRefreshLeaseAfterError(lastError)) {
379
382
  await closeSession(configPath, sessionId)
380
383
  }
381
- const freshLease = await fetchFreshLease(config, sessionId)
384
+ const freshLease = await fetchFreshLease(config, sessionId, {
385
+ forceReassign: shouldRefreshLeaseAfterError(lastError),
386
+ })
382
387
  await doConnect(freshLease)
383
388
  }
384
389
  lastError = null