dsh-github-copilot 0.4.0-alpha.95 → 0.4.0-alpha.97
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 +2 -2
- package/CHANGELOG.md +12 -0
- package/README.md +9 -7
- package/README.zh.md +9 -7
- package/deployment-baseline.json +10 -3
- package/docs/copilot-compaction.md +4 -0
- package/docs/model-compatibility-acceptance.md +26 -7
- package/lib/client.js +168 -58
- package/lib/client.js.map +1 -1
- package/lib/index.js +210 -64
- package/lib/remote.js +61 -32
- package/lib/types/replay-recovery-host.d.ts +2 -1
- package/lib/types/replay-recovery-remote.d.ts +2 -1
- package/lib/types/replay-recovery-types.d.ts +10 -0
- package/lib/types/replay-recovery-ui.d.ts +9 -2
- package/lib/types/replay-recovery.d.ts +4 -2
- package/lib/types/request-body-evidence.d.ts +2 -0
- package/lib/types/request-upload-evidence.d.ts +23 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -73,7 +73,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
|
|
|
73
73
|
- `src/wire.ts`, `src/wire-anthropic.ts`: inline hosted-search streaming.
|
|
74
74
|
- `src/traditional-search.ts`: `github-copilot-hosted` `ctx.web` provider.
|
|
75
75
|
- `src/serialize.ts`, `src/sse.ts`, `src/failure.ts`: protocol conversion and bounded error handling.
|
|
76
|
-
- `src/response-error-body.ts`, `src/request-body-timeout.ts`: bounded clone-only HTTP error evidence and safe managed upload-timeout guidance.
|
|
76
|
+
- `src/response-error-body.ts`, `src/request-body-timeout.ts`, `src/request-upload-evidence.ts`: bounded clone-only HTTP error evidence and safe managed upload-timeout guidance. Request-scoped public Node diagnostic events supply numeric local body-write/header/ALPN evidence only after an exact verified `408/user_request_timeout`; absent events, multiple native requests and work limits stay explicit. Always dispose subscriptions when Fetch settles, without changing its arguments, Response/errors, dispatcher, proxy or retry owner. Local body-write completion is not upload duration, kernel ACK, supplier receipt or execution; its absence does not prove incomplete upload. Native failure classification/retry metadata stay unchanged; final JSON bytes are not tokens or a payload limit. Never infer overflow, auto-compact, trim history, switch models or add retries from a 408.
|
|
77
77
|
- `src/request-body-evidence.ts`: verified-408-only, bounded numeric original-JSON span accounting through the existing fetch hook. Conversation/tool definitions/top-level system/residual partition total bytes; structural image and opaque replay spans are disjoint conversation subsets, never decoded contents. Unknown/limited evidence stays explicit. Fetch-to-header time excludes clone inspection and is not upload duration. No success-path analysis, retained body, automatic mitigation or supplier-limit claim.
|
|
78
78
|
- `src/copilot-stream-liveness.ts`: request-local HTTP/SSE byte-idle observation, paired with the public native adapter's bounded assistant-chunk deadline. Default five-minute byte idle and ten-minute semantic silence; no fake assistant output, private watchdog access, new retry or Core patch. Consumer think time is excluded; explicit WebSocket/auto stays native-only. `chatStreamLiveness: false` restores native-only timing. `chatMaxRequestImageBytes` retains Core's 20 MiB default; smaller explicit settings authorize only native image offload, not hidden history trimming or a guessed supplier limit. Synthetic heartbeat evidence is not production heartbeat proof.
|
|
79
79
|
- `tests/`: unit and integration evidence; mirror the source area being changed.
|
|
@@ -83,7 +83,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
|
|
|
83
83
|
|
|
84
84
|
## Non-negotiable invariants
|
|
85
85
|
|
|
86
|
-
- Explicit replay recovery (#279) is default-off and bound to the initiating native request signal, Session, model and current account proof. Only exact verified scope failures capture bounded full-item fingerprints; no replay bytes reach Client or storage. Two-stage confirmation
|
|
86
|
+
- Explicit replay recovery (#279, #289) is default-off and bound to the initiating native request signal, Session, model and current account proof. Only exact verified scope failures capture bounded full-item fingerprints; no replay bytes reach Client or storage. Public Session running/error snapshots trigger read-only notices on open/settled turns, never polling or durable recovery events. Two-stage confirmation chooses next matching turn (all steps/retries until turn/end) or bounded Session consent, omitting matching old encrypted items and their item summaries only on outgoing requests, never durable history or new reasoning. Preserve get/setEnabled descriptor identities and legacy session-consent semantics; authorize is additive. Active-turn writes, ambient-scope calls and automatic retries are forbidden. Expiry, disposal and proof discontinuity revoke evidence. See `docs/model-compatibility-acceptance.md`.
|
|
87
87
|
|
|
88
88
|
- Do not implement a second general wire adapter or independently maintained static Copilot model catalog. The account-scoped route composes the published adapter and SDK with validated supplier metadata.
|
|
89
89
|
- Protocol and capability corrections must follow authenticated, current account metadata; new model IDs must not need new implementation tables. Native pi metadata may be reused only where it agrees with advertised endpoints and capabilities. Matching IDs alone do not prove correctness or authorize migration back into another Core catalog. Preserve old bounded ownership journals solely for verified restoration of legacy writes, never for new global protocol overrides.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.97 (prepared)
|
|
4
|
+
|
|
5
|
+
- Add request-scoped public native body-write/header timing and optional TLS ALPN/Node buffer observations to exact verified Copilot request-body timeout diagnostics (#291).
|
|
6
|
+
- Keep unavailable, ambiguous and bounded-work evidence explicit; dispose subscriptions when Fetch settles. Local submission is not upload duration, kernel ACK or supplier receipt.
|
|
7
|
+
- Preserve Fetch arguments, Response/errors, payload/replay/history, connection/proxy/dispatcher and native retry behavior. This supplies future failure evidence, not a demonstrated supplier 408 cure.
|
|
8
|
+
|
|
9
|
+
## 0.4.0-alpha.96 (prepared)
|
|
10
|
+
|
|
11
|
+
- Surface verified replay-recovery evidence automatically when an eligible Session opens or its native turn settles; ordinary conversations remain uncluttered (#289).
|
|
12
|
+
- Add explicit next-matching-turn or bounded Session consent, defaulting the choice to one turn. All native steps/retries share that turn's authorization, which is consumed at turn end. Confirmation never sends or retries a message.
|
|
13
|
+
- Preserve exact-item/proof guards, old Remote identities and native history ownership. Add native gateway and desktop/mobile component coverage, local dismissal, explicit read failures and expiry updates. This is not a supplier 408 fix.
|
|
14
|
+
|
|
3
15
|
## 0.4.0-alpha.95 (prepared)
|
|
4
16
|
|
|
5
17
|
- Preserve native usage and chunk order before restoring dispatch-local byte-idle or replay errors (#285). Previously the owned error could be thrown before the SDK's terminal usage, discarding both failed-zero and real nonzero samples.
|
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 and one Host-owned OAuth account; it does not patch Core or maintain a second model catalog.
|
|
10
10
|
|
|
11
|
-
**Source candidate: `0.4.0-alpha.
|
|
11
|
+
**Source candidate: `0.4.0-alpha.97` (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.
|
|
12
12
|
|
|
13
13
|
## What you can do
|
|
14
14
|
|
|
@@ -40,10 +40,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
|
|
|
40
40
|
For a **standalone named profile**:
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
43
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.97/dsh-github-copilot-0.4.0-alpha.97.tgz
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.
|
|
46
|
+
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.97` 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.
|
|
47
47
|
|
|
48
48
|
After an approved reload/restart:
|
|
49
49
|
|
|
@@ -102,6 +102,8 @@ For continuing steps with a committed managed route and no pending model change,
|
|
|
102
102
|
|
|
103
103
|
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.
|
|
104
104
|
|
|
105
|
+
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.
|
|
106
|
+
|
|
105
107
|
HTTP/SSE liveness separates five-minute byte idle from bounded ten-minute assistant-output silence by default. Consumer work is excluded; WebSocket/explicit `auto` stays native-only. This does not cure supplier HTTP 408s. Images are admitted against actual native-projected MIME evidence; the plugin does not own conversion or infer format support from filenames. [Image compatibility](./docs/image-input-compatibility.md).
|
|
106
108
|
|
|
107
109
|
## Settings and troubleshooting
|
|
@@ -134,7 +136,7 @@ Configuration is under `github-copilot`. Credentials, endpoint definitions and a
|
|
|
134
136
|
| Selection unknown/unavailable | Distinguish lost evidence from read failure; Retry only rereads |
|
|
135
137
|
| Missing/cancelled Turn Usage | Read [usage limitations](./docs/copilot-usage.md); do not infer zero billing |
|
|
136
138
|
| History fails on `github-copilot/auto-model-decision` | Use [detached, check-first recovery](./docs/automatic-model-routing.md#recovering-affected-histories); never replace live history without stopped writers and approval |
|
|
137
|
-
| AUTH, Responses replay-scope or TLS failure | Review [request diagnostics](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics) and [usage TLS boundaries](./docs/copilot-usage.md#account-data-boundary). After an exact scope rejection, the session's
|
|
139
|
+
| AUTH, Responses replay-scope or TLS failure | Review [request diagnostics](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics) and [usage TLS boundaries](./docs/copilot-usage.md#account-data-boundary). After an exact scope rejection, **Replay recovery** appears automatically when the session's turn ends or the session opens. Review the loss of matching old encrypted items and their summaries, then authorize **Next matching turn only** (default choice) or **Continue in this session**. Both expire within one hour of the evidence and require the same validation state. Recovery itself stays off until confirmed; use native Send/Retry separately. It never rewrites history or retries automatically, and is not a 408 fix. Never reset credentials or disable TLS as an automatic repair. |
|
|
138
140
|
| Hosted search unavailable | Check account/protocol/probe diagnostics; a legacy override stays authoritative until explicitly reset |
|
|
139
141
|
|
|
140
142
|
## Ownership and further reading
|
|
@@ -175,14 +177,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
|
|
|
175
177
|
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.
|
|
176
178
|
|
|
177
179
|
```sh
|
|
178
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
179
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
180
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.97/dsh-github-copilot-0.4.0-alpha.97.tgz
|
|
181
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.97/SHA256SUMS
|
|
180
182
|
sha256sum --check SHA256SUMS
|
|
181
183
|
```
|
|
182
184
|
|
|
183
185
|
```powershell
|
|
184
186
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
185
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
187
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.97.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
186
188
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
187
189
|
```
|
|
188
190
|
|
package/README.zh.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
为 DSH 提供 GitHub Copilot 账号模型发现、上下文 Auto 选模和 hosted search。插件复用 DSH 公开的原生适配器与一个 Host 端 OAuth 账号,不修改 Core,也不维护第二套模型目录。
|
|
10
10
|
|
|
11
|
-
**源码候选版本:`0.4.0-alpha.
|
|
11
|
+
**源码候选版本:`0.4.0-alpha.97`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
|
|
12
12
|
|
|
13
13
|
## 你可以做什么
|
|
14
14
|
|
|
@@ -40,10 +40,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
40
40
|
**独立具名 profile**:
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
43
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.97/dsh-github-copilot-0.4.0-alpha.97.tgz
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.
|
|
46
|
+
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.97`。官方 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 或删除配置。
|
|
47
47
|
|
|
48
48
|
经批准 reload/restart 后:
|
|
49
49
|
|
|
@@ -102,6 +102,8 @@ Copilot 搜索要求当前账号/协议证据及能力 proof。固定/fallba
|
|
|
102
102
|
|
|
103
103
|
严格核验的 `408 / user_request_timeout`诊断给出有界请求构成和可观察耗时,不证明供应方 payload 上限或根因。图片统计包括原生 Responses 工具输出中的图片;旧的已存诊断可能把这些图片算作剩余历史。字节不是 tokens,耗时不是上传时长;小型无图请求也可能超时。参见[预算与超时指导](./docs/copilot-compaction.md),不要自动裁剪历史、禁用 proof、切换模型或增加重试。
|
|
104
104
|
|
|
105
|
+
同一失败还可包含请求级原生客户端的本地请求体写入/响应头里程碑、协商出的 TLS ALPN 与 Node 写缓冲字节数。这些只是本地提交观测,不是内核 ACK 或供应方接收证明;缺失事件不代表上传未完成。不支持或存在歧义的传输会明确报告证据不可用。不记录请求内容,也不改变连接、代理、dispatcher 或重试。
|
|
106
|
+
|
|
105
107
|
HTTP/SSE liveness 默认区分 5 分钟字节 idle 和有界的 10 分钟助手输出静默,排除消费者工作;WebSocket/显式 `auto`仍仅使用原生路径。这不修复供应方 HTTP 408。图片按原生实际投影 MIME 证据准入;插件不负责转换,也不按文件名猜格式支持。[图片兼容](./docs/image-input-compatibility.md)。
|
|
106
108
|
|
|
107
109
|
## 设置与排障
|
|
@@ -134,7 +136,7 @@ HTTP/SSE liveness 默认区分 5 分钟字节 idle 和有界的 10 分钟助手
|
|
|
134
136
|
| 选模未知/不可读 | 区分记录丢失与读取失败;Retry 只重读 |
|
|
135
137
|
| 缺失/取消后的 Turn Usage | 查看[用量限制](./docs/copilot-usage.md),不推断零计费 |
|
|
136
138
|
| 历史加载报 `github-copilot/auto-model-decision` | 使用[独立副本、先检查的恢复](./docs/automatic-model-routing.md#recovering-affected-histories);未经批准且未停写不得替换实际历史 |
|
|
137
|
-
| AUTH、Responses replay scope 或 TLS 错误 | 查看[请求诊断](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics)及[额度 TLS 边界](./docs/copilot-usage.md#account-data-boundary)。精确 scope
|
|
139
|
+
| AUTH、Responses replay scope 或 TLS 错误 | 查看[请求诊断](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics)及[额度 TLS 边界](./docs/copilot-usage.md#account-data-boundary)。精确 scope 拒绝后,**回放恢复**会在当前轮结束或打开会话时自动提示。查看旧加密项及项内摘要的损失后,可选择**仅下一轮使用恢复**(默认选项)或**在本会话内继续使用**;两者都要求验证状态不变,最长不超过证据产生后一小时。恢复默认关闭,确认授权也不发送消息,需另行使用原生发送或重试。不改磁盘历史,也不是 408 修复。不自动重置凭据或关闭 TLS。 |
|
|
138
140
|
| Hosted search 不可用 | 检查账号/协议/probe 诊断;旧 override 保留至显式 reset |
|
|
139
141
|
|
|
140
142
|
## 所有权与深入阅读
|
|
@@ -175,14 +177,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
|
|
|
175
177
|
GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
|
|
176
178
|
|
|
177
179
|
```sh
|
|
178
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
179
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
180
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.97/dsh-github-copilot-0.4.0-alpha.97.tgz
|
|
181
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.97/SHA256SUMS
|
|
180
182
|
sha256sum --check SHA256SUMS
|
|
181
183
|
```
|
|
182
184
|
|
|
183
185
|
```powershell
|
|
184
186
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
185
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
187
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.97.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
186
188
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
187
189
|
```
|
|
188
190
|
|
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.97"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -586,6 +586,7 @@
|
|
|
586
586
|
{"file": "src/auto-assessment-evidence.ts", "marker": "SemanticAssessmentEvidenceSchema"},
|
|
587
587
|
{"file": "src/request-body-timeout-marker.ts", "marker": "COPILOT_REQUEST_BODY_TIMEOUT"},
|
|
588
588
|
{"file": "src/request-body-evidence.ts", "marker": "REQUEST_BODY_EVIDENCE_LIMITS"},
|
|
589
|
+
{"file": "src/request-upload-evidence.ts", "marker": "createRequestUploadObserver"},
|
|
589
590
|
{"file": "src/copilot-stream-liveness.ts", "marker": "COPILOT_STREAM_IDLE_TIMEOUT"},
|
|
590
591
|
{"file": "src/preview-route.ts", "marker": "Math.min(idle * 2, 2_147_483_647)"},
|
|
591
592
|
{"file": "src/response-error-body.ts", "marker": "readResponseErrorJson"},
|
|
@@ -605,6 +606,9 @@
|
|
|
605
606
|
{"file": "tests/preview-route.spec.ts", "name": "enriches only a verified 408 while preserving native failure classification and retry ownership"},
|
|
606
607
|
{"file": "tests/preview-provider.spec.ts", "name": "observes verified %s timeout without changing bytes, Response, native retries or credential ownership"},
|
|
607
608
|
{"file": "tests/request-body-timeout.spec.ts", "name": "bounds stalled response observation and gives cancellation priority"},
|
|
609
|
+
{"file": "tests/request-upload-evidence.spec.ts", "name": "observes real Node Fetch without changing body, signal, Response, or installing a dispatcher"},
|
|
610
|
+
{"file": "tests/request-upload-evidence.spec.ts", "name": "keeps simultaneous scopes independent and ignores foreign broadcasts"},
|
|
611
|
+
{"file": "tests/preview-provider.spec.ts", "name": "records real local Fetch stages on a verified native timeout and disposes the observer on settlement"},
|
|
608
612
|
{"file": "tests/auto-task-assessment.spec.ts", "name": "captures bounded phase evidence for a timed-out partial result without treating it as a validated task"},
|
|
609
613
|
{"file": "tests/auto-task-evidence.spec.ts", "name": "captures monotonic auxiliary phases without text, accounting or late mutation"},
|
|
610
614
|
{"file": "tests/request-body-evidence.spec.ts", "name": "measures a nine MiB native-style inline image without exposing or decoding it"},
|
|
@@ -690,13 +694,16 @@
|
|
|
690
694
|
{"file": "src/replay-recovery-host.ts", "marker": "extends TypertRemoteService"},
|
|
691
695
|
{"file": "src/replay-recovery-host.ts", "marker": "COPILOT_REPLAY_RECOVERY_TURN_ACTIVE"},
|
|
692
696
|
{"file": "src/replay-recovery-remote.ts", "marker": "githubCopilotReplayRecovery.setEnabled"},
|
|
693
|
-
{"file": "src/replay-recovery-
|
|
697
|
+
{"file": "src/replay-recovery-remote.ts", "marker": "githubCopilotReplayRecovery.authorize"},
|
|
698
|
+
{"file": "src/replay-recovery-ui.ts", "marker": "Accept loss and authorize"}
|
|
694
699
|
],
|
|
695
700
|
"tests": [
|
|
696
701
|
{"file": "tests/replay-recovery.spec.ts", "name": "keeps default replay and requires a revision-bound confirmation"},
|
|
697
702
|
{"file": "tests/replay-recovery.spec.ts", "name": "preserves source, fresh reasoning, tools, other models and other owners"},
|
|
698
703
|
{"file": "tests/replay-recovery-host.spec.ts", "name": "requires the native initiating session and signal, rejects active-turn writes and revokes late requests"},
|
|
699
|
-
{"file": "tests/replay-recovery
|
|
704
|
+
{"file": "tests/replay-recovery.spec.ts", "name": "admits only the next matching native turn, including its steps and retries"},
|
|
705
|
+
{"file": "tests/replay-recovery-ui.spec.ts", "name": "automatically shows evidence but requires explicit %s consent, without sending"},
|
|
706
|
+
{"file": "tests/replay-recovery-ui.spec.ts", "name": "is absent normally, reads on settled turns without polling and resets dismissal only for new evidence"},
|
|
700
707
|
{"file": "tests/preview-route.spec.ts", "name": "offers exact failed replay only to its initiating session and recovers after explicit confirmation"},
|
|
701
708
|
{"file": "tests/fixtures/remote-core.fixture.ts", "name": "binds explicit replay recovery through native Client and %s Host gateways"}
|
|
702
709
|
]
|
|
@@ -77,6 +77,10 @@ HTTP `408 / user_request_timeout` is separate from input-budget overflow. For th
|
|
|
77
77
|
|
|
78
78
|
For [#263](https://github.com/cloga/dsh-github-copilot/issues/263), the same public final-body fetch hook additionally captures a monotonic fetch-invocation-to-response-header duration, before clone observation. This is round-trip latency, not measured upload progress, throughput or time spent reading the body. Only a verified exact error triggers numeric composition analysis; successful requests are not analyzed or retained.
|
|
79
79
|
|
|
80
|
+
For #291, request-scoped public Node/Undici diagnostic channels also observe local body-write completion and native response-header timing, negotiated TLS ALPN when exposed, and a public Node writable-buffer count at body-write completion. Exactly one matching native request is required; no matching event, multiple requests (such as redirects), and more than eight request identities yield explicit unavailable, ambiguous or work-limited evidence, never combined partial timings. H2 connection evidence does not depend on H1-only header-write events; reused H2 sockets or custom transports may leave ALPN unavailable. Subscriptions stop when Fetch settles, including errors, before bounded response-clone analysis. Only an exact verified timeout emits these numeric observations; no request fields, headers, URLs, content, replay or credentials are retained or logged. The original Fetch arguments, signal, Response/error, dispatcher, proxy, connections and retries remain native-owned.
|
|
81
|
+
|
|
82
|
+
Local `bodySent` means the client reported body-write completion, **not** measured upload duration, kernel acknowledgement, supplier receipt or model execution. No completion event is not proof that upload was incomplete. A zero Node writable buffer is likewise not proof of remote receipt. This can correlate later real failures without changing their classification, but does not establish a supplier cause or cure recurring 408s; synthetic healthy requests are not live failure acceptance.
|
|
83
|
+
|
|
80
84
|
Original serialized value spans partition total bytes into `input`/`messages`, tool definitions, protocol-owned top-level `instructions`/`system` and residual keys/framing. Within conversation only, supported structural image blocks and opaque replay string spans form disjoint subsets; the rest includes text/tool history, framing and unknown representations. Completions system/developer messages stay in conversation. Image URLs and file references are counted as wire blocks, not fetched/decoded file sizes. Responses encrypted content and Anthropic signature/redacted data are counted without interpreting or decrypting replay; no raw contents, IDs, hashes or credentials are reported.
|
|
81
85
|
|
|
82
86
|
Responses tool pictures are also image blocks: the native SDK serializes them under `function_call_output.output[]`, separately from ordinary message `content[]`. Older plugin diagnostics incorrectly classified those spans as remaining history, so an old report of zero image bytes does not establish an image-free request. The corrected diagnostic applies only to newly observed failures; stored failures and history are not rewritten. Unknown output arrays remain residual, and the fix changes neither total bytes nor native image admission, offload budgets, replay or transport.
|
|
@@ -91,11 +91,26 @@ IDs does not prove encrypted replay is portable.
|
|
|
91
91
|
### Explicit session replay recovery
|
|
92
92
|
|
|
93
93
|
After an exact verified managed Responses scope rejection, **Replay recovery**
|
|
94
|
-
in that session's composer
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
in that session's composer automatically offers the failed request's old
|
|
95
|
+
encrypted items on opening the eligible session, when its native `running`
|
|
96
|
+
snapshot settles, or when its `lastAgentError` changes while idle. These public
|
|
97
|
+
Session snapshot changes trigger read-only Host evidence reads, not model calls,
|
|
98
|
+
history reads, new durable events or polling. Normal sessions show no notice.
|
|
99
|
+
Dismissal is local to the mounted model/session and evidence revision; a new
|
|
100
|
+
failure can reappear. Read errors remain distinct from missing evidence.
|
|
101
|
+
|
|
102
|
+
Choose **Review recovery options**, then **Next matching turn only** (the
|
|
103
|
+
default choice) or **Continue in this session**, and **Accept loss and authorize**.
|
|
104
|
+
This does not send a message or retry the failed request. Use the native Send or
|
|
105
|
+
Retry control separately; the plugin adds no competing sender. Complete native
|
|
106
|
+
replay remains the default until explicit consent.
|
|
107
|
+
|
|
108
|
+
Next-turn consent is admitted on the next bound, matching-model native request
|
|
109
|
+
and covers all steps and native retries of that turn, not just one HTTP attempt.
|
|
110
|
+
It is consumed at that turn's `turn/end`, including cancelled/failed turns.
|
|
111
|
+
Other models, purposes and unbound requests cannot consume it. Session consent
|
|
112
|
+
survives turn endings but shares the same bounded evidence/proof lifetime.
|
|
113
|
+
Controls are disabled during a native turn; Host checks remain authoritative.
|
|
99
114
|
|
|
100
115
|
This is lossy recovery, not a supplier-scope repair. Only complete normalized
|
|
101
116
|
encrypted reasoning items whose entire serialized fingerprints match that
|
|
@@ -107,8 +122,12 @@ requires fresh confirmation rather than broadening enabled omission silently.
|
|
|
107
122
|
|
|
108
123
|
Evidence is bounded to 64 sessions, 512 distinct items per session, and one
|
|
109
124
|
hour in the current Host. Only hashes, a model label and confirmation metadata
|
|
110
|
-
are retained, never opaque payloads. The Client receives count/model/state
|
|
111
|
-
an opaque revision
|
|
125
|
+
are retained, never opaque payloads. The Client receives count/model/state,
|
|
126
|
+
an opaque revision, optional duration and evidence expiry only. The original
|
|
127
|
+
`get`/`setEnabled` descriptors retain their identities; `setEnabled(true)` still
|
|
128
|
+
means bounded session consent, and additive `authorize` selects a duration.
|
|
129
|
+
A one-shot expiry read updates the mounted notice, not a polling timer.
|
|
130
|
+
Token/account/metadata proof discontinuity, expiry,
|
|
112
131
|
session disposal or Host restart revokes evidence; an old error on disk cannot
|
|
113
132
|
create a candidate. Re-read status after these changes. Disabling affects
|
|
114
133
|
future requests and does not undo answers already generated.
|
package/lib/client.js
CHANGED
|
@@ -5781,11 +5781,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5781
5781
|
};
|
|
5782
5782
|
//#endregion
|
|
5783
5783
|
//#region lib/types/replay-recovery-types.js
|
|
5784
|
+
const ReplayRecoveryDurationSchema = _enum(["next-turn", "session"]);
|
|
5784
5785
|
const ReplayRecoveryViewSchema = discriminatedUnion("state", [object({ state: literal("unavailable") }).strict(), object({
|
|
5785
5786
|
state: _enum(["available", "enabled"]),
|
|
5786
5787
|
revision: string().uuid(),
|
|
5787
5788
|
itemCount: number().int().positive().max(512),
|
|
5788
|
-
model: string().min(1).max(256)
|
|
5789
|
+
model: string().min(1).max(256),
|
|
5790
|
+
duration: ReplayRecoveryDurationSchema.optional(),
|
|
5791
|
+
expiresAt: number().int().nonnegative().optional()
|
|
5789
5792
|
}).strict()]);
|
|
5790
5793
|
//#endregion
|
|
5791
5794
|
//#region lib/types/replay-recovery-remote.js
|
|
@@ -5798,37 +5801,63 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5798
5801
|
};
|
|
5799
5802
|
const contribution$1 = {
|
|
5800
5803
|
package: "dsh-github-copilot",
|
|
5801
|
-
descriptors: [
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5804
|
+
descriptors: [
|
|
5805
|
+
{
|
|
5806
|
+
id: "dsh-github-copilot:githubCopilotReplayRecovery.get",
|
|
5807
|
+
namespace: "githubCopilotReplayRecovery",
|
|
5808
|
+
service: "githubCopilotReplayRecovery",
|
|
5809
|
+
method: "get",
|
|
5810
|
+
invocation: { kind: "direct" },
|
|
5811
|
+
parameters: [agent],
|
|
5812
|
+
result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
|
|
5813
|
+
},
|
|
5814
|
+
{
|
|
5815
|
+
id: "dsh-github-copilot:githubCopilotReplayRecovery.authorize",
|
|
5816
|
+
namespace: "githubCopilotReplayRecovery",
|
|
5817
|
+
service: "githubCopilotReplayRecovery",
|
|
5818
|
+
method: "authorize",
|
|
5819
|
+
invocation: { kind: "direct" },
|
|
5820
|
+
parameters: [
|
|
5821
|
+
agent,
|
|
5822
|
+
{
|
|
5823
|
+
name: "revision",
|
|
5824
|
+
wire: "revision",
|
|
5825
|
+
source: "json",
|
|
5826
|
+
codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryRevision", string().uuid())
|
|
5827
|
+
},
|
|
5828
|
+
{
|
|
5829
|
+
name: "duration",
|
|
5830
|
+
wire: "duration",
|
|
5831
|
+
source: "json",
|
|
5832
|
+
codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryDuration", ReplayRecoveryDurationSchema)
|
|
5833
|
+
}
|
|
5834
|
+
],
|
|
5835
|
+
result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
|
|
5836
|
+
},
|
|
5837
|
+
{
|
|
5838
|
+
id: "dsh-github-copilot:githubCopilotReplayRecovery.setEnabled",
|
|
5839
|
+
namespace: "githubCopilotReplayRecovery",
|
|
5840
|
+
service: "githubCopilotReplayRecovery",
|
|
5841
|
+
method: "setEnabled",
|
|
5842
|
+
invocation: { kind: "direct" },
|
|
5843
|
+
parameters: [
|
|
5844
|
+
agent,
|
|
5845
|
+
{
|
|
5846
|
+
name: "revision",
|
|
5847
|
+
wire: "revision",
|
|
5848
|
+
source: "json",
|
|
5849
|
+
codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryRevision", string().uuid())
|
|
5850
|
+
},
|
|
5851
|
+
{
|
|
5852
|
+
name: "enabled",
|
|
5853
|
+
wire: "enabled",
|
|
5854
|
+
source: "json",
|
|
5855
|
+
codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryEnabled", boolean())
|
|
5856
|
+
}
|
|
5857
|
+
],
|
|
5858
|
+
result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
|
|
5859
|
+
}
|
|
5860
|
+
]
|
|
5832
5861
|
};
|
|
5833
5862
|
//#endregion
|
|
5834
5863
|
//#region lib/types/remote.js
|
|
@@ -8770,13 +8799,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8770
8799
|
function record(value) {
|
|
8771
8800
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
8772
8801
|
}
|
|
8773
|
-
function ReplayRecoveryCard({ sessionId, remote, locale = "en" }) {
|
|
8802
|
+
function ReplayRecoveryCard({ sessionId, remote, locale = "en", running = false, refreshKey = "" }) {
|
|
8774
8803
|
const zh = locale.startsWith("zh");
|
|
8804
|
+
const durationName = (0, react.useId)();
|
|
8775
8805
|
const [view, setView] = (0, react.useState)();
|
|
8776
8806
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
8777
8807
|
const [error, setError] = (0, react.useState)(false);
|
|
8778
8808
|
const [confirm, setConfirm] = (0, react.useState)(false);
|
|
8809
|
+
const [duration, setDuration] = (0, react.useState)("next-turn");
|
|
8810
|
+
const [dismissed, setDismissed] = (0, react.useState)();
|
|
8811
|
+
const [hadEvidence, setHadEvidence] = (0, react.useState)(false);
|
|
8812
|
+
const latest = (0, react.useRef)(view);
|
|
8813
|
+
const active = (0, react.useRef)(running);
|
|
8814
|
+
latest.current = view;
|
|
8815
|
+
active.current = running;
|
|
8779
8816
|
const pending = (0, react.useRef)(false);
|
|
8817
|
+
const refreshPending = (0, react.useRef)(false);
|
|
8780
8818
|
const mounted = (0, react.useRef)(true);
|
|
8781
8819
|
(0, react.useEffect)(() => {
|
|
8782
8820
|
mounted.current = true;
|
|
@@ -8784,18 +8822,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8784
8822
|
mounted.current = false;
|
|
8785
8823
|
};
|
|
8786
8824
|
}, []);
|
|
8787
|
-
const perform = async (
|
|
8788
|
-
if (pending.current)
|
|
8825
|
+
const perform = (0, react.useCallback)(async (authorization) => {
|
|
8826
|
+
if (pending.current) {
|
|
8827
|
+
if (authorization === void 0) refreshPending.current = true;
|
|
8828
|
+
return;
|
|
8829
|
+
}
|
|
8830
|
+
if (active.current) return;
|
|
8789
8831
|
pending.current = true;
|
|
8790
8832
|
setBusy(true);
|
|
8791
8833
|
setError(false);
|
|
8792
8834
|
setConfirm(false);
|
|
8793
8835
|
try {
|
|
8794
|
-
const
|
|
8836
|
+
const current = latest.current;
|
|
8837
|
+
const result = authorization === void 0 ? await remote.get(sessionId) : current && current.state !== "unavailable" ? authorization === false ? await remote.setEnabled(sessionId, current.revision, false) : await remote.authorize(sessionId, current.revision, authorization) : void 0;
|
|
8795
8838
|
const parsed = result?.ok ? ReplayRecoveryViewSchema.safeParse(result.value) : void 0;
|
|
8796
8839
|
if (!mounted.current) return;
|
|
8797
|
-
if (parsed?.success)
|
|
8798
|
-
|
|
8840
|
+
if (parsed?.success) {
|
|
8841
|
+
setView(parsed.data);
|
|
8842
|
+
if (parsed.data.state !== "unavailable") setHadEvidence(true);
|
|
8843
|
+
} else {
|
|
8799
8844
|
setView(void 0);
|
|
8800
8845
|
setError(true);
|
|
8801
8846
|
}
|
|
@@ -8806,9 +8851,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8806
8851
|
}
|
|
8807
8852
|
} finally {
|
|
8808
8853
|
pending.current = false;
|
|
8809
|
-
if (mounted.current)
|
|
8854
|
+
if (mounted.current) {
|
|
8855
|
+
setBusy(false);
|
|
8856
|
+
if (refreshPending.current) {
|
|
8857
|
+
refreshPending.current = false;
|
|
8858
|
+
perform();
|
|
8859
|
+
}
|
|
8860
|
+
}
|
|
8810
8861
|
}
|
|
8811
|
-
};
|
|
8862
|
+
}, [remote, sessionId]);
|
|
8863
|
+
(0, react.useEffect)(() => {
|
|
8864
|
+
setConfirm(false);
|
|
8865
|
+
if (!running) perform();
|
|
8866
|
+
}, [
|
|
8867
|
+
running,
|
|
8868
|
+
refreshKey,
|
|
8869
|
+
perform
|
|
8870
|
+
]);
|
|
8871
|
+
const expiresAt = view && view.state !== "unavailable" ? view.expiresAt : void 0;
|
|
8872
|
+
(0, react.useEffect)(() => {
|
|
8873
|
+
if (expiresAt === void 0) return;
|
|
8874
|
+
const timer = setTimeout(() => void perform(), Math.max(0, expiresAt - Date.now()));
|
|
8875
|
+
return () => clearTimeout(timer);
|
|
8876
|
+
}, [expiresAt, perform]);
|
|
8812
8877
|
const button = {
|
|
8813
8878
|
font: "inherit",
|
|
8814
8879
|
color: "inherit",
|
|
@@ -8817,38 +8882,79 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8817
8882
|
borderRadius: 6,
|
|
8818
8883
|
padding: "6px 10px"
|
|
8819
8884
|
};
|
|
8820
|
-
|
|
8885
|
+
const disabled = busy || running;
|
|
8886
|
+
const evidence = view && view.state !== "unavailable" ? view : void 0;
|
|
8887
|
+
if (!error && !evidence && !hadEvidence) return null;
|
|
8888
|
+
if (!error && evidence?.state === "available" && dismissed === evidence.revision) return (0, react.createElement)("button", {
|
|
8889
|
+
type: "button",
|
|
8890
|
+
style: button,
|
|
8891
|
+
disabled,
|
|
8892
|
+
onClick: () => setDismissed(void 0)
|
|
8893
|
+
}, zh ? "回放恢复 · 查看" : "Replay recovery · Review");
|
|
8894
|
+
return (0, react.createElement)("section", {
|
|
8895
|
+
"aria-label": zh ? "回放恢复" : "Replay recovery",
|
|
8896
|
+
"aria-busy": busy,
|
|
8821
8897
|
style: {
|
|
8822
8898
|
maxWidth: "min(100%, 38rem)",
|
|
8823
|
-
overflowWrap: "anywhere"
|
|
8824
|
-
|
|
8825
|
-
onToggle: (event) => {
|
|
8826
|
-
if (event.currentTarget.open && view === void 0 && !busy && !error) perform();
|
|
8899
|
+
overflowWrap: "anywhere",
|
|
8900
|
+
paddingBlock: 8
|
|
8827
8901
|
}
|
|
8828
|
-
}, (0, react.createElement)("
|
|
8902
|
+
}, (0, react.createElement)("strong", { role: "status" }, evidence?.state === "enabled" ? zh ? "回放恢复已授权" : "Replay recovery authorized" : evidence ? zh ? "旧推理回放被拒绝" : "Old reasoning replay was rejected" : zh ? "回放恢复" : "Replay recovery"), error ? (0, react.createElement)("p", { role: "alert" }, 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", null, zh ? "授权或失败证据已失效。恢复未启用;没有当前可用的失败证据。" : "Authorization or failure evidence expired. Recovery is off; no current failure evidence is available.") : null, evidence ? (0, react.createElement)("div", null, (0, react.createElement)("p", null, zh ? `${evidence.model}:${evidence.itemCount} 条已识别的旧加密推理项。` : `${evidence.model}: ${evidence.itemCount} identified old encrypted reasoning items.`), evidence.state === "enabled" ? (0, react.createElement)("p", null, evidence.duration === "next-turn" ? zh ? "仅下一轮使用恢复,覆盖该轮的全部步骤与原生重试,轮结束即关闭。" : "Authorized for the next matching turn only, including all its steps and native retries; turns off when that turn ends." : zh ? "本会话继续使用恢复,直到关闭或验证状态失效。" : "Authorized for this session until disabled or validation expires.", " ", zh ? "尚未发送消息。请使用原生发送或重试按钮继续。" : "No message has been sent. Use the native Send or Retry control to continue.") : (0, react.createElement)("p", null, zh ? "恢复未启用。确认损失后才能跳过这些旧项;不会自动重试。" : "Recovery is off. Review the loss before skipping these old items; nothing is retried automatically."), confirm ? (0, react.createElement)("div", null, (0, react.createElement)("p", null, zh ? "恢复会跳过已识别的旧项,包括对应隐藏推理状态及项内摘要。磁盘历史、界面可见消息及工具调用保持不变;新推理照常保留。关闭不能撤销已生成的回答。" : "Recovery skips the identified old items, including their hidden reasoning state and item summaries. Stored history, displayed messages and tool calls stay unchanged; new reasoning is retained. Disabling cannot undo generated answers."), (0, react.createElement)("fieldset", {
|
|
8903
|
+
disabled,
|
|
8904
|
+
style: {
|
|
8905
|
+
border: 0,
|
|
8906
|
+
padding: 0,
|
|
8907
|
+
marginBlock: 12
|
|
8908
|
+
}
|
|
8909
|
+
}, (0, react.createElement)("legend", null, zh ? "授权范围" : "Authorization duration"), ...["next-turn", "session"].map((value) => (0, react.createElement)("label", {
|
|
8910
|
+
key: value,
|
|
8911
|
+
style: {
|
|
8912
|
+
display: "block",
|
|
8913
|
+
paddingBlock: 6
|
|
8914
|
+
}
|
|
8915
|
+
}, (0, react.createElement)("input", {
|
|
8916
|
+
type: "radio",
|
|
8917
|
+
name: durationName,
|
|
8918
|
+
value,
|
|
8919
|
+
checked: duration === value,
|
|
8920
|
+
onChange: () => setDuration(value)
|
|
8921
|
+
}), " ", value === "next-turn" ? zh ? "仅下一轮使用恢复" : "Next matching turn only" : zh ? "在本会话内继续使用" : "Continue in this session"))), (0, react.createElement)("p", null, zh ? "两种授权都只适用于相同模型及验证状态,最长不超过失败证据产生后一小时;Host 重启后失效。不会处理 408、额度或上下文超限。" : "Both options require the same model and validation state, expire within one hour of the failure, and are lost on Host restart. Not a remedy for 408, quota or context limits."), (0, react.createElement)("div", { style: {
|
|
8922
|
+
display: "flex",
|
|
8923
|
+
flexWrap: "wrap",
|
|
8924
|
+
gap: 8
|
|
8925
|
+
} }, (0, react.createElement)("button", {
|
|
8829
8926
|
type: "button",
|
|
8830
8927
|
style: button,
|
|
8831
|
-
disabled
|
|
8832
|
-
onClick: () => void perform(
|
|
8833
|
-
}, zh ? "
|
|
8928
|
+
disabled,
|
|
8929
|
+
onClick: () => void perform(duration)
|
|
8930
|
+
}, zh ? "接受损失并授权" : "Accept loss and authorize"), (0, react.createElement)("button", {
|
|
8834
8931
|
type: "button",
|
|
8835
8932
|
style: button,
|
|
8836
|
-
disabled
|
|
8933
|
+
disabled,
|
|
8837
8934
|
onClick: () => setConfirm(false)
|
|
8838
|
-
}, zh ? "取消" : "Cancel")) : (0, react.createElement)("
|
|
8935
|
+
}, zh ? "取消" : "Cancel"))) : (0, react.createElement)("div", { style: {
|
|
8936
|
+
display: "flex",
|
|
8937
|
+
flexWrap: "wrap",
|
|
8938
|
+
gap: 8
|
|
8939
|
+
} }, (0, react.createElement)("button", {
|
|
8839
8940
|
type: "button",
|
|
8840
8941
|
style: button,
|
|
8841
|
-
disabled
|
|
8842
|
-
onClick: () =>
|
|
8843
|
-
},
|
|
8942
|
+
disabled,
|
|
8943
|
+
onClick: () => evidence.state === "enabled" ? void perform(false) : (setDuration("next-turn"), setConfirm(true))
|
|
8944
|
+
}, evidence.state === "enabled" ? zh ? "关闭恢复" : "Disable recovery" : zh ? "查看恢复选项" : "Review recovery options"), evidence.state === "available" ? (0, react.createElement)("button", {
|
|
8945
|
+
type: "button",
|
|
8946
|
+
style: button,
|
|
8947
|
+
disabled,
|
|
8948
|
+
onClick: () => setDismissed(evidence.revision)
|
|
8949
|
+
}, zh ? "暂不处理" : "Not now") : null)) : null, running ? (0, react.createElement)("p", { role: "status" }, zh ? "当前轮进行中,结束后自动更新。" : "Turn in progress; status updates when it ends.") : null, (0, react.createElement)("button", {
|
|
8844
8950
|
type: "button",
|
|
8845
8951
|
style: {
|
|
8846
8952
|
...button,
|
|
8847
8953
|
marginBlock: 8
|
|
8848
8954
|
},
|
|
8849
|
-
disabled
|
|
8955
|
+
disabled,
|
|
8850
8956
|
onClick: () => void perform()
|
|
8851
|
-
}, zh ? "重新读取状态" : "Read status again"));
|
|
8957
|
+
}, busy ? zh ? "正在读取…" : "Reading…" : zh ? "重新读取状态" : "Read status again"));
|
|
8852
8958
|
}
|
|
8853
8959
|
function isSlots(value) {
|
|
8854
8960
|
return record(value) && typeof value.spec === "function" && typeof value.inject === "function" && typeof value.register === "function";
|
|
@@ -8862,13 +8968,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8862
8968
|
function Surface({ runtime, remote, locale }) {
|
|
8863
8969
|
const valid = runtime.useSession((value) => record(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
|
|
8864
8970
|
const selected = runtime.useProjection("modelSelection");
|
|
8971
|
+
const running = runtime.useSession((value) => !record(value) || value.running !== false);
|
|
8972
|
+
const lastError = runtime.useSession((value) => record(value) && typeof value.lastAgentError === "string" ? value.lastAgentError : "");
|
|
8865
8973
|
const language = (0, react.useSyncExternalStore)((listener) => locale?.subscribe(listener) ?? noop, () => locale?.getLocale().active ?? "en", () => "en");
|
|
8866
8974
|
if (!valid || !record(selected) || !record(selected.next) || selected.next.provider !== "github-copilot-preview") return null;
|
|
8867
8975
|
return (0, react.createElement)(ReplayRecoveryCard, {
|
|
8868
|
-
key: runtime.sessionId,
|
|
8976
|
+
key: JSON.stringify([runtime.sessionId, selected.next.model]),
|
|
8869
8977
|
sessionId: runtime.sessionId,
|
|
8870
8978
|
remote,
|
|
8871
|
-
locale: language
|
|
8979
|
+
locale: language,
|
|
8980
|
+
running,
|
|
8981
|
+
refreshKey: lastError
|
|
8872
8982
|
});
|
|
8873
8983
|
}
|
|
8874
8984
|
function registerReplayRecoveryUi(ctx) {
|