dsh-github-copilot 0.4.0-alpha.60 → 0.4.0-alpha.61

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,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## 0.4.0-alpha.60 (prepared)
3
+ ## 0.4.0-alpha.61 (prepared)
4
+
5
+ - Preserve the exact normalized managed Responses request across Core's freshly prepared retry attempts only after the previous request actually received HTTP 408. Short-lived state is scoped to the original turn signal, Session, model and account proof, and cleared on new step/turn end. Retry-only item references or incomplete ID-bearing items must identify matching complete prior items without contradictory fields, and all other payload and transcript bytes must agree; changed inputs, concurrent requests and cold resumes fail closed (#217).
6
+ - Keep native retry policy, SDK transport, durable replay, credentials, and model selection unchanged. A synthetic native-SDK regression covers two 408 responses followed by a reference-only third attempt; real account acceptance and Desktop installation remain unverified.
7
+
8
+ ## 0.4.0-alpha.60 (released)
4
9
 
5
10
  - Add exact account-model exclusions under **GitHub Copilot → Manage → Model preferences**, with local search, visible/excluded counts, explicit **Exclude/Restore** actions, and retained rows for excluded IDs temporarily absent from account metadata (#192).
6
11
  - Remove excluded IDs from the managed picker, every Auto candidate pool, aggregate Auto modalities, hosted-search route facts, and request-budget admission. Stale picker or direct requests fail with `COPILOT_PREVIEW_MODEL_EXCLUDED`; Auto fails closed when no eligible model remains.
package/README.md CHANGED
@@ -98,7 +98,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
98
98
 
99
99
  ## Install and sign in
100
100
 
101
- The commands below target the package version `0.4.0-alpha.60`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
101
+ The commands below target the package version `0.4.0-alpha.61`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
102
102
 
103
103
  Before installing/updating, unpack the **checksum-verified** archive into a temporary directory and run its read-only composition preflight (replace all paths with absolute paths for the intended profile):
104
104
 
@@ -111,10 +111,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
111
111
  For a standalone named profile only, the supported CLI command is:
112
112
 
113
113
  ```sh
114
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
114
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.61/dsh-github-copilot-0.4.0-alpha.61.tgz
115
115
  ```
116
116
 
117
- For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.60` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
117
+ For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.61` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
118
118
 
119
119
  Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in**, and complete the GitHub device-code flow. Plugin installation changes the selected profile; activation follows that profile's normal reload/restart policy.
120
120
 
@@ -157,7 +157,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
157
157
  5. Confirm **Signed in** and inspect the automatic discovery result before asking the user to choose a model. Already-signed-in Models opening ensures missing/stale metadata automatically; fresh ready cache makes no request. Use visible **Retry** for errors or **Manage → Refresh models** for an intentional forced update, not routine setup. Status alone does not discover, and login, metadata and successful model calls remain separate evidence.
158
158
  6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
159
159
 
160
- GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.60`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
160
+ GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.61`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
161
161
 
162
162
  **Desktop package-update and Web-lifecycle boundaries:** the native manager's `restart-required` result for an in-place installed-package upgrade is authoritative and distinct from plugin-bundle removal/re-add behavior. Any disable, removal, or upgrade involving service recomposition (`cordis.patch.yml`, such as the isolated routed web search layer) may leave dependent entries pending until Desktop is fully exited and cold-restarted. If the native manager reports only entries such as `pending (waiting for service: web)` while this plugin already shows **Off**, the requested disabled state has been persisted; cold-restart Desktop instead of repeatedly toggling or reinstalling the plugin. Other errors are not covered by this guidance and must still be investigated.
163
163
 
@@ -361,7 +361,7 @@ Existing installations must follow the [single-route migration guide](./docs/sin
361
361
  - **Signed in but a new model is missing:** opening Models ensures missing/stale metadata automatically; inspect accepted/rejected models for `github-copilot-preview`. Use **Retry** after errors or **Manage → Refresh models** to intentionally refresh before the TTL expires. Unsupported endpoints or incomplete metadata produce diagnostics, not static-catalog fallback. Do not repeat login or disable validation.
362
362
  - **`AUTH` / “API key is invalid” after signing in again:** this label does not prove the conversation cached an old key. On the managed route, an observed model HTTP 401 retires only the exact current token proof, except the narrowly recognized Responses replay-scope rejection described below. The failed request stays failed: no automatic message replay, logout or model switch. Your next request (or model discovery) can perform one native OAuth renewal even before stored expiry, then validate account metadata. Repeated rejection is bounded per account by `accountModelFailureCooldownMs` (five minutes by default, at least one second); even forced discovery cannot bypass this recovery cooldown. If the renewed token is still rejected, wait for the cooldown and inspect account/permission status rather than repeatedly signing out. A new sign-in is not overwritten by a late old response. HTTP 403, network errors and strings mentioning 401 do not trigger this recovery. It observes native HTTP transport only; WebSocket recovery and live endpoint acceptance are not claimed.
363
363
  - **`input item ID does not belong to this connection` / `input item does not belong to this connection`:** these are the two observed Responses history-reference rejection messages, not proof of an invalid API key. On `github-copilot-preview` only, a bounded clone of the actual HTTP 401 JSON identifies these exact uncoded errors, with matching outer/nested messages; the plugin reports `INVALID_REQUEST` with `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH` without retiring shared account proof, aborting neighboring calls, renewing credentials or retrying the request. Unknown, malformed, oversized or ambiguous error bodies retain native authentication handling. Historical error records are not rewritten.
364
- - **Managed Responses replay compatibility:** the public SDK `onPayload` hook normalizes only direct item IDs on complete assistant messages, function calls and reasoning items carrying encrypted content. It preserves `call_id` pairing, encrypted bytes, public summaries, `phase`, nested IDs and durable history. Reference-only, incomplete or unsupported ID-bearing items fail explicitly with `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`; no hidden history trimming or model switch occurs. This is Copilot-specific, not a universal OpenAI schema change: public OpenAI types require IDs on some replay forms. Native SDK/pinned-Core synthetic tests verify transport shape and isolation, not real Copilot acceptance of an old conversation. Canonical `github-copilot`, other providers and non-Responses protocols are unchanged; install/activation and old-session endpoint acceptance require separate review.
364
+ - **Managed Responses replay compatibility:** the public SDK `onPayload` hook normalizes only direct item IDs on complete assistant messages, function calls and reasoning items carrying encrypted content. After an actual HTTP 408, a newly prepared attempt in the same Core step may reuse the exact previously normalized wire payload if it substitutes only matching item-ID references or incomplete ID-bearing items without conflicting fields, and the complete transcript and every other request field agree. The entry is bound to the original turn signal, Session, model and account proof; it expires after 60 seconds, is limited to 2 MiB, and is cleared on the next step/turn end, concurrency, cancellation, credential discontinuity or a different request. It neither creates a retry nor bypasses native policy. Cold-history reference-only, incomplete or unsupported ID-bearing items still fail explicitly with `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`. `call_id` pairing, encrypted bytes, public summaries, `phase`, nested IDs and durable history are unchanged; no hidden history trimming or model switch occurs. This is Copilot-specific, not a universal OpenAI schema change: public OpenAI types require IDs on some replay forms. Native SDK/pinned-Core synthetic tests verify transport shape and isolation, not real Copilot acceptance of an old conversation. Canonical `github-copilot`, other providers and non-Responses protocols are unchanged; install/activation and old-session endpoint acceptance require separate review.
365
365
  - **Quota TLS verification failure (`COPILOT_USAGE_TLS` / `UNABLE_TO_VERIFY_LEAF_SIGNATURE`):** the quota request uses a reusable, TLS-verified agent combining Node's default and system CA roots, including trusted Windows roots installed by Watt Toolkit / Steam++-style accelerators. `NODE_USE_SYSTEM_CA=1` is no longer required for this plugin-owned request after the updated plugin is loaded; it can still matter for unrelated Desktop traffic. `COPILOT_USAGE_TRUST_UNAVAILABLE` means system roots could not be loaded or the agent could not be created, and no request was sent. Check the Host certificate store and proxy configuration without disabling verification; neither diagnostic proves a specific proxy or live account status.
366
366
  - **Scope rejection persists after alpha.36:** its original exact-message classifier missed the observed wording without `ID`. Alpha.37 only closes that classification/isolation gap; it does not further rewrite payloads or prove that the rejected history can be replayed. The parallel-request failure is reproduced with the native adapter in a fixture that does not load cron. This establishes a companion error-handling defect, not the upstream reason for rejecting the original item. `Request aborted` alone does not identify its cause; `COPILOT_MODEL_SOURCE_AUTH_FAILED` is a generalized pre-catalog auth-resolution failure, whose cached result may recur without another auth attempt. Compare actual loaded version, request provenance and the same history/model before attributing another machine's success to a plugin downgrade or cron removal. Do not silently discard encrypted reasoning, retry old business work or reset credentials.
367
367
  - **Canonical route says `not-configured`:** with configured login this is normal managed-only mode; inspect account discovery separately rather than creating a native profile.
@@ -430,8 +430,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
430
430
  `package.json` declares public npm distribution. A release tag must equal `v${package.json.version}`. Versions use standard SemVer prerelease labels (`alpha`, `beta`, or `rc`), each with its matching npm dist-tag; only stable versions use `latest`. The Release workflow performs the frozen install and complete verification gate, packs once (or recovers the original archive on retry), verifies `SHA256SUMS`, publishes the immutable GitHub Release and then publishes those same bytes to npm through OIDC. Either channel failing means delivery is incomplete. First package creation needs an authorized maintainer; staging requires an existing package and is not a first-package bootstrap. Historical releases are not republished.
431
431
 
432
432
  ```sh
433
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
434
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/SHA256SUMS
433
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.61/dsh-github-copilot-0.4.0-alpha.61.tgz
434
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.61/SHA256SUMS
435
435
  sha256sum --check SHA256SUMS
436
436
  ```
437
437
 
@@ -439,7 +439,7 @@ PowerShell can verify the same two downloaded files with:
439
439
 
440
440
  ```powershell
441
441
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
442
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.60.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
442
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.61.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
443
443
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
444
444
  ```
445
445
 
package/README.zh.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
22
22
 
23
- > 当前文档与安装命令对应版本 `0.4.0-alpha.60`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
23
+ > 当前文档与安装命令对应版本 `0.4.0-alpha.61`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
24
24
 
25
25
  Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
26
26
 
@@ -113,10 +113,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
113
113
  仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
114
114
 
115
115
  ```sh
116
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
116
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.61/dsh-github-copilot-0.4.0-alpha.61.tgz
117
117
  ```
118
118
 
119
- Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.60`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
119
+ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.61`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
120
120
 
121
121
  随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
122
122
 
@@ -159,7 +159,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
159
159
  5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
160
160
  6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
161
161
 
162
- 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.60`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
162
+ 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.61`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
163
163
 
164
164
  **Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
165
165
 
@@ -372,7 +372,7 @@ Copilot Session 如需更宽的文件或命令权限,必须在调用前选择
372
372
  - **已登录但新模型缺失:**打开 Models 会自动确保缺失/过期元数据,查看 `github-copilot-preview` 的接受/拒绝结果。错误可点 **Retry**;希望在 TTL 到期前有意强制更新时,使用 **Manage → Refresh models**。接口不支持或元数据不完整时显示诊断,不退回静态目录,也不要反复登录或关闭校验。
373
373
  - **重新登录后出现 `AUTH`/“API key is invalid”:**这个标签并不证明旧会话缓存了旧 Key。托管路由实际收到模型 HTTP 401 后,只撤销与当前请求精确匹配的 Token 证明,但下述严格识别的 Responses 历史引用错误除外;该次请求仍然失败,不自动重发消息、退出登录或切换模型。下一次请求(或模型发现)可通过原生 OAuth 进行一次续期,即使记录的有效期尚未到期,随后重新校验账号模型元数据。连续拒绝受账号级 `accountModelFailureCooldownMs` 限制(默认五分钟,至少一秒),强制发现也不能绕过该恢复冷却。续期后仍被拒绝时,请等待冷却并检查账号/权限状态,不要反复退出登录。迟到的旧响应不能覆盖新登录;403、网络错误和仅含 401 字样的错误不触发恢复。这里只观察原生 HTTP 传输,不声称覆盖 WebSocket,也不代表真实端点验收通过。
374
374
  - **`input item ID does not belong to this connection`/`input item does not belong to this connection`:**这是已观测到的两种 Responses 历史引用拒绝文案,不证明 API key 无效。仅在 `github-copilot-preview` 上,插件对实际 HTTP 401 JSON 的有界副本严格识别这两种无错误码的精确文案,并要求外层/内层消息一致,返回带 `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH` 的 `INVALID_REQUEST`;不撤销共享账号证明、不连带中止其他请求、不续期凭据,也不自动重发。未知、格式错误、过大或存在歧义的错误体继续沿用原生鉴权处理;历史报错记录不会被改写。
375
- - **托管 Responses 历史兼容处理:**通过 SDK 公开 `onPayload` 回调,只处理完整 assistant 消息、函数调用以及携带加密内容的 reasoning 条目的直接 item ID。保留 `call_id` 配对、加密字节、公开摘要、`phase`、嵌套 ID 和持久化历史。仅含引用、不完整或不支持的带 ID 条目明确报 `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`,不暗中裁剪历史或切换模型。这是 Copilot 特定兼容策略,不是对通用 OpenAI 协议的改写:公开 OpenAI 类型要求部分回放条目具有 ID。原生 SDK/固定 Core 的合成测试只证明请求形态与隔离行为,不证明真实 Copilot 已接受旧会话。Core 自有 `github-copilot`、其他供应方和非 Responses 协议保持不变;安装、激活和旧会话端点验收需分别确认。
375
+ - **托管 Responses 历史兼容处理:**通过 SDK 公开 `onPayload` 回调,只处理完整 assistant 消息、函数调用以及携带加密内容的 reasoning 条目的直接 item ID。只有上次真实收到 HTTP 408、同一 Core step 重新 prepare 的后续尝试仅把对应完整条目替换成匹配 ID 的引用或无冲突字段的不完整带 ID 条目,且完整上下文与其余请求字段完全一致时,才复用之前规范化的相同 wire payload。此状态绑定原始 turn signal、Session、模型及账号证明,60 秒内、2 MiB 内有效;新 step/turn 结束、并发、取消、凭据变更或请求变化均会清除,不新增重试,也不绕过原生策略。冷历史中仅含引用、不完整或不支持的带 ID 条目仍明确报 `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`。`call_id` 配对、加密字节、公开摘要、`phase`、嵌套 ID 和持久化历史不变,不暗中裁剪历史或切换模型。这是 Copilot 特定兼容策略,不是对通用 OpenAI 协议的改写:公开 OpenAI 类型要求部分回放条目具有 ID。原生 SDK/固定 Core 的合成测试只证明请求形态与隔离行为,不证明真实 Copilot 已接受旧会话。Core 自有 `github-copilot`、其他供应方和非 Responses 协议保持不变;安装、激活和旧会话端点验收需分别确认。
376
376
  - **用量与额度 TLS 验签失败(`COPILOT_USAGE_TLS` / `UNABLE_TO_VERIFY_LEAF_SIGNATURE`):**额度请求使用可复用的专用 agent,组合 Node 默认与系统证书信任根,包括 Watt Toolkit/Steam++ 等加速器安装的受信任 Windows 根证书。更新插件实际加载后,此请求不再需要 `NODE_USE_SYSTEM_CA=1`;其他 Desktop 流量仍可能依赖该进程设置。`COPILOT_USAGE_TRUST_UNAVAILABLE` 表示无法读取系统证书或创建 agent,请求未发送。请检查 Host 证书库和代理配置,不要关闭 TLS 验签;仅凭诊断无法证明具体代理路径或账号状态。
377
377
  - **alpha.36 后仍有历史作用域拒绝:**原先的精确分类漏掉了不含 `ID` 的已观测文案。Alpha.37 只补齐分类与隔离,不进一步改写 payload,也不证明原被拒绝的历史已经可用。不加载 cron 的原生适配器测试已复现并行请求被连带中断,证明的是 Copilot 插件错误处理缺陷,而不是上游拒绝条目的原始原因。`Request aborted` 单独不能确定取消来源;`COPILOT_MODEL_SOURCE_AUTH_FAILED` 是目录发现前认证解析的泛化错误,缓存结果可重复返回而不代表再次认证。判断另一台机器为何正常,需对齐实际加载版本、请求来源和同一历史/模型,不能直接归因于降级插件或卸载 cron。不要暗中丢弃加密 reasoning、重发旧业务或重置凭据。
378
378
  - **Canonical 状态为 `not-configured`:**已登录时属于正常单托管路由模式;账号发现就绪与否另行检查,不需要创建原生 profile。
@@ -441,8 +441,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
441
441
  `package.json` 声明公开 npm 分发。Release tag 必须严格等于 `v${package.json.version}`。预发布使用 `alpha`、`beta` 或 `rc` 及对应 npm dist-tag,只有稳定版使用 `latest`。Release workflow 执行 frozen install 和完整门禁,只打包一次(重试恢复原始归档),验证 `SHA256SUMS`,发布不可变 GitHub Release,再通过 OIDC 将同一份字节发布到 npm。任一渠道失败都表示交付未完成。首次建包须由获准环境中的维护者完成;staging 要求包已存在,不能代替首次建包。不会批量补发历史版本。
442
442
 
443
443
  ```sh
444
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
445
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/SHA256SUMS
444
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.61/dsh-github-copilot-0.4.0-alpha.61.tgz
445
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.61/SHA256SUMS
446
446
  sha256sum --check SHA256SUMS
447
447
  ```
448
448
 
@@ -450,7 +450,7 @@ PowerShell 可以对已下载的同一组文件执行:
450
450
 
451
451
  ```powershell
452
452
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
453
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.60.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
453
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.61.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
454
454
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
455
455
  ```
456
456
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.60"
11
+ "version": "0.4.0-alpha.61"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -558,6 +558,7 @@
558
558
  ],
559
559
  "sourceMarkers": [
560
560
  {"file": "src/responses-replay-compat.ts", "marker": "normalizeCopilotResponsesPayload"},
561
+ {"file": "src/responses-replay-compat.ts", "marker": "ResponsesRetryReplay"},
561
562
  {"file": "src/responses-replay-compat.ts", "marker": "isCopilotInputItemScopeError"},
562
563
  {"file": "src/responses-replay-compat.ts", "marker": "input item does not belong to this connection"},
563
564
  {"file": "src/preview-provider.ts", "marker": "onPayload"},
@@ -565,6 +566,9 @@
565
566
  ],
566
567
  "tests": [
567
568
  {"file": "tests/preview-provider.spec.ts", "name": "normalizes only wire item IDs after native serialization while preserving durable replay and tool pairing"},
569
+ {"file": "tests/preview-provider.spec.ts", "name": "sends identical normalized bytes on the third Core-style attempt after two HTTP 408s"},
570
+ {"file": "tests/responses-replay-compat.spec.ts", "name": "refuses a new step, session, signal, cold resume, stale entry and concurrent requests"},
571
+ {"file": "tests/preview-route.spec.ts", "name": "clears only the matching Session retry cache on %s across fresh Core preparations"},
568
572
  {"file": "tests/preview-route.spec.ts", "name": "classifies \"$message\" in a $envelope Responses 401 locally and reuses the same credential without discovery or refresh"},
569
573
  {"file": "tests/preview-route.spec.ts", "name": "does not abort a parallel native request when another dispatch receives a replay-scope 401: %s"},
570
574
  {"file": "tests/preview-route.spec.ts", "name": "does not retain a replay-scope failure across independent dispatches of one native prepared lease: %s"}
package/lib/index.js CHANGED
@@ -1646,7 +1646,7 @@ let GitHubCopilotUsageController = (() => {
1646
1646
  //#endregion
1647
1647
  //#region package.json
1648
1648
  var name$1 = "dsh-github-copilot";
1649
- var version = "0.4.0-alpha.60";
1649
+ var version = "0.4.0-alpha.61";
1650
1650
  //#endregion
1651
1651
  //#region lib/types/probe.js
1652
1652
  /**
@@ -5207,6 +5207,112 @@ function normalizeCopilotResponsesPayload(payload) {
5207
5207
  throw new CopilotResponsesReplayError("invalid-payload");
5208
5208
  }
5209
5209
  }
5210
+ const retryLifetimeMs = 6e4;
5211
+ const maxRetryBytes = 2097152;
5212
+ function cacheBytes(value) {
5213
+ let json;
5214
+ try {
5215
+ json = JSON.stringify(value);
5216
+ } catch {
5217
+ return;
5218
+ }
5219
+ if (json === void 0 || Buffer.byteLength(json, "utf8") > maxRetryBytes) return void 0;
5220
+ return json;
5221
+ }
5222
+ /** A single lease can admit one HTTP-verified retry at a time; it never reads durable history. */
5223
+ var ResponsesRetryReplay = class {
5224
+ snapshot;
5225
+ active = 0;
5226
+ disposed = false;
5227
+ dispose() {
5228
+ this.disposed = true;
5229
+ this.snapshot = void 0;
5230
+ }
5231
+ belongsTo(sessionId) {
5232
+ return this.snapshot?.sessionId === sessionId;
5233
+ }
5234
+ begin(context, signal, sessionId, modelId) {
5235
+ const contextBytes = cacheBytes(context);
5236
+ const overlapping = this.active++ !== 0;
5237
+ if (overlapping) this.snapshot = void 0;
5238
+ const previous = this.snapshot;
5239
+ if (previous !== void 0 && (signal !== previous.signal || signal?.aborted || previous.sessionId !== sessionId || previous.modelId !== modelId || previous.context !== contextBytes || Date.now() - previous.at >= retryLifetimeMs)) this.snapshot = void 0;
5240
+ const eligible = contextBytes !== void 0 && !overlapping && !this.disposed && !signal?.aborted && this.snapshot;
5241
+ let candidate;
5242
+ let payloadBytes;
5243
+ let finished = false;
5244
+ let observed = false;
5245
+ return {
5246
+ normalize: (payload) => {
5247
+ if (this.disposed || signal?.aborted) throw new CopilotResponsesReplayError();
5248
+ const rawBytes = cacheBytes(payload);
5249
+ let normalized;
5250
+ let reused = false;
5251
+ try {
5252
+ normalized = normalizeCopilotResponsesPayload(payload);
5253
+ } catch (error) {
5254
+ if (!(error instanceof CopilotResponsesReplayError) || !eligible || !isRecord$1(payload) || !Array.isArray(payload.input) || !isRecord$1(eligible.raw) || !Array.isArray(eligible.raw.input)) {
5255
+ this.snapshot = void 0;
5256
+ throw error;
5257
+ }
5258
+ try {
5259
+ const prior = eligible.raw.input;
5260
+ if (payload.input.length !== prior.length) throw error;
5261
+ let references = 0;
5262
+ const restored = payload.input.map((item, index) => {
5263
+ if (!isRecord$1(item) || !Object.hasOwn(item, "id")) return item;
5264
+ const original = prior[index];
5265
+ if (!isRecord$1(original) || !nonemptyString(item.id) || original.id !== item.id || ![
5266
+ "reasoning",
5267
+ "message",
5268
+ "function_call"
5269
+ ].includes(String(original.type)) || normalizeItem(original) === original) throw error;
5270
+ if (item.type === "item_reference") {
5271
+ if (Object.keys(item).length !== 2) throw error;
5272
+ } else if (item.type !== original.type || Object.keys(item).length >= Object.keys(original).length || Object.entries(item).some(([key, value]) => !Object.hasOwn(original, key) || cacheBytes(value) !== cacheBytes(original[key]))) throw error;
5273
+ references++;
5274
+ return original;
5275
+ });
5276
+ if (references === 0 || cacheBytes({
5277
+ ...payload,
5278
+ input: restored
5279
+ }) !== cacheBytes(eligible.raw)) throw error;
5280
+ } catch {
5281
+ this.snapshot = void 0;
5282
+ throw error;
5283
+ }
5284
+ normalized = JSON.parse(eligible.normalized);
5285
+ reused = true;
5286
+ }
5287
+ payloadBytes = cacheBytes(normalized);
5288
+ candidate = signal === void 0 || !sessionId || !modelId || contextBytes === void 0 || rawBytes === void 0 || payloadBytes === void 0 ? void 0 : {
5289
+ raw: JSON.parse(rawBytes),
5290
+ normalized: payloadBytes,
5291
+ context: contextBytes,
5292
+ signal,
5293
+ sessionId,
5294
+ modelId,
5295
+ at: Date.now()
5296
+ };
5297
+ if (reused && eligible) candidate = {
5298
+ ...eligible,
5299
+ at: Date.now()
5300
+ };
5301
+ return normalized;
5302
+ },
5303
+ observe: (body, status) => {
5304
+ observed = true;
5305
+ this.snapshot = !this.disposed && !signal?.aborted && this.active === 1 && !overlapping && status === 408 && candidate !== void 0 && body === payloadBytes ? candidate : void 0;
5306
+ },
5307
+ finish: () => {
5308
+ if (finished) return;
5309
+ finished = true;
5310
+ this.active--;
5311
+ if (!observed || signal?.aborted || this.disposed || overlapping) this.snapshot = void 0;
5312
+ }
5313
+ };
5314
+ }
5315
+ };
5210
5316
  const scopeMessages = /* @__PURE__ */ new Set(["input item ID does not belong to this connection", "input item does not belong to this connection"]);
5211
5317
  const maxErrorBytes = 8192;
5212
5318
  const errorReadTimeoutMs = 250;
@@ -5458,6 +5564,13 @@ function createAccountProvider(descriptors, guard, baseURL) {
5458
5564
  headers["x-api-key"] = null;
5459
5565
  let unauthorized = false;
5460
5566
  const responses = model.api === "openai-responses";
5567
+ let retry;
5568
+ try {
5569
+ retry = responses ? guard.retryReplay?.begin(context, guard.retrySignal, options?.sessionId, model.id) : void 0;
5570
+ } catch (error) {
5571
+ lease.release();
5572
+ throw error;
5573
+ }
5461
5574
  const reportReplayFailure = (error) => {
5462
5575
  if (lease.signal.aborted || options.signal?.aborted) return;
5463
5576
  try {
@@ -5468,7 +5581,8 @@ function createAccountProvider(descriptors, guard, baseURL) {
5468
5581
  const replacement = await options.onPayload?.(payload, selectedModel);
5469
5582
  if (lease.signal.aborted || options.signal?.aborted) throw new Error("COPILOT_MANAGED_ABORTED");
5470
5583
  try {
5471
- return normalizeCopilotResponsesPayload(replacement === void 0 ? payload : replacement);
5584
+ const effective = replacement === void 0 ? payload : replacement;
5585
+ return retry === void 0 ? normalizeCopilotResponsesPayload(effective) : retry.normalize(effective);
5472
5586
  } catch (error) {
5473
5587
  if (error instanceof CopilotResponsesReplayError) reportReplayFailure(error);
5474
5588
  throw error;
@@ -5476,7 +5590,14 @@ function createAccountProvider(descriptors, guard, baseURL) {
5476
5590
  } : options.onPayload;
5477
5591
  const fetch = options.fetch ?? globalThis.fetch;
5478
5592
  const observeResponse = async (input, init) => {
5479
- const response = await fetch(input, init);
5593
+ let response;
5594
+ try {
5595
+ response = await fetch(input, init);
5596
+ } catch (error) {
5597
+ retry?.observe(void 0, 0);
5598
+ throw error;
5599
+ }
5600
+ retry?.observe(typeof init?.body === "string" ? init.body : void 0, response.status);
5480
5601
  if (response.status === 401) {
5481
5602
  if (responses && await isCopilotInputItemScopeError(response, lease.signal)) reportReplayFailure(new CopilotResponsesReplayError("scope-mismatch"));
5482
5603
  else unauthorized = true;
@@ -5497,6 +5618,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
5497
5618
  onPayload
5498
5619
  };
5499
5620
  if (!hasApi(model, "openai-responses") && !hasApi(model, "openai-completions") && !hasApi(model, "anthropic-messages")) {
5621
+ retry?.finish();
5500
5622
  lease.release();
5501
5623
  throw new Error("COPILOT_MANAGED_PROTOCOL_UNSUPPORTED");
5502
5624
  }
@@ -5507,6 +5629,8 @@ function createAccountProvider(descriptors, guard, baseURL) {
5507
5629
  yield event;
5508
5630
  }
5509
5631
  } finally {
5632
+ if (lease.signal.aborted || options.signal?.aborted) retry?.observe(void 0, 0);
5633
+ retry?.finish();
5510
5634
  lease.release();
5511
5635
  if (unauthorized && !guard.signal.aborted && !options.signal?.aborted) try {
5512
5636
  guard.onUnauthorized?.();
@@ -6814,6 +6938,7 @@ var PreviewLifetime = class {
6814
6938
  excluded;
6815
6939
  controller = new AbortController();
6816
6940
  wires = /* @__PURE__ */ new Set();
6941
+ retryEntries = /* @__PURE__ */ new Map();
6817
6942
  revision = 0;
6818
6943
  active = true;
6819
6944
  constructor(credentials, source, proofFor, displayProofFor, excluded) {
@@ -6829,15 +6954,52 @@ var PreviewLifetime = class {
6829
6954
  isCurrent(revision) {
6830
6955
  return this.active && revision === this.revision;
6831
6956
  }
6957
+ removeRetry(signal) {
6958
+ const entry = this.retryEntries.get(signal);
6959
+ if (entry === void 0) return;
6960
+ signal.removeEventListener("abort", entry.onAbort);
6961
+ entry.replay.dispose();
6962
+ this.retryEntries.delete(signal);
6963
+ }
6964
+ clearRetries() {
6965
+ for (const signal of this.retryEntries.keys()) this.removeRetry(signal);
6966
+ }
6967
+ clearSessionRetries(sessionId) {
6968
+ for (const [signal, entry] of this.retryEntries) if (entry.replay.belongsTo(sessionId)) this.removeRetry(signal);
6969
+ }
6970
+ retryFor(signal, snapshot, proof, model) {
6971
+ let entry = this.retryEntries.get(signal);
6972
+ if (entry !== void 0 && (entry.snapshot !== snapshot || entry.proof !== proof || entry.model !== model || entry.revision !== this.revision || Date.now() - entry.at >= 6e4)) {
6973
+ this.removeRetry(signal);
6974
+ entry = void 0;
6975
+ }
6976
+ if (entry !== void 0) return entry.replay;
6977
+ if (this.retryEntries.size >= 16) this.removeRetry(this.retryEntries.keys().next().value);
6978
+ const replay = new ResponsesRetryReplay();
6979
+ const onAbort = () => this.removeRetry(signal);
6980
+ signal.addEventListener("abort", onAbort, { once: true });
6981
+ this.retryEntries.set(signal, {
6982
+ replay,
6983
+ snapshot,
6984
+ proof,
6985
+ model,
6986
+ revision: this.revision,
6987
+ at: Date.now(),
6988
+ onAbort
6989
+ });
6990
+ return replay;
6991
+ }
6832
6992
  change() {
6833
6993
  this.assertActive();
6834
6994
  this.revision++;
6995
+ this.clearRetries();
6835
6996
  this.source.invalidate();
6836
6997
  for (const wire of this.wires) wire.abort(new ManagedWireAbortError("COPILOT_PREVIEW_CREDENTIAL_CHANGED"));
6837
6998
  }
6838
6999
  dispose() {
6839
7000
  if (!this.active) return;
6840
7001
  this.active = false;
7002
+ this.clearRetries();
6841
7003
  this.source.dispose();
6842
7004
  this.controller.abort(new ManagedWireAbortError("COPILOT_PREVIEW_DISPOSED"));
6843
7005
  for (const wire of this.wires) wire.abort();
@@ -6900,6 +7062,11 @@ var PreviewLifetime = class {
6900
7062
  started: false
6901
7063
  };
6902
7064
  this.entitled(lease, grant, model);
7065
+ if (signal !== void 0 && !signal.aborted) return {
7066
+ ...lease,
7067
+ retrySignal: signal,
7068
+ retryReplay: this.retryFor(signal, snapshot, proof, model)
7069
+ };
6903
7070
  return lease;
6904
7071
  }
6905
7072
  account(lease, grant) {
@@ -6925,7 +7092,11 @@ var PreviewLifetime = class {
6925
7092
  guard(lease) {
6926
7093
  return {
6927
7094
  signal: lease?.signal ?? this.controller.signal,
6928
- ...lease === void 0 ? {} : { selectedModelId: lease.descriptor.id },
7095
+ ...lease === void 0 ? {} : {
7096
+ selectedModelId: lease.descriptor.id,
7097
+ retryReplay: lease.retryReplay,
7098
+ retrySignal: lease.retrySignal
7099
+ },
6929
7100
  assertActive: () => this.assertActive(),
6930
7101
  assertAccount: (grant) => this.account(lease, grant),
6931
7102
  assertEntitled: (grant, model) => this.entitled(lease, grant, model),
@@ -7255,6 +7426,9 @@ function apply$1(ctx, config = {}) {
7255
7426
  const displayProofFor = (snapshot) => source.readDisplaySnapshot() === snapshot && provenSnapshot === snapshot && snapshotProof?.accountKey === snapshot.accountKey ? snapshotProof : void 0;
7256
7427
  const proofFor = (snapshot) => source.readSnapshot() === snapshot && snapshotProof !== void 0 && snapshotProof.expires > Date.now() ? displayProofFor(snapshot) : void 0;
7257
7428
  const lifetime = new PreviewLifetime(store, source, proofFor, displayProofFor, (modelId) => excludedModels().has(modelId));
7429
+ const removeStepListener = ctx.on("session/event", (session, event) => {
7430
+ if (event.type === "step/start" || event.type === "turn/end") lifetime.clearSessionRetries(session.id);
7431
+ });
7258
7432
  const template = resolvedProfile(createAccountProvider([], lifetime.guard(), "https://api.individual.githubcopilot.com").provider, requestConfig);
7259
7433
  let configured = false;
7260
7434
  let readError;
@@ -7529,6 +7703,7 @@ function apply$1(ctx, config = {}) {
7529
7703
  });
7530
7704
  ctx.effect(() => () => {
7531
7705
  lifetime.dispose();
7706
+ removeStepListener();
7532
7707
  removeListener();
7533
7708
  removeSettings();
7534
7709
  removeAutoRoute();
@@ -3,6 +3,7 @@ import type { AccountModelApi, AccountModelDescriptor } from './account-model-ca
3
3
  import type { CoreCompatibleProvider } from './pi-provider-bridge.ts';
4
4
  import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
5
5
  import { CopilotResponsesReplayError } from './responses-replay-compat.ts';
6
+ import type { ResponsesRetryReplay } from './responses-replay-compat.ts';
6
7
  export type ManagedWireAbortCode = 'COPILOT_PREVIEW_CREDENTIAL_CHANGED' | 'COPILOT_PREVIEW_DISPOSED';
7
8
  /** Identity, not upstream error text, proves that the plugin revoked this wire. */
8
9
  export declare class ManagedWireAbortError extends Error {
@@ -28,6 +29,8 @@ export interface PreviewProviderGuard {
28
29
  /** Guard for one selected model in an account-bound descriptor snapshot. */
29
30
  export interface AccountProviderGuard extends PreviewProviderGuard {
30
31
  readonly selectedModelId?: string;
32
+ readonly retryReplay?: ResponsesRetryReplay;
33
+ readonly retrySignal?: AbortSignal;
31
34
  /** Per-dispatch admission after native context conversion, before starting a model wire. */
32
35
  inspectRequest?(model: Model<Api>, context: TranscriptContext, options?: StreamOptions): void;
33
36
  assertEntitled(credential: GitHubCopilotOAuthCredential, modelId: string): void;
@@ -5,6 +5,20 @@ export declare class CopilotResponsesReplayError extends Error {
5
5
  }
6
6
  /** Normalize only the outgoing managed Responses payload, never stored history/context. */
7
7
  export declare function normalizeCopilotResponsesPayload(payload: unknown): unknown;
8
+ /** A single lease can admit one HTTP-verified retry at a time; it never reads durable history. */
9
+ export declare class ResponsesRetryReplay {
10
+ private snapshot;
11
+ private active;
12
+ private disposed;
13
+ dispose(): void;
14
+ belongsTo(sessionId: string): boolean;
15
+ begin(context: unknown, signal?: AbortSignal, sessionId?: string, modelId?: string): ResponsesRetryAttempt;
16
+ }
17
+ export interface ResponsesRetryAttempt {
18
+ normalize(payload: unknown): unknown;
19
+ observe(body: string | undefined, status: number): void;
20
+ finish(): void;
21
+ }
8
22
  /** Observe a cloned, bounded 401 body; every unknown result retains native auth behavior. */
9
23
  export declare function isCopilotInputItemScopeError(response: Response, signal?: AbortSignal): Promise<boolean>;
10
24
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-github-copilot",
3
3
  "description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
4
- "version": "0.4.0-alpha.60",
4
+ "version": "0.4.0-alpha.61",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",