dsh-github-copilot 0.4.2-alpha.18.dsh.0.2.0.rc.2 → 0.4.2-alpha.19.dsh.0.2.0.rc.2

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.2-alpha.19.dsh.0.2.0.rc.2 (prepared)
4
+
5
+ - Restore the explicit visible-history recovery entry when opening an original
6
+ scheduled Session after its managed replay-scope failure, including cold
7
+ Host startup, expired temporary fingerprints and a changed picker (#433).
8
+ - Refold only fixed terminal failure evidence through official rc.2's public
9
+ Session projection; ignore inherited failures and clear on a later turn.
10
+ Preserve explicit loss disclosure and persistent policy CAS, independent of
11
+ temporary diagnostic reads. Never reconstruct account origin or request
12
+ fingerprints, rewrite history, automatically enable loss or rerun a task.
13
+ - Keep the exact official DSH `0.2.0-rc.2` dependency graph and pi-ai `0.87.1`.
14
+ Publication does not install the plugin or restart a local Desktop.
15
+
3
16
  ## 0.4.2-alpha.18.dsh.0.2.0.rc.2 (prepared)
4
17
 
5
18
  - Stop rejecting a valid native-projected image format solely because it is absent
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  GitHub Copilot account discovery, contextual Auto routing and hosted search for DSH. The plugin reuses DSH's published native adapter, retaining a profile-wide account default with independent Session next-turn choices; it does not patch Core or maintain a second model catalog.
10
10
 
11
- **Stable release: [`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1); prepared maintenance prerelease: `0.4.2-alpha.18.dsh.0.2.0.rc.2`.** This rc.2 image-format mitigation is not yet published; its versioned Release commands below apply only after publication. This legacy maintenance increment preserves increasing SemVer and identifies its exact Core; it does not change newer Core-specific release sequences. `0.4.2-alpha.1` was not published: its release preflight failed, and its immutable tag will not be reused. Supported host: official DSH / Windows Desktop `0.2.0-rc.2`. The stable version is also published on npm's `latest` dist-tag; prereleases remain on their channel tags. Stability-channel promotion does not expand the qualified host baseline or prove live account, model, search or Desktop health. Earlier DSH pins are historical evidence, not supported installation targets. Published, installed in a profile and loaded by a running Host are separate states.
11
+ **Stable release: [`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1); prepared maintenance prerelease: `0.4.2-alpha.19.dsh.0.2.0.rc.2`.** This rc.2 cold-open replay-recovery fix is not yet published; its versioned Release commands below apply only after publication. This legacy maintenance increment preserves increasing SemVer and identifies its exact Core; it does not change newer Core-specific release sequences. `0.4.2-alpha.1` was not published: its release preflight failed, and its immutable tag will not be reused. Supported host: official DSH / Windows Desktop `0.2.0-rc.2`. The stable version is also published on npm's `latest` dist-tag; prereleases remain on their channel tags. Stability-channel promotion does not expand the qualified host baseline or prove live account, model, search or Desktop health. Earlier DSH pins are historical evidence, not supported installation targets. Published, installed in a profile and loaded by a running Host are separate states.
12
12
 
13
13
  **Native refresh protection:** 0.4.1 introduced preservation of already-dispatched HTTP streams across proven plugin-owned refresh with unchanged account, endpoint and entitlements. Versions through 0.4.2-alpha.13 still missed this proof across real Cordis traced service faces; 0.4.2-alpha.14 fixes that identity mismatch. Subsequent requests use freshly validated auth and metadata. Unknown/external credential notifications, revocation, cancellation and provider rejections remain explicit—not a promise of invisible recovery or automatic retry. See [the refresh boundary](./docs/copilot-accounts.md#native-oauth-refresh-and-dispatched-requests-385).
14
14
 
@@ -131,10 +131,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
131
131
  For a **standalone named profile**:
132
132
 
133
133
  ```sh
134
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.18.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.18.dsh.0.2.0.rc.2.tgz
134
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.19.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.19.dsh.0.2.0.rc.2.tgz
135
135
  ```
136
136
 
137
- For **Desktop**, its native package manager accepts an exact npm spec, for example `dsh-github-copilot@0.4.2-alpha.18.dsh.0.2.0.rc.2` after publication; stable versions publish on npm's `latest` dist-tag and prereleases on their channel tags. The official rc.2 **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
137
+ For **Desktop**, its native package manager accepts an exact npm spec, for example `dsh-github-copilot@0.4.2-alpha.19.dsh.0.2.0.rc.2` after publication; stable versions publish on npm's `latest` dist-tag and prereleases on their channel tags. The official rc.2 **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
138
138
 
139
139
  After an approved reload/restart:
140
140
 
@@ -286,6 +286,8 @@ The Credits account panel shows the current account and **Switch account**. Its
286
286
 
287
287
  The name “New Session” describes default inheritance, not a one-message feature: an enabled Session policy is frozen at admission for each subsequent managed Copilot turn and also governs that Session's managed native compaction summaries. For an existing eligible Session, select the managed Copilot model, open the composer **Credits/usage** pill, expand **Visible-history continuation**, then choose **On** in **Session policy**. This control appears only for an open Session using the managed account-discovered route; it is not shown for the canonical/native route. The loss disclosure is shown before the choice. Enabling is explicit consent to omit prior encrypted reasoning and embedded summaries, even on the same account; hidden details may be lost, while visible messages, tool relations and source history remain. The policy persists across account switches and restarts until changed. It takes effect on the next turn; an already admitted turn keeps its captured policy. With continuation off, switching to a different account offers persistent enable, keep off or cancel—there is no next-turn-only choice. `/copilot-compact visible-history` is a separate one-time operation through the selected recovery engine, not the persistent Session setting. Neither path auto-sends/retries or cures quota/context limits; exact replay failures use the same persistent Session policy and require a separate native retry. The pinned Core lacks a public Models deep link, so Chat omits the nonfunctional management entry.
288
288
 
289
+ If a scheduled/background task ends with the exact managed replay-scope error, open its **original Session**: Replay recovery remains available after Host restart, temporary fingerprint expiry or a changed picker. A strict public Session projection retains only fixed failure classification and bounded turn/sequence/route evidence, not account origin or old request authorization. Copied/forked failures are ignored; a later native turn clears the historical notice. Explicit enable still discloses hidden-reasoning loss and saves only the existing persistent Session policy. It does not rerun the task: check partial results and side effects before choosing a separate retry to avoid duplicate actions.
290
+
289
291
  Context evidence and Replay recovery use compact, centered notices bounded by the native composer width. Model/item counts and status refresh live in collapsed technical details; loss consent remains explicit. Context sampling warns only for a concrete incident, can be dismissed for that Session/incident, and never asserts the native meter's current value; native statistics stay unchanged. Switching accounts does not make old encrypted reasoning portable. The concise scope error points to explicit recovery or a new conversation; bounded, sanitized dispatch counts stay in Host diagnostics, not the main error. **Authorized** means permission is ready, not that a message was sent or recovery succeeded.
290
292
 
291
293
  ## Ownership and further reading
@@ -326,14 +328,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
326
328
  GitHub Releases and npm distribute the same original verified tarball. Pin a version; verify Release SHA-256 or npm `dist.integrity`. Never repack an immutable release or move/reuse its tag.
327
329
 
328
330
  ```sh
329
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.18.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.18.dsh.0.2.0.rc.2.tgz
330
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.18.dsh.0.2.0.rc.2/SHA256SUMS
331
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.19.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.19.dsh.0.2.0.rc.2.tgz
332
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.19.dsh.0.2.0.rc.2/SHA256SUMS
331
333
  sha256sum --check SHA256SUMS
332
334
  ```
333
335
 
334
336
  ```powershell
335
337
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
336
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.2-alpha.18.dsh.0.2.0.rc.2.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
338
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.2-alpha.19.dsh.0.2.0.rc.2.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
337
339
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
338
340
  ```
339
341
 
package/README.zh.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  为 DSH 提供 GitHub Copilot 账号模型发现、上下文 Auto 选模和 hosted search。插件复用 DSH 公开的原生适配器,保留 profile 全局默认账号,并支持 Session 后续 turn 指定独立账号;不修改 Core,也不维护第二套模型目录。
10
10
 
11
- **稳定版:[`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1);待发布维护预览版:`0.4.2-alpha.18.dsh.0.2.0.rc.2`。** 此 rc.2 图片格式缓解尚未发布,下方版本化 Release 命令仅在发布后适用。这是旧维护线的递增版本,以后缀标明精确 Core,不改变较新 Core 的独立版本序列。`0.4.2-alpha.1` 的发布预检失败,因此未发布;其不可变 tag 不会复用。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。稳定版也发布到 npm 的 `latest` dist-tag;预发布版本仍使用各自渠道 tag。稳定渠道不扩大已验证的宿主基线,也不证明实时账号、模型、搜索或 Desktop 健康状态。较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。
11
+ **稳定版:[`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1);待发布维护预览版:`0.4.2-alpha.19.dsh.0.2.0.rc.2`。** 此 rc.2 冷开回放恢复修复尚未发布,下方版本化 Release 命令仅在发布后适用。这是旧维护线的递增版本,以后缀标明精确 Core,不改变较新 Core 的独立版本序列。`0.4.2-alpha.1` 的发布预检失败,因此未发布;其不可变 tag 不会复用。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。稳定版也发布到 npm 的 `latest` dist-tag;预发布版本仍使用各自渠道 tag。稳定渠道不扩大已验证的宿主基线,也不证明实时账号、模型、搜索或 Desktop 健康状态。较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。
12
12
 
13
13
  **原生刷新保护:**0.4.1 引入了窄范围保护:仅在插件拥有的原生刷新被精确验证,且账号、端点与权限连续时,保留已发出的 HTTP 流。但截至 0.4.2-alpha.13,真实 Cordis 服务代理身份不一致仍会导致保护证据匹配失败;0.4.2-alpha.14 修复此问题。后续请求重新验证认证与模型元数据。未知/外部凭据通知、撤销、取消与供应商拒绝仍明确报错,不承诺所有刷新无感,也不自动重试。参见[刷新边界](./docs/copilot-accounts.md#native-oauth-refresh-and-dispatched-requests-385)。
14
14
 
@@ -113,10 +113,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
113
113
  **独立具名 profile**:
114
114
 
115
115
  ```sh
116
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.18.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.18.dsh.0.2.0.rc.2.tgz
116
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.19.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.19.dsh.0.2.0.rc.2.tgz
117
117
  ```
118
118
 
119
- **Desktop** 原生包管理器接受精确 npm spec,例如发布后的 `dsh-github-copilot@0.4.2-alpha.18.dsh.0.2.0.rc.2`;稳定版发布到 npm `latest` dist-tag,预发布版使用对应渠道 tag。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
119
+ **Desktop** 原生包管理器接受精确 npm spec,例如发布后的 `dsh-github-copilot@0.4.2-alpha.19.dsh.0.2.0.rc.2`;稳定版发布到 npm `latest` dist-tag,预发布版使用对应渠道 tag。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
120
120
 
121
121
  经批准 reload/restart 后:
122
122
 
@@ -265,6 +265,8 @@ Credits 账号面板显示当前账号和 **切换**,下拉菜单只列已有
265
265
 
266
266
  “New Session”说的是默认继承对象,并非只处理第一条消息:启用的 Session policy 会在每个后续托管 Copilot turn 准入时冻结,并同样控制该 Session 的托管原生压缩摘要。为已有且符合条件的 Session 开启时,选择托管 Copilot 模型,点击输入框的 **Credits/usage** 控件,展开 **Visible-history continuation**,再于 **Session policy** 选择 **On**。此控件只出现在仍打开且使用托管账号发现路由的 Session;canonical/native 路由不显示。选择前可见有损说明。开启即明确同意省略旧加密推理及内嵌摘要,同账号也适用;隐藏细节可能丢失,可见消息、工具关系和原历史保留。该策略跨账号切换与重启持久保留,直到更改;从下一 turn 生效,已准入 turn 保持原先冻结的策略。关闭时切换到不同账号会提供持续开启、保持关闭或取消,没有仅下一轮模式。`/copilot-compact visible-history` 是通过已选恢复引擎执行的另一种一次性操作,不等同于持久 Session 设置。两者都不会自动发送/重试,也不解决额度或上下文超限;精确回放失败仍使用同一个持久策略,用户另行点击原生重试。当前 Core 没有公开 Models 直达 API,Chat 不展示不可用的管理入口。
267
267
 
268
+ 定时/后台任务以精确的托管 replay-scope 错误结束后,请打开**原 Session**:即使 Host 已重启、临时请求指纹过期或 picker 改变,仍可看到回放恢复入口。严格公开 Session projection 只保留固定失败分类及有界 turn/序号/路由证据,不恢复账号来源或旧请求授权。忽略复制/fork 的失败,下一原生 turn 开始时清除历史提示。显式开启仍先说明隐藏推理损失,只保存既有持久 Session 策略,不重新执行任务;另行重试前请核对部分结果和副作用,避免重复执行。
269
+
268
270
  上下文证据与回放恢复以紧凑、居中提示显示在输入框上方,宽度遵循原生输入框。模型、项数和状态刷新收进默认折叠的技术详情;有损恢复仍需明确确认。上下文采样只在明确事件时告警,可按 Session/事件关闭,且不会断言原生仪表当前值;原生统计不变。切换账号不会让旧加密推理自动变得可跨账号使用。简短 scope 错误指向显式恢复或新会话;有界、脱敏的请求结构计数留在 Host 诊断中,不挤占主错误。**已授权**只表示授权已准备好,不表示消息已发送或恢复已成功。
269
271
 
270
272
  ## 所有权与深入阅读
@@ -305,14 +307,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
305
307
  GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
306
308
 
307
309
  ```sh
308
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.18.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.18.dsh.0.2.0.rc.2.tgz
309
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.18.dsh.0.2.0.rc.2/SHA256SUMS
310
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.19.dsh.0.2.0.rc.2/dsh-github-copilot-0.4.2-alpha.19.dsh.0.2.0.rc.2.tgz
311
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.2-alpha.19.dsh.0.2.0.rc.2/SHA256SUMS
310
312
  sha256sum --check SHA256SUMS
311
313
  ```
312
314
 
313
315
  ```powershell
314
316
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
315
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.2-alpha.18.dsh.0.2.0.rc.2.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
317
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.2-alpha.19.dsh.0.2.0.rc.2.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
316
318
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
317
319
  ```
318
320
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.2-alpha.18.dsh.0.2.0.rc.2"
11
+ "version": "0.4.2-alpha.19.dsh.0.2.0.rc.2"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -901,6 +901,7 @@
901
901
  {"file": "src/replay-recovery.ts", "marker": "class ReplayRecoveryStore"},
902
902
  {"file": "src/replay-recovery-host.ts", "marker": "extends TypertRemoteService"},
903
903
  {"file": "src/replay-recovery-host.ts", "marker": "COPILOT_REPLAY_RECOVERY_TURN_ACTIVE"},
904
+ {"file": "src/replay-recovery-evidence.ts", "marker": "githubCopilotReplayRecoveryEvidence"},
904
905
  {"file": "src/replay-recovery-remote.ts", "marker": "githubCopilotReplayRecovery.setEnabled"},
905
906
  {"file": "src/replay-recovery-remote.ts", "marker": "githubCopilotReplayRecovery.authorize"},
906
907
  {"file": "src/replay-recovery-ui.ts", "marker": "recovery: true"},
@@ -913,6 +914,8 @@
913
914
  {"file": "tests/replay-recovery.spec.ts", "name": "admits only the next matching native turn, including its steps and retries"},
914
915
  {"file": "tests/replay-recovery-ui.spec.ts", "name": "enables only persistent Session continuation after loss disclosure, without legacy authorization or sending"},
915
916
  {"file": "tests/replay-recovery-ui.spec.ts", "name": "is absent normally, reads on settled turns without polling and resets dismissal only for new evidence"},
917
+ {"file": "tests/replay-recovery-ui.spec.ts", "name": "keeps explicit recovery reachable after reopening a failed scheduled Session without Host fingerprints"},
918
+ {"file": "tests/replay-recovery-evidence.spec.ts", "name": "cold-folds the native rc.2 saved failure and removes only its public projection registration"},
916
919
  {"file": "tests/preview-route.spec.ts", "name": "offers exact failed replay only to its initiating session and recovers after explicit confirmation"},
917
920
  {"file": "tests/fixtures/remote-core.fixture.ts", "name": "binds explicit replay recovery through native Client and %s Host gateways"}
918
921
  ]
package/lib/client.js CHANGED
@@ -6480,7 +6480,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6480
6480
  ]);
