dsh-github-copilot 0.4.0-alpha.120 → 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 +21 -0
- package/CHANGELOG.md +6 -0
- package/README.md +8 -6
- package/README.zh.md +8 -6
- package/deployment-baseline.json +10 -1
- package/docs/auto-high-cost.md +22 -0
- package/docs/copilot-compaction.md +9 -0
- package/docs/manual-compaction-recovery.md +13 -0
- package/docs/session-continuation.md +25 -2
- package/lib/client.js +99 -5
- package/lib/client.js.map +1 -1
- package/lib/index.js +228 -37
- package/lib/manual-compaction-recovery.js +55 -13
- package/lib/remote.js +16 -1
- package/lib/types/background-compaction.d.ts +2 -2
- package/lib/types/compaction-continuation-ui.d.ts +11 -0
- package/lib/types/compaction-continuation.d.ts +48 -0
- package/lib/types/compaction-replay.d.ts +18 -0
- package/lib/types/manual-compaction-recovery.d.ts +2 -0
- package/lib/types/preview-route.d.ts +1 -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,6 +45,27 @@ 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
|
+
## Session-policy compaction replay consent (#349, #352)
|
|
49
|
+
|
|
50
|
+
`/copilot-compact visible-history` explicitly authorizes one lossy managed Responses
|
|
51
|
+
summary operation through the separately selected recovery engine. Scope consent
|
|
52
|
+
to the native summarizer signal, Session and account-proven model protocol; revoke
|
|
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
|
|
59
|
+
summaries only from outgoing payloads, preserve visible tool relations and native
|
|
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.
|
|
65
|
+
Safe background diagnostics use bounded Error cause chains and fixed allowlisted
|
|
66
|
+
codes, never raw errors. Installation alone neither selects nor invokes recovery.
|
|
67
|
+
See `src/compaction-replay.ts` and `docs/manual-compaction-recovery.md` (#349).
|
|
68
|
+
|
|
48
69
|
## Approved multi-account ownership extension (#297)
|
|
49
70
|
|
|
50
71
|
Identity presentation uses additive `ensureIdentity` Remotes, including explicit-Agent Session lookup. Keep `get` metadata-only; visible surfaces may ensure on their sixty-second cadence. Fresh ten-minute cache avoids requests, same-account consumers join a bounded flight, and failures cool down thirty seconds unless explicitly refreshed. Credential notifications revoke pending work even when token bytes are unchanged; no late cache publication. Quota may settle independently only with account-coherent metadata. Presentation cache never replaces fresh identity validation for switch, reauthorization or duplicate checks. Preserve strict sanitized diagnostics and Session/turn ownership (#309).
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.121 (prepared)
|
|
4
|
+
|
|
5
|
+
- Add explicit `/copilot-compact visible-history` consent for one lossy managed Responses summary operation after replay-scope rejection (#349). Preserve visible messages/tool pairs, native directive, route/cap, cancellation, source history and single transactional commit; no automatic retry, hidden settings change or live execution.
|
|
6
|
+
- Show safe allowlisted background-compaction failure reasons through bounded native Error cause chains rather than only a generic failure. Unknown causes remain explicit and private.
|
|
7
|
+
- Keep ordinary/manual/automatic compaction and chat continuation consent independent; installation alone neither selects an engine nor runs recovery.
|
|
8
|
+
|
|
3
9
|
## 0.4.0-alpha.120 (prepared)
|
|
4
10
|
|
|
5
11
|
- Let explicitly account-bound model preparation, native dispatch and subsequent turn steps continue during global selector switching, fixing `COPILOT_ACCOUNTS_BUSY` from the overly broad acquisition fence (#344).
|
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,6 +162,8 @@ 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
|
+
**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
|
+
|
|
165
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.
|
|
166
168
|
|
|
167
169
|
The same failure can include request-scoped native local body-write/header milestones, negotiated TLS ALPN and a Node writable-buffer count. These are local submission observations, not kernel ACK or supplier receipt; missing events do not prove an incomplete upload. Unsupported or ambiguous transports report unavailable evidence. No request contents are logged and no connection, proxy, dispatcher or retry is changed.
|
|
@@ -247,14 +249,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
|
|
|
247
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.
|
|
248
250
|
|
|
249
251
|
```sh
|
|
250
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
251
|
-
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
|
|
252
254
|
sha256sum --check SHA256SUMS
|
|
253
255
|
```
|
|
254
256
|
|
|
255
257
|
```powershell
|
|
256
258
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
257
|
-
$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()
|
|
258
260
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
259
261
|
```
|
|
260
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,6 +154,8 @@ Copilot 搜索要求当前账号/协议证据及能力 proof。固定/fallba
|
|
|
154
154
|
|
|
155
155
|
同一轮后续步骤已有托管路由、且没有待切换模型时,已知输入压力会在 Core 开始下次模型尝试之前压缩。原生压缩成功可避免一次无 usage 样本的本地压力拒绝导致整轮 Usage 不可用。首次步骤、待切换模型、新增固定前缀膨胀与最终硬预算拒绝仍保留原有准入;不会修复历史总量或虚构缺失用量。
|
|
156
156
|
|
|
157
|
+
**“降级续聊”也覆盖本 Session 的原生托管 Responses 压缩,包括自动摘要**:开启后不需要额外手动恢复命令,也不必先失败再重试。发出的输入省略旧加密 reasoning 及其内嵌摘要,隐藏上下文可能丢失;可见消息、工具调用/结果关系和原历史保留,仅由原生事务提交更小的检查点。输入区提示降级,并区分已提交、失败和取消。关闭时,明确的回放作用域拒绝提供同一个带损失说明的开启入口;未知错误不授权降级。`/copilot-compact visible-history` 保留为已选用恢复引擎的一次性高级入口。参见[授权与恢复限制](./docs/manual-compaction-recovery.md#explicit-visible-history-summary-recovery);这不启用缺失的引擎,也不修复容量、额度或超时问题。
|
|
158
|
+
|
|
157
159
|
严格核验的 `408 / user_request_timeout`诊断给出有界请求构成和可观察耗时,不证明供应方 payload 上限或根因。图片统计包括原生 Responses 工具输出中的图片;旧的已存诊断可能把这些图片算作剩余历史。字节不是 tokens,耗时不是上传时长;小型无图请求也可能超时。参见[预算与超时指导](./docs/copilot-compaction.md),不要自动裁剪历史、禁用 proof、切换模型或增加重试。
|
|
158
160
|
|
|
159
161
|
同一失败还可包含请求级原生客户端的本地请求体写入/响应头里程碑、协商出的 TLS ALPN 与 Node 写缓冲字节数。这些只是本地提交观测,不是内核 ACK 或供应方接收证明;缺失事件不代表上传未完成。不支持或存在歧义的传输会明确报告证据不可用。不记录请求内容,也不改变连接、代理、dispatcher 或重试。
|
|
@@ -239,14 +241,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
|
|
|
239
241
|
GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
|
|
240
242
|
|
|
241
243
|
```sh
|
|
242
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
243
|
-
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
|
|
244
246
|
sha256sum --check SHA256SUMS
|
|
245
247
|
```
|
|
246
248
|
|
|
247
249
|
```powershell
|
|
248
250
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
249
|
-
$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()
|
|
250
252
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
251
253
|
```
|
|
252
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",
|
|
@@ -576,6 +576,10 @@
|
|
|
576
576
|
{"file": "src/manual-compaction-recovery.ts", "marker": "maxCalls: failedAttempt ? 15 : 16"},
|
|
577
577
|
{"file": "src/manual-compaction-recovery.ts", "marker": "COPILOT_MANUAL_RECOVERY_"},
|
|
578
578
|
{"file": "src/background-compaction.ts", "marker": "copilot-compact"},
|
|
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"},
|
|
582
|
+
{"file": "src/background-compaction.ts", "marker": "visible-history"},
|
|
579
583
|
{"file": "src/background-compaction.ts", "marker": "this.jobs.wait(jobId"},
|
|
580
584
|
{"file": "src/preview-route.ts", "marker": "recoveryLimits(modelId)"},
|
|
581
585
|
{"file": "docs/manual-compaction-recovery.md", "marker": "separately selected"}
|
|
@@ -585,6 +589,11 @@
|
|
|
585
589
|
{"file": "tests/manual-compaction-recovery.spec.ts", "name": "rejects an indivisible span before dispatch and leaves recovery to native failure handling"},
|
|
586
590
|
{"file": "tests/manual-compaction-recovery.spec.ts", "name": "rejects unmatched tool calls before dispatch instead of splitting a call and result"},
|
|
587
591
|
{"file": "tests/background-compaction.spec.ts", "name": "acknowledges before completion and outlives a five-minute caller deadline"},
|
|
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"},
|
|
595
|
+
{"file": "tests/background-compaction.spec.ts", "name": "reports only allowlisted causes through native error wrappers"},
|
|
596
|
+
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "recovers only an explicitly authorized manual job through one native transaction"},
|
|
588
597
|
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "commits beyond the carrier deadline without a model wakeup and keeps status owner-scoped"},
|
|
589
598
|
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "recovers oversized manual history with one native transaction and honest multi-call audit"},
|
|
590
599
|
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "defaults automatic oversized recovery on without a manual command, enabled=%s"},
|
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
|
|
@@ -60,6 +60,15 @@ This fixes scope wiring, not a new automatic command: native pressure and `agent
|
|
|
60
60
|
|
|
61
61
|
## Summary purpose policy
|
|
62
62
|
|
|
63
|
+
Replay-scope rejection is not input overflow: a smaller summary request can still
|
|
64
|
+
carry old encrypted reasoning that the supplier refuses. Ordinary and automatic
|
|
65
|
+
compaction never inherit chat continuation consent. The selected recovery engine's
|
|
66
|
+
explicit `/copilot-compact visible-history` authorizes one lossy Responses summary
|
|
67
|
+
operation, with safe failure-code reporting and unchanged native transaction
|
|
68
|
+
ownership. Review [consent and bounded limitations](./manual-compaction-recovery.md#explicit-visible-history-summary-recovery)
|
|
69
|
+
before invoking. This does not decrypt or repair replay, rewrite source history,
|
|
70
|
+
retry a failed message or guarantee capacity recovery.
|
|
71
|
+
|
|
63
72
|
Official `GenerateOptions.purpose` permits adapter-specific generation policy. For `purpose: 'compaction'`, `prefer-low` selects supported `minimal`, otherwise supported `low`, only when no effort was supplied or materialized by Core/the configured native profile. Explicit and resolved defaults win; unsupported low controls preserve the provider default. `preserve` disables this purpose default. Normal conversations and other purposes keep their existing reasoning behavior.
|
|
64
73
|
|
|
65
74
|
The stock summary record takes its requested output cap from the owning compaction configuration. Therefore the plugin does not silently increase/decrease that cap in middleware or alter summary route identity. It preserves native `max-tokens` output truncation as failure, distinct from input overflow. Public summaries, encrypted replay and native stop reasons remain native-owned.
|
|
@@ -28,6 +28,7 @@ With this engine selected and the public `commands` and `jobs` services availabl
|
|
|
28
28
|
/copilot-compact
|
|
29
29
|
/copilot-compact status
|
|
30
30
|
/copilot-compact cancel
|
|
31
|
+
/copilot-compact visible-history
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
The jobs package is a development-only type dependency: the plugin imports no jobs runtime implementation, and the engine's public declaration does not expose its types. Runtime access is through the optionally injected Host service; no jobs package is bundled, installed as a new peer, or registered by this plugin.
|
|
@@ -36,6 +37,18 @@ The first command acknowledges **job admission**, not a completed summary. The e
|
|
|
36
37
|
|
|
37
38
|
Status and cancellation apply only to the invoking Agent's latest job. Duplicate starts return the current running job rather than starting another transaction. The selected engine still acquires Core's maintenance lock and owns the only native transaction; another active turn or compaction can cause the admitted job to fail. Job status distinguishes running, completed, failed and cancelled work. Failure details are sanitized; consult the native compaction/end record for the underlying summary/transaction diagnostic. Provider timeout, truncation, capacity and account-proof failures remain failures.
|
|
38
39
|
|
|
40
|
+
### Explicit visible-history summary recovery
|
|
41
|
+
|
|
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.
|
|
45
|
+
|
|
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.
|
|
47
|
+
|
|
48
|
+
The original conservative input/segmentation estimate still includes native history before outgoing filtering. Giant indivisible units, fixed prefixes, bounded-work/call limits, truncation and failure to shrink can still prevent recovery. This command is not guaranteed to rescue every history, and summary calls may incur charges. Installation alone neither selects the engine nor runs this command.
|
|
49
|
+
|
|
50
|
+
Background status now exposes only allowlisted fixed failure codes through bounded native Error cause chains, including replay-scope rejection; raw exception text, response bodies and history remain excluded. Unknown failures retain `COPILOT_BACKGROUND_COMPACTION_FAILED` with guidance to the native `compaction/end` record. An admission receipt is not success; check status and the native transaction.
|
|
51
|
+
|
|
39
52
|
The plugin collects the job's native settlement with `jobs.wait`, so the ordinary job reporter does not wake the model or resume its Goal. It never calls followup or inject. Explicit cancellation, owner disposal and plugin/Host teardown cancel and drain the producer. Owner teardown can fail native maintenance before the job receives cancellation; that outcome remains failed rather than being relabeled successful or cancelled. Jobs are process-local: status does not survive a Host restart, and the plugin does not silently restart interrupted work. Durable Core compaction events remain the outcome evidence. Merely installing the main plugin does not select this engine or make this command available; missing commands/jobs services leave the background entry unavailable without changing ordinary compaction.
|
|
40
53
|
|
|
41
54
|
**Audit:** each physical call goes through Core's public `llm.stream` seam with its actual route/cap. The final native summary event is intentionally *unmarked* (`llmStreamCall` absent), not a fabricated claim of one call. It records summed provider-reported usage only when **every** underlying call supplied usage; optional counters are included only if present on every call. After a failed initial single call, aggregate usage is omitted because this hook cannot recover that call's complete accounting. The native event format has no per-call array or durable per-call transcript in a single summary event; do not infer individual request accounting from that aggregate. This is a real observability limit of the unchanged public contract.
|
|
@@ -63,10 +63,33 @@ 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
|
+
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.
|
|
91
|
+
See [summary recovery](./manual-compaction-recovery.md#explicit-visible-history-summary-recovery).
|
|
92
|
+
|
|
70
93
|
The filter scans at most 65536 top-level input items and 4096 reasoning items
|
|
71
94
|
(including duplicates). Only encrypted reasoning is hashed, with an aggregate
|
|
72
95
|
64 Mi UTF-16-code-unit processing bound per invocation and 64 Ki-code-unit chunks
|
|
@@ -82,7 +105,7 @@ Credentials, account entitlement and model capabilities remain independently gua
|
|
|
82
105
|
Native retry normalization retains raw reference-restoration evidence but records
|
|
83
106
|
the final filtered bytes for exact 408 matching. No new retry loop is introduced.
|
|
84
107
|
Input admission still precedes payload filtering: this is not an oversized-context,
|
|
85
|
-
quota, upload-timeout
|
|
108
|
+
quota, upload-timeout or native context-meter repair.
|
|
86
109
|
Actual token pressure still uses the initiating Agent's enabled native compaction
|
|
87
110
|
engine and bounded recovery: commit the native summary, rebuild the request, then
|
|
88
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");
|