dsh-agy-link 0.6.40 → 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 +22 -0
- package/dist/cli-image.mjs +6 -6
- package/dist/client.js +4 -0
- package/dist/index.js +34 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
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
|
+
|
|
15
|
+
## 0.6.41 (2026-11-19)
|
|
16
|
+
|
|
17
|
+
### English
|
|
18
|
+
|
|
19
|
+
- **Fix(regression from v0.6.27): plan mode is decided from the current turn, not from history (fixes #136).** `isPlanMode()` scanned **every** message backwards, so once a session's history contained `"You are in plan mode"` — in source code the user read, in tool output, or in a planning turn that had already exited — every later turn was forced to `--mode plan`. With `permissionMode: skip` that flipped the run back to `request-review`, denied every `run_command` / outside-workspace `read_file`, and ended with DSH rejecting the synthesized `exit_plan_mode` (`only available in plan mode`); the session was unrecoverable without starting a new one. `isPlanMode()` now reads **only the last message**, and only when it is a `user`/`system` turn. Two further guards: the presence of `exit_plan_mode` in the tool list is no longer treated as proof of plan mode (current DSH ships it in standard mode too), and a `exit_plan_mode is only available in plan mode` rejection is decisive evidence that the session is NOT planning, so a false positive can self-correct instead of locking the session. Regression tests cover history-in-tool-output, a genuine current-turn instruction, and the rejection signal, plus an adapter-level check that `--dangerously-skip-permissions` survives a historical mention.
|
|
20
|
+
|
|
21
|
+
### 中文
|
|
22
|
+
|
|
23
|
+
- **修复(v0.6.27 引入的回归):plan 模式只看当前轮,不再扫历史(修复 #136)。** `isPlanMode()` 原先**从后往前扫描全部消息**,只要会话历史里出现过 `"You are in plan mode"`——用户读过的源码、工具输出、或一次已经退出的规划轮——之后每一轮都会被强制 `--mode plan`。在 `permissionMode: skip` 下,这会退回 `request-review`、拒绝所有 `run_command` 与工作区外 `read_file`,并在回合结束时报 `exit_plan_mode is only available in plan mode`;会话无法恢复,只能新开。现在 `isPlanMode()` **只读最后一条消息**,且要求其角色为 `user`/`system`。另加两道保险:工具列表里出现 `exit_plan_mode` 不再被当作 plan 模式的证据(当前 DSH 标准模式也会下发该工具);出现 `exit_plan_mode is only available in plan mode` 的拒绝即判定为非 plan,使误判能自我纠正而不是永久锁死。回归测试覆盖「历史工具输出误命中」「当前轮真实指令」「拒绝信号」三种情形,并补一条 adapter 级验证:历史提及不得抹掉 `--dangerously-skip-permissions`。
|
|
24
|
+
|
|
3
25
|
## 0.6.40 (2026-11-19)
|
|
4
26
|
|
|
5
27
|
### English
|
package/dist/cli-image.mjs
CHANGED
|
@@ -1938,12 +1938,12 @@ function resolveGoalContext(messages, live) {
|
|
|
1938
1938
|
* DSH plan-mode injects "You are in plan mode" into the runtime context prompt.
|
|
1939
1939
|
*/
|
|
1940
1940
|
function isPlanMode(messages) {
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
return
|
|
1941
|
+
const last = messages[messages.length - 1];
|
|
1942
|
+
if (!last) return false;
|
|
1943
|
+
const text = extractText$1(last);
|
|
1944
|
+
if (/exit_plan_mode is only available in plan mode/i.test(text)) return false;
|
|
1945
|
+
if (last.role !== "user" && last.role !== "system") return false;
|
|
1946
|
+
return text.includes("You are in plan mode");
|
|
1947
1947
|
}
|
|
1948
1948
|
/**
|
|
1949
1949
|
* Harness-injected user-role texts (turn-preparation time samples, system
|
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 (
|
|
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
|
|
@@ -29870,12 +29889,12 @@ function resolveGoalContext(messages, live) {
|
|
|
29870
29889
|
* DSH plan-mode injects "You are in plan mode" into the runtime context prompt.
|
|
29871
29890
|
*/
|
|
29872
29891
|
function isPlanMode(messages) {
|
|
29873
|
-
|
|
29874
|
-
|
|
29875
|
-
|
|
29876
|
-
|
|
29877
|
-
|
|
29878
|
-
return
|
|
29892
|
+
const last = messages[messages.length - 1];
|
|
29893
|
+
if (!last) return false;
|
|
29894
|
+
const text = extractText(last);
|
|
29895
|
+
if (/exit_plan_mode is only available in plan mode/i.test(text)) return false;
|
|
29896
|
+
if (last.role !== "user" && last.role !== "system") return false;
|
|
29897
|
+
return text.includes("You are in plan mode");
|
|
29879
29898
|
}
|
|
29880
29899
|
/**
|
|
29881
29900
|
* Harness-injected user-role texts (turn-preparation time samples, system
|
|
@@ -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 +
|
|
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.
|
|
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",
|