6481
6481
  //#endregion
6482
6482
  //#region lib/types/turn-request-models.js
6483
- const count$2 = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
6483
+ const count$3 = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
6484
6484
  const RequestedModelsSchema = object({
6485
6485
  routes: array(object({
6486
6486
  provider: string().trim().min(1).max(1024),
@@ -6488,11 +6488,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6488
6488
  }).strict()).max(32),
6489
6489
  incomplete: boolean()
6490
6490
  }).strict();
6491
- const row$1 = RequestedModelsSchema.extend({ turn: count$2 }).strict();
6491
+ const row$1 = RequestedModelsSchema.extend({ turn: count$3 }).strict();
6492
6492
  object({
6493
6493
  active: object({
6494
- turn: count$2,
6495
- step: count$2.nullable()
6494
+ turn: count$3,
6495
+ step: count$3.nullable()
6496
6496
  }).strict().nullable(),
6497
6497
  turns: array(row$1).max(128)
6498
6498
  }).strict();
@@ -7554,7 +7554,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7554
7554
  };
7555
7555
  //#endregion
7556
7556
  //#region package.json
7557
- var version = "0.4.2-alpha.18.dsh.0.2.0.rc.2";
7557
+ var version = "0.4.2-alpha.19.dsh.0.2.0.rc.2";
7558
7558
  //#endregion
