dsh-agy-link 0.6.41 → 0.6.42

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.42 (2026-11-20)
4
+
5
+ ### English
6
+
7
+ - **Fix(quota): a free-tier account's refused summary is suppressed instead of retried every hour (fixes #137).** A Google account without a paid Antigravity subscription has no 5h window, so `retrieveUserQuotaSummary` answers `403 PERMISSION_DENIED` — without any "licence" wording. `classifySummaryRefusal()` therefore classified it as a generic `http` failure, `quotaUnavailable` recorded it as `partial`/`unreachable`, and `quotaSummarySuppressed()` only honours `no_license`: the hourly background poll kept repeating the same 403 forever. There is now a distinct **`no_summary_access`** verdict (403 + `PERMISSION_DENIED`), recorded with a **7-day** retry window aligned to the weekly quota cycle (an unlicensed account keeps its 6h window, since a fresh licence can arrive at any time).
8
+ - **The two kinds of suppression are now separate**, which matters because they have different scope: `quotaSummarySuppressed()` skips only the summary call (the pipeline still refreshes `fetchAvailableModels` / user quota), while the new `accountPollSuppressed()` decides whether an account leaves the background poll entirely — and only a licence-less account does. Folding the free-tier case into `no_license` would have frozen its model list, so it keeps polling and merely stops hammering the refused endpoint. The console now says "free-tier account · weekly quota only" instead of a generic refresh failure (four locales).
9
+
10
+ ### 中文
11
+
12
+ - **修复(额度):免费账号被拒绝的汇总请求改为压制,而不再每小时重试(修复 #137)。** 未购买 Antigravity 付费订阅的 Google 账号没有 5 小时窗口,`retrieveUserQuotaSummary` 直接返回 `403 PERMISSION_DENIED`——正文不含任何 `licence` 字样。因此 `classifySummaryRefusal()` 把它归为通用 `http` 失败,`quotaUnavailable` 记成 `partial`/`unreachable`,而 `quotaSummarySuppressed()` 只认 `no_license`:后台每小时轮询就一直重复同一个 403。现在新增独立的 **`no_summary_access`** 判定(403 + `PERMISSION_DENIED`),并按**7 天**(对齐周配额周期)压制;无许可账号仍保持 6 小时窗口,以便新许可随时恢复。
13
+ - **两类压制现在拆开**,因为作用域不同:`quotaSummarySuppressed()` 只跳过汇总请求(管道仍刷新 `fetchAvailableModels` / 用户额度),新增的 `accountPollSuppressed()` 才决定账号是否完全退出后台轮询——只有「无许可」账号如此。若把免费账号并进 `no_license`,会连带冻结它的模型列表,所以它继续参与轮询、只是不再打那个必然被拒的端点。控制台文案改为「免费账号 · 仅限周配额」,不再是通用的刷新失败(四语言)。
14
+
3
15
  ## 0.6.41 (2026-11-19)
4
16
 
5
17
  ### English
package/dist/client.js CHANGED
@@ -80,6 +80,7 @@ window.__ModuleLoader__.load({
80
80
  "quota.refreshInProgress": "该账号正在刷新中,请稍候",
81
81
  "quota.unavailableTitle": "配额刷新失败",
82
82
  "quota.unavailable.no_license": "此账号无有效许可(接口 403)",
83
+ "quota.unavailable.no_summary_access": "免费账号 · 仅限周配额(汇总接口被拒绝)",
83
84
  "quota.unavailable.auth": "登录凭据已失效(401)",
84
85
  "quota.unavailable.unreachable": "配额接口不可达",
85
86
  "quota.unavailable.partial": "只取到模型级数据,5 小时/周额度未更新",
@@ -308,6 +309,7 @@ window.__ModuleLoader__.load({
308
309
  "quota.refreshInProgress": "A refresh is already running for this account",
309
310
  "quota.unavailableTitle": "Quota refresh failed",
310
311
  "quota.unavailable.no_license": "this account has no valid license (HTTP 403)",
312
+ "quota.unavailable.no_summary_access": "free-tier account · weekly quota only (the summary endpoint is refused)",
311
313
  "quota.unavailable.auth": "the login credential is no longer valid (401)",
312
314
  "quota.unavailable.unreachable": "the quota endpoints are unreachable",
313
315
  "quota.unavailable.partial": "only per-model data arrived; 5-hour/weekly figures are stale",
@@ -536,6 +538,7 @@ window.__ModuleLoader__.load({
536
538
  "quota.refreshInProgress": "Já existe uma atualização em andamento para esta conta",
537
539
  "quota.unavailableTitle": "Falha ao atualizar a cota",
538
540
  "quota.unavailable.no_license": "esta conta não tem uma licença válida (HTTP 403)",
541
+ "quota.unavailable.no_summary_access": "conta gratuita · apenas cota semanal (o resumo é recusado)",
539
542
  "quota.unavailable.auth": "a credencial de acesso não é mais válida (401)",
540
543
  "quota.unavailable.unreachable": "não é possível alcançar os serviços de cota",
541
544
  "quota.unavailable.partial": "só chegaram dados por modelo; os números de 5 h/semana estão desatualizados",
@@ -764,6 +767,7 @@ window.__ModuleLoader__.load({
764
767
  "quota.refreshInProgress": "Ya hay una actualización en curso para esta cuenta",
765
768
  "quota.unavailableTitle": "No se pudo actualizar la cuota",
766
769
  "quota.unavailable.no_license": "esta cuenta no tiene una licencia válida (HTTP 403)",
770
+ "quota.unavailable.no_summary_access": "cuenta gratuita · solo cuota semanal (el resumen se rechaza)",
767
771
  "quota.unavailable.auth": "la credencial de acceso ya no es válida (401)",
768
772
  "quota.unavailable.unreachable": "no se puede alcanzar los servicios de cuota",
769
773
  "quota.unavailable.partial": "solo llegaron datos por modelo; las cifras de 5 h/semana están desactualizadas",
package/dist/index.js CHANGED
@@ -574,6 +574,19 @@ function modelFamilyOf(modelId) {
574
574
  * be retried normally.
575
575
  */
576
576
  function quotaSummarySuppressed(account, now = Date.now()) {
577
+ const state = account.quotaUnavailable;
578
+ if (state === void 0) return false;
579
+ if (state.reason !== "no_license" && state.reason !== "no_summary_access") return false;
580
+ return state.retryAfter > now;
581
+ }
582
+ /**
583
+ * Whether the account should leave the background poll ENTIRELY.
584
+ *
585
+ * Only a licence-less account qualifies: it can produce no quota data at all.
586
+ * A free-tier account whose SUMMARY is refused still refreshes its model list
587
+ * and user quota, so skipping it would freeze the picker (issue #137).
588
+ */
589
+ function accountPollSuppressed(account, now = Date.now()) {
577
590
  const state = account.quotaUnavailable;
578
591
  if (state === void 0) return false;
579
592
  if (state.reason !== "no_license") return false;
@@ -655,7 +668,7 @@ function shouldPollAccount(account) {
655
668
  if (!account.enabled) return false;
656
669
  if (account.authRequired) return false;
657
670
  const now = Date.now();
658
- if (quotaSummarySuppressed(account, now)) return false;
671
+ if (accountPollSuppressed(account, now)) return false;
659
672
  for (const cd of Object.values(account.cooldowns ?? {})) if (cd && cd.cooldownUntil > now) return false;
660
673
  return true;
661
674
  }
@@ -3111,6 +3124,12 @@ const QUOTA_ENDPOINT_DOWN_MS = 6e5;
3111
3124
  */
3112
3125
  const QUOTA_LICENSE_RETRY_MS = 216e5;
3113
3126
  /**
3127
+ * How long a free-tier account's refused summary call stays suppressed.
3128
+ * Aligned with the weekly quota window: the verdict only changes when the
3129
+ * account's entitlement does, which cannot happen within hours (#137).
3130
+ */
3131
+ const QUOTA_FREE_TIER_RETRY_MS = 6048e5;
3132
+ /**
3114
3133
  * Grace the idle watchdog grants before killing a quiet child. libuv runs the
3115
3134
  * timers phase BEFORE the poll phase: when the DSH host's event loop is blocked
3116
3135
  * (a large parse, many parallel workers), an expired watchdog can fire before
@@ -39546,6 +39565,7 @@ function buildFamilyQuotas(params) {
39546
39565
  function unavailableReason(failure, hasModelData) {
39547
39566
  if (failure === null) return hasModelData ? "partial" : "unreachable";
39548
39567
  if (failure.kind === "no_license") return "no_license";
39568
+ if (failure.kind === "no_summary_access") return "no_summary_access";
39549
39569
  if (failure.kind === "auth") return "auth";
39550
39570
  if (failure.kind === "network") return "unreachable";
39551
39571
  return hasModelData ? "partial" : "unreachable";
@@ -39640,10 +39660,11 @@ async function refreshAccountQuotaPipeline(deps, account, force = false) {
39640
39660
  const failure = deps.summaryFailure?.() ?? null;
39641
39661
  const reason = unavailableReason(failure, Object.keys(modelsCatalog).length > 0);
39642
39662
  const previous = account.quotaUnavailable;
39663
+ const retryMs = reason === "no_summary_access" ? QUOTA_FREE_TIER_RETRY_MS : QUOTA_LICENSE_RETRY_MS;
39643
39664
  deps.pool.noteQuotaUnavailable(account.id, {
39644
39665
  reason,
39645
39666
  since: previous?.reason === reason ? previous.since : now,
39646
- retryAfter: now + QUOTA_LICENSE_RETRY_MS,
39667
+ retryAfter: now + retryMs,
39647
39668
  ...failure?.detail === void 0 ? {} : { detail: failure.detail }
39648
39669
  });
39649
39670
  }
@@ -39801,6 +39822,11 @@ function classifySummaryRefusal(status, bodyText = "") {
39801
39822
  status,
39802
39823
  ...detail === void 0 ? {} : { detail }
39803
39824
  };
39825
+ if (status === 403 && detail === "PERMISSION_DENIED") return {
39826
+ kind: "no_summary_access",
39827
+ status,
39828
+ detail
39829
+ };
39804
39830
  return {
39805
39831
  kind: "http",
39806
39832
  status,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.6.41",
3
+ "version": "0.6.42",
4
4
  "description": "Google Antigravity (agy CLI) models for DeepSeek Harness — stream Gemini/Claude/GPT-OSS subscriptions into DSH with thinking, tool activity, token usage and in-GUI Google OAuth login.",
5
5
  "type": "module",
6
6
  "license": "MIT",