dsh-github-copilot 0.4.0-alpha.121 → 0.4.0-alpha.122
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/AGENTS.md +12 -4
- package/README.md +7 -7
- package/README.zh.md +7 -7
- package/deployment-baseline.json +5 -1
- package/docs/auto-high-cost.md +22 -0
- package/docs/manual-compaction-recovery.md +3 -1
- package/docs/session-continuation.md +23 -4
- package/lib/client.js +99 -5
- package/lib/client.js.map +1 -1
- package/lib/index.js +181 -36
- package/lib/remote.js +16 -1
- package/lib/types/compaction-continuation-ui.d.ts +11 -0
- package/lib/types/compaction-continuation.d.ts +48 -0
- package/lib/types/session-continuation-host.d.ts +4 -1
- package/lib/types/session-continuation-types.d.ts +27 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -45,15 +45,23 @@ This repository owns eleven narrow surfaces:
|
|
|
45
45
|
10. Managed-route estimated input/output admission, optional exact-request pressure signalling through official compaction recovery, and supported low summary effort only when no effort is already resolved. See [compaction budgets](./docs/copilot-compaction.md). Preserve truthful capacities, requested output caps, native errors/replay and transaction ownership; no hidden history trimming, wire chunking, competing compaction service or automatic model switch. The separately selected, single-service [recovery engine](./docs/manual-compaction-recovery.md) defaults to automatic segmented recovery for known oversized summaries or one typed native capacity failure through the public subclass hook. Preserve `automaticRecovery: false`, native `auto: false`, scopes and custom engines; at most 16 physical calls including a failed first attempt, no recursive retry or 408/network/auth/quota fallback. Installation alone never selects or migrates an engine.
|
|
46
46
|
11. Optional account quota reads and a session-scoped composer usage control through public credentials, strict Remotes and additive slots. Keep account billing-cycle credits separate from context tokens and session cost. Missing, pooled, legacy and stale data must retain their real semantics; never infer credits from token estimates or account deltas. A separate plugin-owned historical context projection may diagnose failed-zero readings, never filter shared native usage, replace Core's meter, infer current occupancy/percentages or rewrite history. See [quota boundaries](./docs/copilot-usage.md).
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Session-policy compaction replay consent (#349, #352)
|
|
49
49
|
|
|
50
50
|
`/copilot-compact visible-history` explicitly authorizes one lossy managed Responses
|
|
51
51
|
summary operation through the separately selected recovery engine. Scope consent
|
|
52
52
|
to the native summarizer signal, Session and account-proven model protocol; revoke
|
|
53
|
-
on settlement/cancellation/teardown.
|
|
53
|
+
on settlement/cancellation/teardown. The persistent visible-history Session policy
|
|
54
|
+
also authorizes managed Responses automatic/manual summaries inside an observed
|
|
55
|
+
native compaction bracket. Freeze the active turn's persistent policy, or capture
|
|
56
|
+
the idle Session policy before summary dispatch; legacy next-turn-only consent is
|
|
57
|
+
not summary consent. Bind native Agent/Session, summary model and exact signals.
|
|
58
|
+
Remove historical reasoning and its embedded
|
|
54
59
|
summaries only from outgoing payloads, preserve visible tool relations and native
|
|
55
|
-
source/transaction ownership
|
|
56
|
-
|
|
60
|
+
source/transaction ownership. Other protocols stay native; explicit one-time
|
|
61
|
+
commands still fail for unsupported routes. Never silently enable a disabled or
|
|
62
|
+
unknown persistent policy. Show actual filtering and native commit/failure/cancel
|
|
63
|
+
status through strict bounded ephemeral evidence and an additive composer notice;
|
|
64
|
+
only a verified replay-scope failure offers the same enable control when off.
|
|
57
65
|
Safe background diagnostics use bounded Error cause chains and fixed allowlisted
|
|
58
66
|
codes, never raw errors. Installation alone neither selects nor invokes recovery.
|
|
59
67
|
See `src/compaction-replay.ts` and `docs/manual-compaction-recovery.md` (#349).
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Visible Models and Credits resolve missing names for saved accounts without acti
|
|
|
25
25
|
|
|
26
26
|
Adding an account now keeps the device-authorization link, selectable URL, one-time code, Copy code action and Cancel together while authorization is pending. After GitHub authorizes, identity and model verification are shown as a separate phase. Adding never changes the global default; use the existing explicit **Switch** action when ready. Technical diagnostics are secondary, and account/turn identity fallbacks never expose opaque account IDs or infer historical identity from today's settings.
|
|
27
27
|
|
|
28
|
-
**Source candidate: `0.4.0-alpha.
|
|
28
|
+
**Source candidate: `0.4.0-alpha.122` (unreleased). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. The versioned commands below are for this candidate after publication, not evidence that its assets exist.
|
|
29
29
|
|
|
30
30
|
## What you can do
|
|
31
31
|
|
|
@@ -82,10 +82,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
|
|
|
82
82
|
For a **standalone named profile**:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
85
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.122/dsh-github-copilot-0.4.0-alpha.122.tgz
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.
|
|
88
|
+
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.122` after publication. Official rc.2's **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.
|
|
89
89
|
|
|
90
90
|
After an approved reload/restart:
|
|
91
91
|
|
|
@@ -162,7 +162,7 @@ Managed request admission preserves truthful input/output limits and native tran
|
|
|
162
162
|
|
|
163
163
|
For continuing steps with a committed managed route and no pending model change, known input pressure is reduced before Core opens the next model attempt. Successful native reduction avoids an unsampled local-pressure attempt that would make whole-turn Usage unavailable. First steps, pending selections, new fixed-prefix growth and final hard-budget refusals retain existing admission; this does not repair historical totals or invent missing usage.
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
**Visible-history continuation also covers this Session's native managed Responses compaction**, including automatic summaries: no extra manual recovery command or failure-first retry is required when enabled. Old encrypted reasoning and embedded summaries are omitted from outgoing input; hidden context may be lost. Visible messages/tool pairs and source history remain intact, and only the native transaction commits a smaller checkpoint. A composer notice identifies degradation and distinguishes committed, failed and cancelled outcomes. When off, an exact replay-scope rejection offers the same loss-disclosed enable control; unknown failures do not authorize loss. `/copilot-compact visible-history` remains a one-time alternative through the selected recovery engine. Read [recovery consent and limits](./docs/manual-compaction-recovery.md#explicit-visible-history-summary-recovery); this does not enable an absent engine or repair capacity, quota or timeout failures.
|
|
166
166
|
|
|
167
167
|
For exact verified `408 / user_request_timeout`, diagnostics describe bounded request composition and observable timing, not a proven payload limit or root cause. Image counts include native Responses tool outputs; older stored diagnostics may have counted those images as residual history. Bytes are not tokens; timing is not upload duration. Small, image-free requests can also time out. Follow [request-budget and timeout guidance](./docs/copilot-compaction.md); do not automatically trim history, disable proof, switch models or add retries.
|
|
168
168
|
|
|
@@ -249,14 +249,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
|
|
|
249
249
|
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.
|
|
250
250
|
|
|
251
251
|
```sh
|
|
252
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
253
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
252
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.122/dsh-github-copilot-0.4.0-alpha.122.tgz
|
|
253
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.122/SHA256SUMS
|
|
254
254
|
sha256sum --check SHA256SUMS
|
|
255
255
|
```
|
|
256
256
|
|
|
257
257
|
```powershell
|
|
258
258
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
259
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
259
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.122.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
260
260
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
261
261
|
```
|
|
262
262
|
|
package/README.zh.md
CHANGED
|
@@ -22,7 +22,7 @@ Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜
|
|
|
22
22
|
|
|
23
23
|
添加账号时,设备授权链接、可选择的网址、一次性授权码、复制授权码和取消操作会同时显示。GitHub 授权完成后,会单独显示身份与可用模型验证阶段。添加账号不会更改全局默认;准备好后仍需显式执行现有的**切换**操作。技术诊断收在次级折叠区;账号/历史 turn 缺少身份时不会暴露不透明账号 ID,也不会根据当前设置推断历史身份。
|
|
24
24
|
|
|
25
|
-
**源码候选版本:`0.4.0-alpha.
|
|
25
|
+
**源码候选版本:`0.4.0-alpha.122`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
|
|
26
26
|
|
|
27
27
|
## 你可以做什么
|
|
28
28
|
|
|
@@ -74,10 +74,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
74
74
|
**独立具名 profile**:
|
|
75
75
|
|
|
76
76
|
```sh
|
|
77
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
77
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.122/dsh-github-copilot-0.4.0-alpha.122.tgz
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.
|
|
80
|
+
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.122`。官方 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 或删除配置。
|
|
81
81
|
|
|
82
82
|
经批准 reload/restart 后:
|
|
83
83
|
|
|
@@ -154,7 +154,7 @@ Copilot 搜索要求当前账号/协议证据及能力 proof。固定/fallba
|
|
|
154
154
|
|
|
155
155
|
同一轮后续步骤已有托管路由、且没有待切换模型时,已知输入压力会在 Core 开始下次模型尝试之前压缩。原生压缩成功可避免一次无 usage 样本的本地压力拒绝导致整轮 Usage 不可用。首次步骤、待切换模型、新增固定前缀膨胀与最终硬预算拒绝仍保留原有准入;不会修复历史总量或虚构缺失用量。
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
**“降级续聊”也覆盖本 Session 的原生托管 Responses 压缩,包括自动摘要**:开启后不需要额外手动恢复命令,也不必先失败再重试。发出的输入省略旧加密 reasoning 及其内嵌摘要,隐藏上下文可能丢失;可见消息、工具调用/结果关系和原历史保留,仅由原生事务提交更小的检查点。输入区提示降级,并区分已提交、失败和取消。关闭时,明确的回放作用域拒绝提供同一个带损失说明的开启入口;未知错误不授权降级。`/copilot-compact visible-history` 保留为已选用恢复引擎的一次性高级入口。参见[授权与恢复限制](./docs/manual-compaction-recovery.md#explicit-visible-history-summary-recovery);这不启用缺失的引擎,也不修复容量、额度或超时问题。
|
|
158
158
|
|
|
159
159
|
严格核验的 `408 / user_request_timeout`诊断给出有界请求构成和可观察耗时,不证明供应方 payload 上限或根因。图片统计包括原生 Responses 工具输出中的图片;旧的已存诊断可能把这些图片算作剩余历史。字节不是 tokens,耗时不是上传时长;小型无图请求也可能超时。参见[预算与超时指导](./docs/copilot-compaction.md),不要自动裁剪历史、禁用 proof、切换模型或增加重试。
|
|
160
160
|
|
|
@@ -241,14 +241,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
|
|
|
241
241
|
GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
|
|
242
242
|
|
|
243
243
|
```sh
|
|
244
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
245
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
244
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.122/dsh-github-copilot-0.4.0-alpha.122.tgz
|
|
245
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.122/SHA256SUMS
|
|
246
246
|
sha256sum --check SHA256SUMS
|
|
247
247
|
```
|
|
248
248
|
|
|
249
249
|
```powershell
|
|
250
250
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
251
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
251
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.122.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
252
252
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
253
253
|
```
|
|
254
254
|
|
package/deployment-baseline.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"package": {
|
|
10
10
|
"name": "dsh-github-copilot",
|
|
11
|
-
"version": "0.4.0-alpha.
|
|
11
|
+
"version": "0.4.0-alpha.122"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -577,6 +577,8 @@
|
|
|
577
577
|
{"file": "src/manual-compaction-recovery.ts", "marker": "COPILOT_MANUAL_RECOVERY_"},
|
|
578
578
|
{"file": "src/background-compaction.ts", "marker": "copilot-compact"},
|
|
579
579
|
{"file": "src/compaction-replay.ts", "marker": "request.purpose !== 'compaction'"},
|
|
580
|
+
{"file": "src/compaction-continuation.ts", "marker": "COPILOT_CONTINUATION_COMPACTION_BOUNDARY_UNAVAILABLE"},
|
|
581
|
+
{"file": "src/compaction-continuation-ui.ts", "marker": "Compacting with visible history"},
|
|
580
582
|
{"file": "src/background-compaction.ts", "marker": "visible-history"},
|
|
581
583
|
{"file": "src/background-compaction.ts", "marker": "this.jobs.wait(jobId"},
|
|
582
584
|
{"file": "src/preview-route.ts", "marker": "recoveryLimits(modelId)"},
|
|
@@ -588,6 +590,8 @@
|
|
|
588
590
|
{"file": "tests/manual-compaction-recovery.spec.ts", "name": "rejects unmatched tool calls before dispatch instead of splitting a call and result"},
|
|
589
591
|
{"file": "tests/background-compaction.spec.ts", "name": "acknowledges before completion and outlives a five-minute caller deadline"},
|
|
590
592
|
{"file": "tests/compaction-replay.spec.ts", "name": "authorizes only the exact manual summary operation and preserves visible tool content"},
|
|
593
|
+
{"file": "tests/session-continuation-host.spec.ts", "name": "applies persisted continuation before a native summary and reports only native replacement success"},
|
|
594
|
+
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "persistent policy restores automatic replay-blocked compaction without a command, recovery engine=%s"},
|
|
591
595
|
{"file": "tests/background-compaction.spec.ts", "name": "reports only allowlisted causes through native error wrappers"},
|
|
592
596
|
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "recovers only an explicitly authorized manual job through one native transaction"},
|
|
593
597
|
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "commits beyond the carrier deadline without a model wakeup and keeps status owner-scoped"},
|
package/docs/auto-high-cost.md
CHANGED
|
@@ -20,6 +20,28 @@ global default. Unknown preference state is read-only, not an empty marking
|
|
|
20
20
|
list. Fixed selection is unaffected. An admitted Auto turn retains its captured
|
|
21
21
|
decision across steps, retries and subsequent preference changes.
|
|
22
22
|
|
|
23
|
+
The snapshot is taken when Auto allocates a model, after bounded assessment and
|
|
24
|
+
model loading, not necessarily at `turn/start`. Once allocated, the same turn
|
|
25
|
+
cannot be reweighted by a later save. The current checkbox/configuration is not
|
|
26
|
+
historical evidence of a previous decision. A retained observation window can
|
|
27
|
+
contain several different turns and models; its end timestamp is not the
|
|
28
|
+
timestamp of the selected message's decision.
|
|
29
|
+
|
|
30
|
+
For #348, read-only native header evidence identifies the reported Astra
|
|
31
|
+
selection at 06:25:58 local time, while the second allocation around 06:42:18
|
|
32
|
+
selected a different model. The retained pre-install configuration had no mark,
|
|
33
|
+
and a later configuration contains it. Whole-file modification time does not
|
|
34
|
+
prove the high-cost leaf's save time. No decision-time saved revision or exact
|
|
35
|
+
save receipt was retained, so the historical cause remains unconfirmed.
|
|
36
|
+
|
|
37
|
+
`tests/fixtures/copilot-accounts-persistence-core.fixture.ts` now exercises the
|
|
38
|
+
native SettingsForms save, preserved volatile configuration, the production Auto
|
|
39
|
+
Host's captured candidate weight/share, and profile restart using synthetic
|
|
40
|
+
models and settings only. It proves saved marks reach new allocations in that
|
|
41
|
+
unchanged official Core fixture, not that the affected live Host read the mark
|
|
42
|
+
before the historical Astra decision. Do not hardcode a model, change live
|
|
43
|
+
preferences or rewrite a frozen explanation to manufacture a repair.
|
|
44
|
+
|
|
23
45
|
## Routing policy v1
|
|
24
46
|
|
|
25
47
|
1. Account ownership, metadata validity, exclusion, input modality and input
|
|
@@ -39,7 +39,9 @@ Status and cancellation apply only to the invoking Agent's latest job. Duplicate
|
|
|
39
39
|
|
|
40
40
|
### Explicit visible-history summary recovery
|
|
41
41
|
|
|
42
|
-
For a verified `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH`, repeating the same summary cannot repair supplier-scoped encrypted replay.
|
|
42
|
+
For a verified `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH`, repeating the same summary cannot repair supplier-scoped encrypted replay. The existing **Visible-history continuation** Session policy now authorizes managed Responses summaries as well as chat: ordinary `/compact`, `/copilot-compact` and automatic compaction apply it before dispatch, without a failure-first retry or extra command. The active turn retains its captured persistent policy; idle summaries capture the Session policy. Disabled/unknown policy never silently enables loss, and legacy next-turn-only consent does not authorize summaries. Stock and selected recovery engines remain independently owned. An additive composer notice reports filtering and distinguishes native commit, failure and cancellation; exact scope rejection when off offers the same persistent enable control. This is not a capacity/timeout/quota cure or permission to enable an absent engine.
|
|
43
|
+
|
|
44
|
+
`/copilot-compact visible-history` remains explicit consent for **one lossy manual compaction operation** through the selected engine, without changing the persistent checkbox. Managed Responses summary requests omit historical encrypted reasoning items **and their embedded summaries**, while retaining visible messages, tool calls/results, the system head and native final directive. Hidden reasoning may contain details absent from visible messages. Review this loss before enabling the policy or issuing the one-time command.
|
|
43
45
|
|
|
44
46
|
Consent is local to the native summarizer's exact cancellation signal, Session and summary model, including its bounded segments. It is revoked on completion, failure, cancellation or teardown. No unrelated request, subsequent command or automatic retry inherits it. Unknown or incomplete reasoning fails closed. No replay is decrypted, fabricated or written back; original source events remain unchanged and only Core can commit the final smaller checkpoint. The command adds no retry or model/account switch, and does not repair supplier scope. Missing managed integration or an unsupported summary route fails explicitly.
|
|
45
47
|
|
|
@@ -63,12 +63,31 @@ Remote uses explicit Agent lookup; temporary recovery descriptors remain intact.
|
|
|
63
63
|
Public `agent/request`, `session/event` and `agent/disposed` bind an in-memory
|
|
64
64
|
per-turn baseline to the exact initiating Session and request signal. The
|
|
65
65
|
published adapter/SDK's payload hook filters the normalized payload. Only
|
|
66
|
-
`github-copilot-preview` Responses chat calls participate. Classifier,
|
|
66
|
+
`github-copilot-preview` Responses chat calls participate. Classifier,
|
|
67
67
|
unbound requests and other protocols remain native. Cold mid-turn recovery
|
|
68
68
|
without a first-step boundary fails explicitly.
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
The persistent Session policy also covers native managed Responses compaction.
|
|
71
|
+
An observed native `compaction/start` bracket plus exact public Agent lookup
|
|
72
|
+
binds each summary before dispatch. Active turns retain their captured persistent
|
|
73
|
+
policy; idle manual summaries capture current Session policy. Legacy next-turn-only
|
|
74
|
+
consent does not authorize summaries. Each segment omits all historical encrypted
|
|
75
|
+
reasoning and embedded summaries, while visible intermediate checkpoints remain.
|
|
76
|
+
Stock and separately selected recovery engines keep their existing transactions;
|
|
77
|
+
no additional failure-first attempt, retry loop or engine replacement is added.
|
|
78
|
+
End, cancellation, disposal and model/scope mismatch revoke filtering.
|
|
79
|
+
|
|
80
|
+
An additive composer notice reports actual filtering and native outcome. Success
|
|
81
|
+
requires a checkpoint replacement and an error-free matching native end, not
|
|
82
|
+
summary text alone. Failed/cancelled outcomes stay distinct; missing Host-lifetime
|
|
83
|
+
evidence remains unknown after restart. A public projection folds only native
|
|
84
|
+
bracket IDs/phase to trigger strict status reads; it stores no content or new
|
|
85
|
+
events. Polling occurs only while the viewed native bracket is active and stops
|
|
86
|
+
on settlement/unmount. When off, an exact replay-scope rejection exposes the same
|
|
87
|
+
loss-disclosed persistent enable control; unrelated failures do not.
|
|
88
|
+
|
|
89
|
+
`/copilot-compact visible-history` remains a one-operation alternative when the
|
|
90
|
+
selected engine supports it; its consent is never made persistent by the command.
|
|
72
91
|
See [summary recovery](./manual-compaction-recovery.md#explicit-visible-history-summary-recovery).
|
|
73
92
|
|
|
74
93
|
The filter scans at most 65536 top-level input items and 4096 reasoning items
|
|
@@ -86,7 +105,7 @@ Credentials, account entitlement and model capabilities remain independently gua
|
|
|
86
105
|
Native retry normalization retains raw reference-restoration evidence but records
|
|
87
106
|
the final filtered bytes for exact 408 matching. No new retry loop is introduced.
|
|
88
107
|
Input admission still precedes payload filtering: this is not an oversized-context,
|
|
89
|
-
quota, upload-timeout
|
|
108
|
+
quota, upload-timeout or native context-meter repair.
|
|
90
109
|
Actual token pressure still uses the initiating Agent's enabled native compaction
|
|
91
110
|
engine and bounded recovery: commit the native summary, rebuild the request, then
|
|
92
111
|
apply continuation. A continuation work-bound error is not relabeled as context
|
package/lib/client.js
CHANGED
|
@@ -6141,6 +6141,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6141
6141
|
result: method === "usage" || method === "refreshUsage" ? strictRemoteCodec("dsh-github-copilot#CopilotUsageView", CopilotUsageViewSchema) : method === "turn" ? strictRemoteCodec("dsh-github-copilot#TurnAccountView", TurnAccountViewSchema) : strictRemoteCodec("dsh-github-copilot#SessionAccountView", SessionAccountViewSchema)
|
|
6142
6142
|
}))
|
|
6143
6143
|
};
|
|
6144
|
+
//#endregion
|
|
6145
|
+
//#region lib/types/session-continuation-types.js
|
|
6146
|
+
const COMPACTION_CONTINUATION = "githubCopilotCompactionLifecycle";
|
|
6147
|
+
const CompactionContinuationStatusSchema = object({
|
|
6148
|
+
id: string().min(1).max(256),
|
|
6149
|
+
state: _enum([
|
|
6150
|
+
"running",
|
|
6151
|
+
"completed",
|
|
6152
|
+
"failed",
|
|
6153
|
+
"cancelled",
|
|
6154
|
+
"blocked"
|
|
6155
|
+
])
|
|
6156
|
+
}).strict();
|
|
6157
|
+
const CompactionContinuationLifecycleSchema = object({
|
|
6158
|
+
id: string().nullable(),
|
|
6159
|
+
running: boolean()
|
|
6160
|
+
}).strict();
|
|
6144
6161
|
array(object({
|
|
6145
6162
|
sessionId: string().min(1).max(256).refine((value) => !/[\p{Cc}\p{Cf}]/u.test(value)),
|
|
6146
6163
|
version: literal(1),
|
|
@@ -6160,7 +6177,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6160
6177
|
revision: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
6161
6178
|
activeTurnEnabled: boolean().optional(),
|
|
6162
6179
|
source: _enum(["default", "session"]).optional(),
|
|
6163
|
-
nextTurnAuthorized: boolean().optional()
|
|
6180
|
+
nextTurnAuthorized: boolean().optional(),
|
|
6181
|
+
compaction: CompactionContinuationStatusSchema.optional()
|
|
6164
6182
|
}).strict();
|
|
6165
6183
|
//#endregion
|
|
6166
6184
|
//#region lib/types/session-continuation-remote.js
|
|
@@ -10362,7 +10380,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10362
10380
|
if (owner.current === generation) setBusy(false);
|
|
10363
10381
|
}
|
|
10364
10382
|
};
|
|
10365
|
-
const loss = (0, react.createElement)("p", { style: body }, zh ? "
|
|
10383
|
+
const loss = (0, react.createElement)("p", { style: body }, zh ? "聊天及本 Session 的原生压缩使用可见历史,省略旧加密推理及内嵌摘要,同账号也适用;可能失去隐含细节。可见消息、工具关系和原历史保留,摘要由原生事务提交。不会额外发送聊天或重试。" : "Chat and native compaction in this Session use visible history, omitting old encrypted reasoning and embedded summaries even on the same account; implicit details may be lost. Visible messages, tool relations and source history remain intact; native transactions commit summaries. No extra chat sending or retries.");
|
|
10366
10384
|
const unavailable = error ? (0, react.createElement)("p", {
|
|
10367
10385
|
role: "alert",
|
|
10368
10386
|
style: body
|
|
@@ -10478,7 +10496,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10478
10496
|
checked: view?.enabled ?? false,
|
|
10479
10497
|
disabled: busy || !view,
|
|
10480
10498
|
onChange: (event) => void save(event.currentTarget.checked)
|
|
10481
|
-
}), zh ? "新 Session 默认开启降级续聊" : "Enable visible-history continuation for new Sessions"), (0, react.createElement)("p", { style: paragraph }, zh ? "开启即同意新 Session
|
|
10499
|
+
}), zh ? "新 Session 默认开启降级续聊" : "Enable visible-history continuation for new Sessions"), (0, react.createElement)("p", { style: paragraph }, zh ? "开启即同意新 Session 的聊天及原生压缩省略旧加密推理及内嵌摘要,可能丢失隐藏细节,同账号也适用。已有 Session 和继承历史不自动授权,原历史和工具关系保留。" : "Enabling consents to omitting prior encrypted reasoning and embedded summaries in new Session chat and native compaction, even on the same account; hidden details may be lost. Existing Sessions and seeded histories are not automatically enrolled. Source history and tool relations are preserved."), error ? (0, react.createElement)("p", { role: "alert" }, "COPILOT_CONTINUATION_STATUS_UNAVAILABLE", (0, react.createElement)("button", {
|
|
10482
10500
|
type: "button",
|
|
10483
10501
|
style: control,
|
|
10484
10502
|
onClick: () => setReload((value) => value + 1)
|
|
@@ -10987,6 +11005,76 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10987
11005
|
});
|
|
10988
11006
|
}
|
|
10989
11007
|
//#endregion
|
|
11008
|
+
//#region lib/types/compaction-continuation-ui.js
|
|
11009
|
+
function CompactionContinuationNotice({ sessionId, remote, lifecycle, locale = "en" }) {
|
|
11010
|
+
const parsed = CompactionContinuationLifecycleSchema.safeParse(lifecycle);
|
|
11011
|
+
const id = parsed.success ? parsed.data.id : null;
|
|
11012
|
+
const running = parsed.success && parsed.data.running;
|
|
11013
|
+
const [status, setStatus] = (0, react.useState)();
|
|
11014
|
+
const [error, setError] = (0, react.useState)(false);
|
|
11015
|
+
const [dismissed, setDismissed] = (0, react.useState)();
|
|
11016
|
+
(0, react.useEffect)(() => {
|
|
11017
|
+
let current = true;
|
|
11018
|
+
let timer;
|
|
11019
|
+
setStatus(void 0);
|
|
11020
|
+
setError(false);
|
|
11021
|
+
if (!id || !remote) return;
|
|
11022
|
+
const read = async () => {
|
|
11023
|
+
try {
|
|
11024
|
+
const result = await remote.get(sessionId);
|
|
11025
|
+
const view = result.ok ? SessionContinuationViewSchema.safeParse(result.value) : void 0;
|
|
11026
|
+
if (!current) return;
|
|
11027
|
+
if (!view?.success) {
|
|
11028
|
+
setError(true);
|
|
11029
|
+
setStatus(void 0);
|
|
11030
|
+
} else {
|
|
11031
|
+
setError(false);
|
|
11032
|
+
setStatus(view.data.compaction?.id === id ? view.data.compaction : void 0);
|
|
11033
|
+
}
|
|
11034
|
+
} catch {
|
|
11035
|
+
if (current) {
|
|
11036
|
+
setError(true);
|
|
11037
|
+
setStatus(void 0);
|
|
11038
|
+
}
|
|
11039
|
+
} finally {
|
|
11040
|
+
if (current && running) timer = setTimeout(() => void read(), 1e3);
|
|
11041
|
+
}
|
|
11042
|
+
};
|
|
11043
|
+
read();
|
|
11044
|
+
return () => {
|
|
11045
|
+
current = false;
|
|
11046
|
+
if (timer) clearTimeout(timer);
|
|
11047
|
+
};
|
|
11048
|
+
}, [
|
|
11049
|
+
sessionId,
|
|
11050
|
+
remote,
|
|
11051
|
+
id,
|
|
11052
|
+
running
|
|
11053
|
+
]);
|
|
11054
|
+
const zh = locale.startsWith("zh");
|
|
11055
|
+
if (!status && !error) return null;
|
|
11056
|
+
if (status?.state === "blocked") return dismissed === status.id ? null : (0, react.createElement)("section", {
|
|
11057
|
+
"data-copilot-composer-notice": "compaction-continuation",
|
|
11058
|
+
style: composerNoticeSurfaceStyle
|
|
11059
|
+
}, (0, react.createElement)("p", {
|
|
11060
|
+
role: "alert",
|
|
11061
|
+
style: composerNoticeParagraphStyle
|
|
11062
|
+
}, zh ? "旧推理回放被拒绝,压缩未提交。开启降级可让后续聊天与压缩使用可见历史。" : "Old reasoning replay was rejected; compaction did not commit. Enabling continuation lets subsequent chat and compaction use visible history."), (0, react.createElement)(SessionContinuationCard, {
|
|
11063
|
+
sessionId,
|
|
11064
|
+
remote,
|
|
11065
|
+
locale,
|
|
11066
|
+
recovery: true,
|
|
11067
|
+
onCancel: () => setDismissed(status.id)
|
|
11068
|
+
}));
|
|
11069
|
+
const text = error ? zh ? "无法确认压缩降级状态;请查看原生压缩结果。" : "Compaction recovery status is unavailable; check the native compaction result." : status?.state === "running" ? zh ? "正在使用可见历史降级压缩,隐藏推理上下文可能丢失。" : "Compacting with visible history; hidden reasoning context may be lost." : status?.state === "completed" ? zh ? "可见历史压缩已提交;隐藏推理上下文未带入摘要。" : "Visible-history compaction committed; hidden reasoning context was omitted from the summary." : status?.state === "cancelled" ? zh ? "可见历史压缩已取消;未确认提交恢复摘要。" : "Visible-history compaction cancelled; no recovery summary commit is confirmed." : zh ? "可见历史压缩失败;Session 尚未恢复。请查看原生失败原因。" : "Visible-history compaction failed; the Session is not recovered. Check the native failure.";
|
|
11070
|
+
return (0, react.createElement)("section", {
|
|
11071
|
+
"data-copilot-composer-notice": "compaction-continuation",
|
|
11072
|
+
role: error || status?.state === "failed" ? "alert" : "status",
|
|
11073
|
+
"aria-live": "polite",
|
|
11074
|
+
style: composerNoticeSurfaceStyle
|
|
11075
|
+
}, (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, text));
|
|
11076
|
+
}
|
|
11077
|
+
//#endregion
|
|
10990
11078
|
//#region lib/types/replay-recovery-ui.js
|
|
10991
11079
|
const noop = () => {};
|
|
10992
11080
|
function record(value) {
|
|
@@ -11122,11 +11210,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11122
11210
|
function Surface({ runtime, remote, continuation, locale }) {
|
|
11123
11211
|
const valid = runtime.useSession((value) => record(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
|
|
11124
11212
|
const selected = runtime.useProjection("modelSelection");
|
|
11213
|
+
const compaction = runtime.useProjection(COMPACTION_CONTINUATION);
|
|
11125
11214
|
const running = runtime.useSession((value) => !record(value) || value.running !== false);
|
|
11126
11215
|
const lastError = runtime.useSession((value) => record(value) && typeof value.lastAgentError === "string" ? value.lastAgentError : "");
|
|
11127
11216
|
const language = (0, react.useSyncExternalStore)((listener) => locale?.subscribe(listener) ?? noop, () => locale?.getLocale().active ?? "en", () => "en");
|
|
11128
11217
|
if (!valid || !record(selected) || !record(selected.next) || selected.next.provider !== "github-copilot-preview") return null;
|
|
11129
|
-
return (0, react.createElement)(
|
|
11218
|
+
return (0, react.createElement)("div", null, (0, react.createElement)(CompactionContinuationNotice, {
|
|
11219
|
+
sessionId: runtime.sessionId,
|
|
11220
|
+
remote: continuation,
|
|
11221
|
+
lifecycle: compaction,
|
|
11222
|
+
locale: language
|
|
11223
|
+
}), (0, react.createElement)(ReplayRecoveryCard, {
|
|
11130
11224
|
key: JSON.stringify([runtime.sessionId, selected.next.model]),
|
|
11131
11225
|
sessionId: runtime.sessionId,
|
|
11132
11226
|
remote,
|
|
@@ -11134,7 +11228,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11134
11228
|
locale: language,
|
|
11135
11229
|
running,
|
|
11136
11230
|
refreshKey: lastError
|
|
11137
|
-
});
|
|
11231
|
+
}));
|
|
11138
11232
|
}
|
|
11139
11233
|
function registerReplayRecoveryUi(ctx) {
|
|
11140
11234
|
const candidate = ctx.get("slots");
|