7559
7559
  //#region lib/types/diagnostics-client.js
7560
7560
  let owner;
@@ -8706,14 +8706,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8706
8706
  function record$5(value) {
8707
8707
  return typeof value === "object" && value !== null && !Array.isArray(value);
8708
8708
  }
8709
- function count$1(value) {
8709
+ function count$2(value) {
8710
8710
  return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
8711
8711
  }
8712
8712
  function isTurnUsageEvidence(value) {
8713
- return record$5(value) && typeof value.ended === "boolean" && typeof value.hasStart === "boolean" && count$1(value.localPreDispatchBlocks) && count$1(value.unreportedAttempts) && (value.requestBodyTimeouts === void 0 || count$1(value.requestBodyTimeouts) && value.requestBodyTimeouts <= value.unreportedAttempts) && (value.timeoutDetails === void 0 || Array.isArray(value.timeoutDetails) && value.timeoutDetails.length <= 8 && count$1(value.requestBodyTimeouts) && value.timeoutDetails.length <= value.requestBodyTimeouts && value.timeoutDetails.every((detail) => record$5(detail) && typeof detail.recovered === "boolean" && (detail.step === void 0 || count$1(detail.step)) && (detail.seq === void 0 || count$1(detail.seq)) && (!detail.recovered || count$1(detail.step) && count$1(detail.seq))));
8713
+ return record$5(value) && typeof value.ended === "boolean" && typeof value.hasStart === "boolean" && count$2(value.localPreDispatchBlocks) && count$2(value.unreportedAttempts) && (value.requestBodyTimeouts === void 0 || count$2(value.requestBodyTimeouts) && value.requestBodyTimeouts <= value.unreportedAttempts) && (value.timeoutDetails === void 0 || Array.isArray(value.timeoutDetails) && value.timeoutDetails.length <= 8 && count$2(value.requestBodyTimeouts) && value.timeoutDetails.length <= value.requestBodyTimeouts && value.timeoutDetails.every((detail) => record$5(detail) && typeof detail.recovered === "boolean" && (detail.step === void 0 || count$2(detail.step)) && (detail.seq === void 0 || count$2(detail.seq)) && (!detail.recovered || count$2(detail.step) && count$2(detail.seq))));
8714
8714
  }
8715
8715
  function coordinates(event) {
8716
- if (!record$5(event) || typeof event.type !== "string" || !record$5(event.data) || !count$1(event.data.turn) || ![
8716
+ if (!record$5(event) || typeof event.type !== "string" || !record$5(event.data) || !count$2(event.data.turn) || ![
8717
8717
  "turn/start",
8718
8718
  "turn/end",
8719
8719
  "step/start",
@@ -8728,7 +8728,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8728
8728
  turn: event.data.turn,
8729
8729
  type: event.type,
8730
8730
  data: event.data,
8731
- ...count$1(event.seq) ? { seq: event.seq } : {}
8731
+ ...count$2(event.seq) ? { seq: event.seq } : {}
8732
8732
  };
8733
8733
  }
8734
8734
  function finishReason(data) {
@@ -8760,7 +8760,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8760
8760
  const match = /^Copilot local estimated input budget exceeded \((\d+) estimated tokens > (\d+) budget tokens\); requesting stock compaction before provider dispatch\.$/.exec(failure.message);
8761
8761
  if (!match) return false;
8762
8762
  const estimate = Number(match[1]), budget = Number(match[2]);
8763
- return count$1(estimate) && count$1(budget) && budget > 0 && estimate > budget;
8763
+ return count$2(estimate) && count$2(budget) && budget > 0 && estimate > budget;
8764
8764
  }
8765
8765
  function fold(state, event) {
8766
8766
  const parsed = coordinates(event);
@@ -8778,7 +8778,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8778
8778
  let pending = state?.pending;
8779
8779
  if (pending !== void 0) {
8780
8780
  const same = parsed.data.step === pending.step && parsed.seq !== void 0 && parsed.seq > pending.seq;
8781
- if (same && parsed.seq !== void 0 && parsed.type === "llm/retry" && pending.phase === "failed" && typeof parsed.data.retryId === "string" && parsed.data.retryId.length > 0 && parsed.data.retryId.length <= 256 && count$1(parsed.data.retry) && parsed.data.retry > 0) pending = {
8781
+ if (same && parsed.seq !== void 0 && parsed.type === "llm/retry" && pending.phase === "failed" && typeof parsed.data.retryId === "string" && parsed.data.retryId.length > 0 && parsed.data.retryId.length <= 256 && count$2(parsed.data.retry) && parsed.data.retry > 0) pending = {
8782
8782
  ...pending,
8783
8783
  seq: parsed.seq,
8784
8784
  phase: "scheduled",
@@ -8801,11 +8801,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8801
8801
  if (timeout && (details?.length ?? 0) < 8) {
8802
8802
  const index = details?.length ?? 0;
8803
8803
  details = [...details ?? [], {
8804
- ...count$1(parsed.data.step) ? { step: parsed.data.step } : {},
8804
+ ...count$2(parsed.data.step) ? { step: parsed.data.step } : {},
8805
8805
  ...parsed.seq !== void 0 ? { seq: parsed.seq } : {},
8806
8806
  recovered: false
8807
8807
  }];
8808
- if (parsed.type === "assistant/attempt" && count$1(parsed.data.step) && parsed.seq !== void 0) pending = {
8808
+ if (parsed.type === "assistant/attempt" && count$2(parsed.data.step) && parsed.seq !== void 0) pending = {
8809
8809
  index,
8810
8810
  step: parsed.data.step,
8811
8811
  seq: parsed.seq,
@@ -8829,7 +8829,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8829
8829
  }
8830
8830
  /** Native completed-tail evidence gates the notice; native totals are never replaced. */
8831
8831
  function turnUsageDiagnostic(turn, tail, evidence, copilot) {
8832
- if (!count$1(turn) || !record$5(tail) || tail.turn !== turn || !count$1(tail.seq) || tail.tokenUsage !== void 0) return void 0;
8832
+ if (!count$2(turn) || !record$5(tail) || tail.turn !== turn || !count$2(tail.seq) || tail.tokenUsage !== void 0) return void 0;
8833
8833
  const parsed = isTurnUsageEvidence(evidence) && evidence.ended ? evidence : void 0;
8834
8834
  if (!copilot && (parsed?.localPreDispatchBlocks ?? 0) === 0) return void 0;
8835
8835
  return {
@@ -12518,28 +12518,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12518
12518
  //#endregion
12519
12519
  //#region lib/types/context-evidence.js
12520
12520
  const COPILOT_CONTEXT_EVIDENCE = "githubCopilotContextEvidence";
12521
- const count = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
12521
+ const count$1 = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
12522
12522
  const routeSchema = object({
12523
12523
  provider: string().min(1),
12524
12524
  model: string().min(1)
12525
12525
  }).strict();
12526
12526
  const sampleSchema = object({
12527
- tokens: count,
12528
- seq: count,
12527
+ tokens: count$1,
12528
+ seq: count$1,
12529
12529
  route: routeSchema
12530
12530
  }).strict();
12531
12531
  const incidentSchema = object({
12532
12532
  kind: _enum(["failed-zero", "invalid-sample"]),
12533
- seq: count
12533
+ seq: count$1
12534
12534
  }).strict();
12535
12535
  const stepSchema = object({
12536
- turn: count,
12537
- step: count
12536
+ turn: count$1,
12537
+ step: count$1
12538
12538
  }).strict();
12539
12539
  const compactionSchema = object({
12540
12540
  id: string().min(1).max(256),
12541
- startSeq: count,
12542
- endSeq: count.nullable(),
12541
+ startSeq: count$1,
12542
+ endSeq: count$1.nullable(),
12543
12543
  state: _enum([
12544
12544
  "running",
12545
12545
  "completed",
@@ -12547,7 +12547,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12547
12547
  "unknown"
12548
12548
  ]),
12549
12549
  checkpoint: boolean(),
12550
- headerSeq: count.nullable(),
12550
+ headerSeq: count$1.nullable(),
12551
12551
  requestRoute: routeSchema.nullable(),
12552
12552
  step: stepSchema.nullable(),
12553
12553
  request: _enum([
@@ -12576,12 +12576,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12576
12576
  activeStep: stepSchema.nullable().optional()
12577
12577
  }).strict();
12578
12578
  object({
12579
- inputTokens: count,
12580
- outputTokens: count,
12581
- cacheReadTokens: count.optional(),
12582
- cacheWriteTokens: count.optional(),
12583
- totalTokens: count.optional(),
12584
- reasoningTokens: count.optional()
12579
+ inputTokens: count$1,
12580
+ outputTokens: count$1,
12581
+ cacheReadTokens: count$1.optional(),
12582
+ cacheWriteTokens: count$1.optional(),
12583
+ totalTokens: count$1.optional(),
12584
+ reasoningTokens: count$1.optional()
12585
12585
  });
12586
12586
  //#endregion
12587
12587
  //#region lib/types/compaction-continuation-ui.js
@@ -13006,12 +13006,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13006
13006
  };
13007
13007
  }
13008
13008
  //#endregion
13009
+ //#region lib/types/replay-recovery-evidence.js
13010
+ const REPLAY_RECOVERY_EVIDENCE = "githubCopilotReplayRecoveryEvidence";
13011
+ const count = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
13012
+ const ReplayRecoveryEvidenceSchema = object({
13013
+ inherited: count,
13014
+ turn: count.nullable(),
13015
+ managed: boolean(),
13016
+ failureSeq: count.nullable()
13017
+ }).strict();
13018
+ //#endregion
13009
13019
  //#region lib/types/replay-recovery-ui.js
13010
13020
  const noop = () => {};
13011
13021
  function record(value) {
13012
13022
  return value !== null && typeof value === "object" && !Array.isArray(value);
13013
13023
  }
13014
- function ReplayRecoveryCard({ sessionId, remote, continuation, locale = "en", running = false, refreshKey = "" }) {
13024
+ function ReplayRecoveryCard({ sessionId, remote, continuation, locale = "en", running = false, refreshKey = "", failureKey }) {
13015
13025
  const zh = locale.startsWith("zh");
13016
13026
  const [view, setView] = (0, react.useState)();
13017
13027
  const [busy, setBusy] = (0, react.useState)(false);
@@ -13081,8 +13091,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13081
13091
  const button = composerNoticeButtonStyle;
13082
13092
  const disabled = busy || running;
13083
13093
  const evidence = view && view.state !== "unavailable" ? view : void 0;
13084
- if (!error && !evidence && !hadEvidence) return null;
13085
- if (!error && evidence && dismissed === evidence.revision) return (0, react.createElement)("button", {
13094
+ const noticeKey = failureKey ?? evidence?.revision;
13095
+ if (!error && !noticeKey && !hadEvidence) return null;
13096
+ if (noticeKey && dismissed === noticeKey) return (0, react.createElement)("button", {
13086
13097
  type: "button",
13087
13098
  style: {
13088
13099
  ...button,
@@ -13105,17 +13116,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13105
13116
  color: "var(--dsw-alias-label-primary, CanvasText)",
13106
13117
  fontWeight: 600
13107
13118
  }
13108
- }, evidence ? zh ? "旧推理回放被拒绝" : "Old reasoning replay was rejected" : zh ? "回放恢复" : "Replay recovery"), error ? (0, react.createElement)("p", {
13119
+ }, noticeKey ? zh ? "旧推理回放被拒绝" : "Old reasoning replay was rejected" : zh ? "回放恢复" : "Replay recovery"), error ? (0, react.createElement)("p", {
13109
13120
  role: "alert",
13110
13121
  style: composerNoticeParagraphStyle
13111
- }, zh ? "无法读取或更改恢复状态。请等当前轮结束后重新读取;旧确认可能已过期。" : "Recovery could not be read or changed. Wait for the active turn to end and read again; the prior confirmation may have expired.") : null, view?.state === "unavailable" ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? "失败证据已失效,没有当前可用的失败诊断。此状态不改变本 Session 的降级续聊策略。" : "Failure evidence expired; no current failure diagnostics are available. This does not change the Session continuation policy.") : null, evidence ? (0, react.createElement)("div", null, (0, react.createElement)(SessionContinuationCard, {
13112
- key: evidence.revision,
13122
+ }, zh ? "无法读取或更改恢复状态。请等当前轮结束后重新读取;旧确认可能已过期。" : "Recovery could not be read or changed. Wait for the active turn to end and read again; the prior confirmation may have expired.") : null, view?.state === "unavailable" ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, failureKey ? zh ? "原会话记录了回放拒绝;当前请求指纹不可用。这里只提供本 Session 的显式降级策略,不恢复旧请求授权。" : "The original Session recorded a replay rejection; current request fingerprints are unavailable. Only the explicit Session continuation policy is offered, not authorization for the old request." : zh ? "失败证据已失效,没有当前可用的失败诊断。此状态不改变本 Session 的降级续聊策略。" : "Failure evidence expired; no current failure diagnostics are available. This does not change the Session continuation policy.") : null, noticeKey ? (0, react.createElement)("div", null, (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? "定时任务失败后,请打开原 Session,在此选择恢复策略。开启不会重新运行任务;重试前请先核对是否已有部分结果,避免重复执行。" : "After a scheduled task fails, open the original Session to choose recovery here. Enabling does not rerun the task; check for partial results before retrying to avoid duplicate actions."), (0, react.createElement)(SessionContinuationCard, {
13123
+ key: noticeKey,
13113
13124
  sessionId,
13114
13125
  remote: continuation,
13115
13126
  locale,
13116
- running: running || busy,
13127
+ running,
13117
13128
  recovery: true,
13118
- onCancel: () => setDismissed(evidence.revision)
13129
+ onCancel: () => setDismissed(noticeKey)
13119
13130
  })) : null, running ? (0, react.createElement)("p", {
13120
13131
  role: "status",
13121
13132
  style: composerNoticeParagraphStyle
@@ -13141,18 +13152,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13141
13152
  function Surface({ runtime, remote, continuation, locale }) {
13142
13153
  const valid = runtime.useSession((value) => record(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
13143
13154
  const selected = runtime.useProjection("modelSelection");
13155
+ const historical = ReplayRecoveryEvidenceSchema.safeParse(runtime.useProjection(REPLAY_RECOVERY_EVIDENCE));
13156
+ const failureKey = historical.success && historical.data.failureSeq !== null ? `turn-end:${historical.data.failureSeq}` : void 0;
13144
13157
  const running = runtime.useSession((value) => !record(value) || value.running !== false);
13145
13158
  const lastError = runtime.useSession((value) => record(value) && typeof value.lastAgentError === "string" ? value.lastAgentError : "");
13146
13159
  const language = (0, react.useSyncExternalStore)((listener) => locale?.subscribe(listener) ?? noop, () => locale?.getLocale().active ?? "en", () => "en");
13147
- if (!valid || !record(selected) || !record(selected.next) || selected.next.provider !== "github-copilot-preview") return null;
13160
+ if (!valid || !failureKey && (!record(selected) || !record(selected.next) || selected.next.provider !== "github-copilot-preview")) return null;
13148
13161
  return (0, react.createElement)("div", null, (0, react.createElement)(ReplayRecoveryCard, {
13149
- key: JSON.stringify([runtime.sessionId, selected.next.model]),
13162
+ key: runtime.sessionId,
13150
13163
  sessionId: runtime.sessionId,
13151
13164
  remote,
13152
13165
  continuation,
13153
13166
  locale: language,
13154
13167
  running,
13155
- refreshKey: lastError
13168
+ refreshKey: JSON.stringify([lastError, failureKey]),
13169
+ failureKey
13156
13170
  }));
13157
13171
  }
13158
13172
  function registerReplayRecoveryUi(ctx) {