dsh-github-copilot 0.4.0-alpha.74 → 0.4.0-alpha.75
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 +1 -0
- package/CHANGELOG.md +6 -0
- package/README.md +9 -7
- package/README.zh.md +9 -7
- package/deployment-baseline.json +6 -1
- package/docs/copilot-compaction.md +2 -0
- package/docs/model-compatibility-acceptance.md +1 -0
- package/lib/index.js +103 -58
- package/lib/types/preview-provider.d.ts +2 -0
- package/lib/types/request-body-timeout.d.ts +3 -0
- package/lib/types/response-error-body.d.ts +3 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -72,6 +72,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
|
|
|
72
72
|
- `src/wire.ts`, `src/wire-anthropic.ts`: inline hosted-search streaming.
|
|
73
73
|
- `src/traditional-search.ts`: `github-copilot-hosted` `ctx.web` provider.
|
|
74
74
|
- `src/serialize.ts`, `src/sse.ts`, `src/failure.ts`: protocol conversion and bounded error handling.
|
|
75
|
+
- `src/response-error-body.ts`, `src/request-body-timeout.ts`: bounded clone-only HTTP error evidence and safe managed upload-timeout guidance. Exact verified `408/user_request_timeout` preserves native failure classification/retry metadata; 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.
|
|
75
76
|
- `tests/`: unit and integration evidence; mirror the source area being changed.
|
|
76
77
|
- `deployment-baseline.json`: declared machine-readable compatibility and capability evidence inventory.
|
|
77
78
|
- `scripts/verify-deployment-baseline.mjs`: invariant drift gate.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.75 (prepared)
|
|
4
|
+
|
|
5
|
+
- Add safe, actionable managed `COPILOT_REQUEST_BODY_TIMEOUT` guidance for the exact observed HTTP 408 request-body timeout, including final JSON UTF-8 bytes when observable (#246).
|
|
6
|
+
- Preserve native failure classification, retry metadata, payloads, cancellation and credential ownership; no new retry, timeout change, automatic compaction, hidden trimming or model switch.
|
|
7
|
+
- Share the existing bounded clone-only response observer with replay-scope classification and cover all three native HTTP protocols, unknown/oversized/stalled replies and concurrent dispatch isolation. This is diagnostic/recovery guidance, not a claim to eliminate upstream timeouts.
|
|
8
|
+
|
|
3
9
|
## 0.4.0-alpha.74 (prepared)
|
|
4
10
|
|
|
5
11
|
- Add `/copilot-compact [status|cancel]` to the explicitly selected recovery engine when native commands/jobs are available (#244).
|
package/README.md
CHANGED
|
@@ -30,6 +30,8 @@ On official rc.2, routing is exposed through native live `Config` fields, not a
|
|
|
30
30
|
|
|
31
31
|
## Compatibility baselines and qualification targets
|
|
32
32
|
|
|
33
|
+
Managed Copilot HTTP `408 / user_request_timeout` with the verified request-body timeout message now reports `COPILOT_REQUEST_BODY_TIMEOUT` and the final JSON request's UTF-8 byte count when observable. Bytes are not context tokens, and a request-body timeout does not prove context overflow. Native retries and failure classification remain unchanged. If retries exhaust, explicitly compact the conversation or reduce attachments/tool output before retrying, and check network/proxy health and [GitHub service status](https://www.githubstatus.com/). Compaction is not guaranteed to succeed or cure network/service faults; increasing a client timeout cannot change the server timeout. No automatic history trimming, model switch, compaction or new retry loop is introduced. Unknown errors retain native behavior.
|
|
34
|
+
|
|
33
35
|
| DSH surface | Exact source pin | Models UI seam |
|
|
34
36
|
|---|---|---|
|
|
35
37
|
| Controlled Desktop `0.1.1-rc.2` baseline | Controlled Core commit [`a772dbb`](https://github.com/cloga/deepseek-harness/commit/a772dbbde82780bff2b9394427e9f0a24cafa1d5) on `cloga-pi-ai-model-api` | Dedicated **Settings → GitHub Copilot** section |
|
|
@@ -104,7 +106,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
|
|
|
104
106
|
|
|
105
107
|
## Install and sign in
|
|
106
108
|
|
|
107
|
-
The commands below target the package version `0.4.0-alpha.
|
|
109
|
+
The commands below target the package version `0.4.0-alpha.75`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
|
|
108
110
|
|
|
109
111
|
Before installing/updating, unpack the **checksum-verified** archive into a temporary directory and run its read-only composition preflight (replace all paths with absolute paths for the intended profile):
|
|
110
112
|
|
|
@@ -117,10 +119,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
|
|
|
117
119
|
For a standalone named profile only, the supported CLI command is:
|
|
118
120
|
|
|
119
121
|
```sh
|
|
120
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
122
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.75/dsh-github-copilot-0.4.0-alpha.75.tgz
|
|
121
123
|
```
|
|
122
124
|
|
|
123
|
-
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.
|
|
125
|
+
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.75` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
|
|
124
126
|
|
|
125
127
|
Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in**, and complete the GitHub device-code flow. Plugin installation changes the selected profile; activation follows that profile's normal reload/restart policy.
|
|
126
128
|
|
|
@@ -173,7 +175,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
|
|
|
173
175
|
5. Confirm **Signed in** and inspect the automatic discovery result before asking the user to choose a model. Already-signed-in Models opening ensures missing/stale metadata automatically; fresh ready cache makes no request. Use visible **Retry** for errors or **Manage → Refresh models** for an intentional forced update, not routine setup. Status alone does not discover, and login, metadata and successful model calls remain separate evidence.
|
|
174
176
|
6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
|
|
175
177
|
|
|
176
|
-
GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.
|
|
178
|
+
GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.75`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
|
|
177
179
|
|
|
178
180
|
**Desktop package-update and Web-lifecycle boundaries:** the native manager's `restart-required` result for an in-place installed-package upgrade is authoritative and distinct from plugin-bundle removal/re-add behavior. Any disable, removal, or upgrade involving service recomposition (`cordis.patch.yml`, such as the isolated routed web search layer) may leave dependent entries pending until Desktop is fully exited and cold-restarted. If the native manager reports only entries such as `pending (waiting for service: web)` while this plugin already shows **Off**, the requested disabled state has been persisted; cold-restart Desktop instead of repeatedly toggling or reinstalling the plugin. Other errors are not covered by this guidance and must still be investigated.
|
|
179
181
|
|
|
@@ -450,8 +452,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
|
|
|
450
452
|
`package.json` declares public npm distribution. A release tag must equal `v${package.json.version}`. Versions use standard SemVer prerelease labels (`alpha`, `beta`, or `rc`), each with its matching npm dist-tag; only stable versions use `latest`. The Release workflow performs the frozen install and complete verification gate, packs once (or recovers the original archive on retry), verifies `SHA256SUMS`, publishes the immutable GitHub Release and then publishes those same bytes to npm through OIDC. Either channel failing means delivery is incomplete. First package creation needs an authorized maintainer; staging requires an existing package and is not a first-package bootstrap. Historical releases are not republished.
|
|
451
453
|
|
|
452
454
|
```sh
|
|
453
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
454
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
455
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.75/dsh-github-copilot-0.4.0-alpha.75.tgz
|
|
456
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.75/SHA256SUMS
|
|
455
457
|
sha256sum --check SHA256SUMS
|
|
456
458
|
```
|
|
457
459
|
|
|
@@ -459,7 +461,7 @@ PowerShell can verify the same two downloaded files with:
|
|
|
459
461
|
|
|
460
462
|
```powershell
|
|
461
463
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
462
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
464
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.75.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
463
465
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
464
466
|
```
|
|
465
467
|
|
package/README.zh.md
CHANGED
|
@@ -26,7 +26,7 @@ Core 管理。详见[图片兼容性与限制](./docs/image-input-compatibility.
|
|
|
26
26
|
|
|
27
27
|
截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
|
|
28
28
|
|
|
29
|
-
> 当前文档与安装命令对应版本 `0.4.0-alpha.
|
|
29
|
+
> 当前文档与安装命令对应版本 `0.4.0-alpha.75`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
|
|
30
30
|
|
|
31
31
|
Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
|
|
32
32
|
|
|
@@ -34,6 +34,8 @@ Web search 路由现在优先显示在插件详情页;宿主不支持详情页
|
|
|
34
34
|
|
|
35
35
|
## 兼容基线与待验收目标
|
|
36
36
|
|
|
37
|
+
托管 Copilot 返回 `408 / user_request_timeout` 且确认是读取请求体超时时,现会显示 `COPILOT_REQUEST_BODY_TIMEOUT`,并在可观测时给出最终 JSON 请求的 UTF-8 字节数。字节不是上下文 token,上传超时也不证明上下文超限。原生重试与失败分类保持不变。重试耗尽后,可显式压缩会话或减少附件/工具输出再试,并检查网络/代理及 [GitHub 服务状态](https://www.githubstatus.com/)。压缩不保证成功,也无法修复网络或服务故障;调大客户端超时不会改变服务端超时。插件不会自动裁剪历史、切换模型、压缩或新增重试循环,未识别错误仍由原生流程处理。
|
|
38
|
+
|
|
37
39
|
| DSH 表面 | 精确源码 pin | Models UI 接口 |
|
|
38
40
|
|---|---|---|
|
|
39
41
|
| 受控 Desktop `0.1.1-rc.2` 基线 | `cloga-pi-ai-model-api` 上的受控 Core commit [`a772dbb`](https://github.com/cloga/deepseek-harness/commit/a772dbbde82780bff2b9394427e9f0a24cafa1d5) | 独立的 **Settings → GitHub Copilot** section |
|
|
@@ -119,10 +121,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
119
121
|
仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
|
|
120
122
|
|
|
121
123
|
```sh
|
|
122
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
124
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.75/dsh-github-copilot-0.4.0-alpha.75.tgz
|
|
123
125
|
```
|
|
124
126
|
|
|
125
|
-
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.
|
|
127
|
+
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.75`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
|
|
126
128
|
|
|
127
129
|
随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
|
|
128
130
|
|
|
@@ -175,7 +177,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
|
|
|
175
177
|
5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
|
|
176
178
|
6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
|
|
177
179
|
|
|
178
|
-
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.
|
|
180
|
+
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.75`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
|
|
179
181
|
|
|
180
182
|
**Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
|
|
181
183
|
|
|
@@ -461,8 +463,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
|
|
|
461
463
|
`package.json` 声明公开 npm 分发。Release tag 必须严格等于 `v${package.json.version}`。预发布使用 `alpha`、`beta` 或 `rc` 及对应 npm dist-tag,只有稳定版使用 `latest`。Release workflow 执行 frozen install 和完整门禁,只打包一次(重试恢复原始归档),验证 `SHA256SUMS`,发布不可变 GitHub Release,再通过 OIDC 将同一份字节发布到 npm。任一渠道失败都表示交付未完成。首次建包须由获准环境中的维护者完成;staging 要求包已存在,不能代替首次建包。不会批量补发历史版本。
|
|
462
464
|
|
|
463
465
|
```sh
|
|
464
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
465
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
466
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.75/dsh-github-copilot-0.4.0-alpha.75.tgz
|
|
467
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.75/SHA256SUMS
|
|
466
468
|
sha256sum --check SHA256SUMS
|
|
467
469
|
```
|
|
468
470
|
|
|
@@ -470,7 +472,7 @@ PowerShell 可以对已下载的同一组文件执行:
|
|
|
470
472
|
|
|
471
473
|
```powershell
|
|
472
474
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
473
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
475
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.75.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
474
476
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
475
477
|
```
|
|
476
478
|
|
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.75"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -546,6 +546,8 @@
|
|
|
546
546
|
{"file": "src/preview-route.ts", "marker": "ctx.llm.registerAdapter"},
|
|
547
547
|
{"file": "src/preview-route.ts", "marker": "createAccountModelSource"},
|
|
548
548
|
{"file": "src/preview-provider.ts", "marker": "native.streamSimple"},
|
|
549
|
+
{"file": "src/request-body-timeout.ts", "marker": "COPILOT_REQUEST_BODY_TIMEOUT"},
|
|
550
|
+
{"file": "src/response-error-body.ts", "marker": "readResponseErrorJson"},
|
|
549
551
|
{"file": "src/pi-provider-bridge.ts", "marker": "PiStreamPublicCompatibility"}
|
|
550
552
|
],
|
|
551
553
|
"tests": [
|
|
@@ -557,6 +559,9 @@
|
|
|
557
559
|
{"file": "tests/preview-route.spec.ts", "name": "discovers mixed and unseen account models without model-name routing rules"},
|
|
558
560
|
{"file": "tests/preview-route.spec.ts", "name": "uses unmodified stock LlmRuntime preparation and leaves canonical model registration alone"},
|
|
559
561
|
{"file": "tests/preview-route.spec.ts", "name": "replays opaque reasoning and tool-call identities through the native adapter on a second turn"},
|
|
562
|
+
{"file": "tests/preview-route.spec.ts", "name": "enriches only a verified 408 while preserving native failure classification and retry ownership"},
|
|
563
|
+
{"file": "tests/preview-provider.spec.ts", "name": "observes verified %s timeout without changing bytes, Response, native retries or credential ownership"},
|
|
564
|
+
{"file": "tests/request-body-timeout.spec.ts", "name": "bounds stalled response observation and gives cancellation priority"},
|
|
560
565
|
{"file": "tests/pi-provider-bridge.spec.ts", "name": "preserves the stream object rather than copying or replacing its private queue"},
|
|
561
566
|
{"file": "tests/pi-provider-bridge.spec.ts", "name": "passes the checked simple input through and rejects unsupported advanced entry without I/O"}
|
|
562
567
|
]
|
|
@@ -61,6 +61,8 @@ The existing `enabled` switch remains hosted-search-only. These controls do not
|
|
|
61
61
|
|
|
62
62
|
## Existing oversized history and recovery limits
|
|
63
63
|
|
|
64
|
+
HTTP `408 / user_request_timeout` is separate from input-budget overflow. For the exact observed request-body timeout response, the managed route supplies a safe `COPILOT_REQUEST_BODY_TIMEOUT` diagnostic and final JSON UTF-8 byte count when available, while preserving native failure classification and retries. These bytes include serialized messages, tools and replay/attachments; they are not token occupancy or an advertised HTTP-size limit. Repeated unchanged retries cannot reduce the request. After retries exhaust, an explicit native compaction may reduce compressible history, but giant fixed prefixes/attachments and network/service faults may remain. The existing optional manual recovery engine must be separately selected; installing the account plugin does not enable it. No 408 triggers automatic compaction, hidden history trimming, credential refresh, model switching, timeout changes or a second retry loop. Consult [GitHub troubleshooting](https://docs.github.com/en/copilot/how-tos/troubleshoot-copilot/troubleshoot-common-issues) and [service status](https://www.githubstatus.com/) without bypassing network policy.
|
|
65
|
+
|
|
64
66
|
This implementation is preventive, not a general rescue summarizer. A manual summary whose full input already exceeds the hard budget fails before model transport. It does not silently trim, fabricate a partial checkpoint, or claim that refusing the request recovered the history. Giant fixed prefixes or an indivisible latest unit can also prevent useful reduction.
|
|
65
67
|
|
|
66
68
|
The #228 investigation confirmed a separate Auto undercount (#230): Core reasoning blocks caused the incompatible pi-ai estimator to throw and drop complete assistant messages. Auto now uses the native Core meter, without changing final native provider admission. This fixes candidate selection evidence, not a genuinely oversized summary. In the reported failure class, a roughly 508k-token summary input exceeded a roughly 368k-token input budget even with a 65,536-token output reservation. Reducing output reservation cannot remove an independently binding prompt ceiling.
|
|
@@ -20,6 +20,7 @@ Follow the [plugin-only boundary](../AGENTS.md#plugin-only-implementation-bounda
|
|
|
20
20
|
- Include GPT-6 Astra, Gemini 3.8 Flash and GPT-5.6 Sol Fast metadata fixtures, plus arbitrary unseen IDs on all three supported protocols. The unseen-ID cases must pass without adding those IDs to implementation tables.
|
|
21
21
|
- Cover missing/conflicting endpoints, missing/invalid limits, duplicate conflicting IDs, explicit denial, stale account snapshots, unsupported reasoning labels, unknown fields and hostile extra getters.
|
|
22
22
|
- Exercise real published adapter/SDK code against local synthetic HTTP for all supported protocols, including tools, public summaries, two-turn opaque replay, images and interruption/retry paths. Synthetic results are not claims of live account availability.
|
|
23
|
+
- Verify managed request-body timeout guidance only for the observed HTTP `408`, exact `user_request_timeout` code and request-body message. Bound clone reads to 8 KiB/250 ms, retain the original native response, and expose only fixed guidance plus final string-body UTF-8 bytes. Preserve failure code, retry metadata, cancellation, unchanged retry payloads and independent dispatches. Do not reclassify 408 as overflow, invent a safe byte threshold, change client timeouts, refresh OAuth, compact automatically or promise elimination of upstream failures.
|
|
23
24
|
- Run source/test typechecks, complete repository tests, built Host/Client/Remote smoke, archive verification, and relevant unchanged-Core compatibility fixtures. Do not suppress type or test failures to bridge incompatible SDK versions.
|
|
24
25
|
|
|
25
26
|
## Explicit public-interface limits
|
package/lib/index.js
CHANGED
|
@@ -1700,7 +1700,7 @@ const usageSchema = z$1.object({
|
|
|
1700
1700
|
totalTokens: count.optional(),
|
|
1701
1701
|
reasoningTokens: count.optional()
|
|
1702
1702
|
});
|
|
1703
|
-
function record$
|
|
1703
|
+
function record$5(value) {
|
|
1704
1704
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1705
1705
|
}
|
|
1706
1706
|
function sameRoute$1(left, right) {
|
|
@@ -1719,10 +1719,10 @@ function initialContextEvidence() {
|
|
|
1719
1719
|
}
|
|
1720
1720
|
/** Read only counts and routing leaves; never message content or opaque replay. */
|
|
1721
1721
|
function foldContextEvidence(state, event) {
|
|
1722
|
-
if (!record$
|
|
1722
|
+
if (!record$5(event) || typeof event.type !== "string" || !record$5(event.data)) return state;
|
|
1723
1723
|
if (event.type === "request/header" || event.type === "model/selection") {
|
|
1724
|
-
const raw = event.type === "request/header" ? record$
|
|
1725
|
-
if (!record$
|
|
1724
|
+
const raw = event.type === "request/header" ? record$5(event.data.header) ? event.data.header.config : void 0 : event.data;
|
|
1725
|
+
if (!record$5(raw)) return {
|
|
1726
1726
|
...state,
|
|
1727
1727
|
route: null,
|
|
1728
1728
|
sample: null,
|
|
@@ -1761,7 +1761,7 @@ function foldContextEvidence(state, event) {
|
|
|
1761
1761
|
if (!copilot(state.route)) return state;
|
|
1762
1762
|
if (event.type === "assistant/message" && event.data.source !== void 0) {
|
|
1763
1763
|
const source = event.data.source;
|
|
1764
|
-
const parsed = routeSchema.safeParse(record$
|
|
1764
|
+
const parsed = routeSchema.safeParse(record$5(source) ? {
|
|
1765
1765
|
provider: source.provider,
|
|
1766
1766
|
model: source.model
|
|
1767
1767
|
} : source);
|
|
@@ -1777,7 +1777,7 @@ function foldContextEvidence(state, event) {
|
|
|
1777
1777
|
const settledUsage = usage !== void 0;
|
|
1778
1778
|
let terminal;
|
|
1779
1779
|
for (const entry of stream) {
|
|
1780
|
-
if (!record$
|
|
1780
|
+
if (!record$5(entry) || entry.type !== "chunk" || !record$5(entry.chunk)) continue;
|
|
1781
1781
|
if (!settledUsage && entry.chunk.type === "usage") usage = entry.chunk.usage;
|
|
1782
1782
|
if (entry.chunk.type === "finish") terminal = entry.chunk.reason;
|
|
1783
1783
|
}
|
|
@@ -1791,7 +1791,7 @@ function foldContextEvidence(state, event) {
|
|
|
1791
1791
|
};
|
|
1792
1792
|
const value = parsed.data;
|
|
1793
1793
|
const zero = isZeroContextUsage(value);
|
|
1794
|
-
const successful = record$
|
|
1794
|
+
const successful = record$5(terminal) && (terminal.kind === "stop" || terminal.kind === "max-tokens" || terminal.kind === "tool-calls");
|
|
1795
1795
|
if (zero && !successful) {
|
|
1796
1796
|
const reason = state.sample !== null || state.reason === "none" ? "failed-zero" : state.reason;
|
|
1797
1797
|
return {
|
|
@@ -1833,7 +1833,7 @@ const contextEvidenceDefinition = {
|
|
|
1833
1833
|
function installContextEvidence(ctx) {
|
|
1834
1834
|
ctx.inject(["sessionProjections"], (scope) => {
|
|
1835
1835
|
const registry = scope.get("sessionProjections");
|
|
1836
|
-
if (!record$
|
|
1836
|
+
if (!record$5(registry) || typeof registry.register !== "function") {
|
|
1837
1837
|
scope.logger.warn("[github-copilot] COPILOT_CONTEXT_PROJECTION_UNAVAILABLE");
|
|
1838
1838
|
return;
|
|
1839
1839
|
}
|
|
@@ -1847,7 +1847,7 @@ function installContextEvidence(ctx) {
|
|
|
1847
1847
|
//#endregion
|
|
1848
1848
|
//#region package.json
|
|
1849
1849
|
var name$1 = "dsh-github-copilot";
|
|
1850
|
-
var version = "0.4.0-alpha.
|
|
1850
|
+
var version = "0.4.0-alpha.75";
|
|
1851
1851
|
//#endregion
|
|
1852
1852
|
//#region lib/types/probe.js
|
|
1853
1853
|
/**
|
|
@@ -2856,7 +2856,7 @@ function buildAnthropicWireBody(request, cfg, model) {
|
|
|
2856
2856
|
}
|
|
2857
2857
|
//#endregion
|
|
2858
2858
|
//#region lib/types/responses-reasoning-text.js
|
|
2859
|
-
function record$
|
|
2859
|
+
function record$4(value) {
|
|
2860
2860
|
return typeof value === "object" && value !== null;
|
|
2861
2861
|
}
|
|
2862
2862
|
function responseIndex(value) {
|
|
@@ -2914,13 +2914,13 @@ var ResponsesReasoningText = class {
|
|
|
2914
2914
|
}
|
|
2915
2915
|
/** Only recognized public text fields are examined; no copying of the item. */
|
|
2916
2916
|
snapshot(item) {
|
|
2917
|
-
if (!record$
|
|
2917
|
+
if (!record$4(item) || item.type !== "reasoning") return "";
|
|
2918
2918
|
let delta = "";
|
|
2919
2919
|
for (const family of ["summary", "raw"]) {
|
|
2920
2920
|
const value = family === "summary" ? item.summary : item.content;
|
|
2921
2921
|
if (!Array.isArray(value)) continue;
|
|
2922
2922
|
for (const [index, part] of value.entries()) {
|
|
2923
|
-
if (!record$
|
|
2923
|
+
if (!record$4(part) || part.type !== (family === "summary" ? "summary_text" : "reasoning_text")) continue;
|
|
2924
2924
|
delta += this.update(family, index, part.text, true);
|
|
2925
2925
|
}
|
|
2926
2926
|
}
|
|
@@ -5300,6 +5300,56 @@ function coreProviderView(provider) {
|
|
|
5300
5300
|
};
|
|
5301
5301
|
}
|
|
5302
5302
|
//#endregion
|
|
5303
|
+
//#region lib/types/response-error-body.js
|
|
5304
|
+
const maxErrorBytes = 8192;
|
|
5305
|
+
const errorReadTimeoutMs = 250;
|
|
5306
|
+
async function readError(reader) {
|
|
5307
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
5308
|
+
let bytes = 0, chunks = 0, text = "";
|
|
5309
|
+
while (true) {
|
|
5310
|
+
if (chunks++ > maxErrorBytes) return void 0;
|
|
5311
|
+
const chunk = await reader.read();
|
|
5312
|
+
if (chunk.done) break;
|
|
5313
|
+
bytes += chunk.value.byteLength;
|
|
5314
|
+
if (bytes > maxErrorBytes) return void 0;
|
|
5315
|
+
text += decoder.decode(chunk.value, { stream: true });
|
|
5316
|
+
}
|
|
5317
|
+
return JSON.parse(text + decoder.decode());
|
|
5318
|
+
}
|
|
5319
|
+
/** Optional classification evidence only; an unreadable clone leaves native handling unchanged. */
|
|
5320
|
+
async function readResponseErrorJson(response, signal) {
|
|
5321
|
+
if (signal?.aborted) return void 0;
|
|
5322
|
+
let reader;
|
|
5323
|
+
let timeout;
|
|
5324
|
+
let onAbort;
|
|
5325
|
+
try {
|
|
5326
|
+
const clone = response.clone();
|
|
5327
|
+
if (!clone.body) return void 0;
|
|
5328
|
+
reader = clone.body.getReader();
|
|
5329
|
+
const interrupted = new Promise((resolve) => {
|
|
5330
|
+
onAbort = () => resolve(void 0);
|
|
5331
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
5332
|
+
timeout = setTimeout(() => resolve(void 0), errorReadTimeoutMs);
|
|
5333
|
+
if (signal?.aborted) resolve(void 0);
|
|
5334
|
+
});
|
|
5335
|
+
const result = await Promise.race([readError(reader), interrupted]);
|
|
5336
|
+
return signal?.aborted ? void 0 : result;
|
|
5337
|
+
} catch {
|
|
5338
|
+
return;
|
|
5339
|
+
} finally {
|
|
5340
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
5341
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
5342
|
+
if (reader) {
|
|
5343
|
+
try {
|
|
5344
|
+
reader.cancel().catch(() => {});
|
|
5345
|
+
} catch {}
|
|
5346
|
+
try {
|
|
5347
|
+
reader.releaseLock();
|
|
5348
|
+
} catch {}
|
|
5349
|
+
}
|
|
5350
|
+
}
|
|
5351
|
+
}
|
|
5352
|
+
//#endregion
|
|
5303
5353
|
//#region lib/types/responses-replay-compat.js
|
|
5304
5354
|
const replayDiagnostics = {
|
|
5305
5355
|
"scope-mismatch": "COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH: Copilot Responses input references belong to a different connection.",
|
|
@@ -5472,23 +5522,7 @@ var ResponsesRetryReplay = class {
|
|
|
5472
5522
|
}
|
|
5473
5523
|
};
|
|
5474
5524
|
const scopeMessages = /* @__PURE__ */ new Set(["input item ID does not belong to this connection", "input item does not belong to this connection"]);
|
|
5475
|
-
|
|
5476
|
-
const errorReadTimeoutMs = 250;
|
|
5477
|
-
async function readScopeError(reader) {
|
|
5478
|
-
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
5479
|
-
let bytes = 0;
|
|
5480
|
-
let chunks = 0;
|
|
5481
|
-
let text = "";
|
|
5482
|
-
while (true) {
|
|
5483
|
-
if (chunks++ > maxErrorBytes) return false;
|
|
5484
|
-
const chunk = await reader.read();
|
|
5485
|
-
if (chunk.done) break;
|
|
5486
|
-
bytes += chunk.value.byteLength;
|
|
5487
|
-
if (bytes > maxErrorBytes) return false;
|
|
5488
|
-
text += decoder.decode(chunk.value, { stream: true });
|
|
5489
|
-
}
|
|
5490
|
-
text += decoder.decode();
|
|
5491
|
-
const body = JSON.parse(text);
|
|
5525
|
+
function isScopeError(body) {
|
|
5492
5526
|
if (!isRecord$1(body)) return false;
|
|
5493
5527
|
const error = Object.hasOwn(body, "error") ? body.error : body;
|
|
5494
5528
|
if (!isRecord$1(error) || typeof error.message !== "string" || !scopeMessages.has(error.message)) return false;
|
|
@@ -5502,35 +5536,23 @@ async function readScopeError(reader) {
|
|
|
5502
5536
|
/** Observe a cloned, bounded 401 body; every unknown result retains native auth behavior. */
|
|
5503
5537
|
async function isCopilotInputItemScopeError(response, signal) {
|
|
5504
5538
|
if (response.status !== 401 || signal?.aborted) return false;
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
} finally {
|
|
5523
|
-
if (timeout !== void 0) clearTimeout(timeout);
|
|
5524
|
-
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
5525
|
-
if (reader) {
|
|
5526
|
-
try {
|
|
5527
|
-
reader.cancel().catch(() => {});
|
|
5528
|
-
} catch {}
|
|
5529
|
-
try {
|
|
5530
|
-
reader.releaseLock();
|
|
5531
|
-
} catch {}
|
|
5532
|
-
}
|
|
5533
|
-
}
|
|
5539
|
+
const body = await readResponseErrorJson(response, signal);
|
|
5540
|
+
return !signal?.aborted && isScopeError(body);
|
|
5541
|
+
}
|
|
5542
|
+
//#endregion
|
|
5543
|
+
//#region lib/types/request-body-timeout.js
|
|
5544
|
+
const observedMessage = "Timed out reading request body. Try again, or use a smaller request size.";
|
|
5545
|
+
function record$3(value) {
|
|
5546
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5547
|
+
}
|
|
5548
|
+
/** Verified provider evidence, not guessed capabilities, token limits or network cause. */
|
|
5549
|
+
async function requestBodyTimeoutDiagnostic(response, body, signal) {
|
|
5550
|
+
if (response.status !== 408 || signal?.aborted) return void 0;
|
|
5551
|
+
const value = await readResponseErrorJson(response, signal);
|
|
5552
|
+
if (!record$3(value)) return void 0;
|
|
5553
|
+
const error = Object.hasOwn(value, "error") ? value.error : value;
|
|
5554
|
+
if (!record$3(error) || error.code !== "user_request_timeout" || error.message !== observedMessage || value.code !== void 0 && value.code !== error.code || value.message !== void 0 && value.message !== error.message) return void 0;
|
|
5555
|
+
return `COPILOT_REQUEST_BODY_TIMEOUT: Copilot returned HTTP 408 / user_request_timeout while reading the request body; this is not context-window overflow. ${body === void 0 ? "Request body size unavailable." : `Request body: ${Buffer.byteLength(body, "utf8")} UTF-8 bytes (not context tokens).`} Native retry policy is unchanged. If retries exhaust, explicitly compact the conversation or reduce attachments/tool output before retrying; also check network/proxy health and GitHub service status. A larger client timeout does not change this server timeout. No history was trimmed or model switched.`;
|
|
5534
5556
|
}
|
|
5535
5557
|
//#endregion
|
|
5536
5558
|
//#region lib/types/preview-provider.js
|
|
@@ -5748,6 +5770,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5748
5770
|
} : options.onPayload;
|
|
5749
5771
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
5750
5772
|
const observeResponse = async (input, init) => {
|
|
5773
|
+
guard.onRequestBodyTimeout?.(void 0);
|
|
5751
5774
|
let response;
|
|
5752
5775
|
try {
|
|
5753
5776
|
response = await fetch(input, init);
|
|
@@ -5756,6 +5779,10 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5756
5779
|
throw error;
|
|
5757
5780
|
}
|
|
5758
5781
|
retry?.observe(typeof init?.body === "string" ? init.body : void 0, response.status);
|
|
5782
|
+
if (response.status === 408 && guard.onRequestBodyTimeout !== void 0) {
|
|
5783
|
+
const diagnostic = await requestBodyTimeoutDiagnostic(response, typeof init?.body === "string" ? init.body : void 0, lease.signal);
|
|
5784
|
+
if (!lease.signal.aborted && !options.signal?.aborted) guard.onRequestBodyTimeout(diagnostic);
|
|
5785
|
+
}
|
|
5759
5786
|
if (response.status === 401) {
|
|
5760
5787
|
if (responses && await isCopilotInputItemScopeError(response, lease.signal)) reportReplayFailure(new CopilotResponsesReplayError("scope-mismatch"));
|
|
5761
5788
|
else unauthorized = true;
|
|
@@ -7704,6 +7731,7 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7704
7731
|
}
|
|
7705
7732
|
let requestFailure;
|
|
7706
7733
|
let wireAbort;
|
|
7734
|
+
let bodyTimeout;
|
|
7707
7735
|
const inspectRequest = (_model, context, nativeOptions) => {
|
|
7708
7736
|
if (signal.aborted) throw abortFailure(signal);
|
|
7709
7737
|
const imageFailure = imageInputFailure(lease.descriptor, context.messages);
|
|
@@ -7730,6 +7758,9 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7730
7758
|
onWireAbort(code) {
|
|
7731
7759
|
wireAbort = code;
|
|
7732
7760
|
},
|
|
7761
|
+
onRequestBodyTimeout(diagnostic) {
|
|
7762
|
+
bodyTimeout = diagnostic;
|
|
7763
|
+
},
|
|
7733
7764
|
onReplayFailure(error) {
|
|
7734
7765
|
if (!signal.aborted) requestFailure = new LlmError(error.message, "INVALID_REQUEST");
|
|
7735
7766
|
}
|
|
@@ -7752,6 +7783,20 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7752
7783
|
throw failure(wireAbort, "ABORTED");
|
|
7753
7784
|
}
|
|
7754
7785
|
if (chunk.type === "finish" && chunk.reason.kind === "error" && chunk.reason.failure.code === "UNKNOWN_MODEL") await owner.refreshRejected(lease.snapshot, signal);
|
|
7786
|
+
if (chunk.type === "finish" && chunk.reason.kind === "error" && bodyTimeout !== void 0 && chunk.reason.failure.code !== "ABORTED") {
|
|
7787
|
+
if (signal.aborted) throw abortFailure(signal);
|
|
7788
|
+
yield {
|
|
7789
|
+
...chunk,
|
|
7790
|
+
reason: {
|
|
7791
|
+
...chunk.reason,
|
|
7792
|
+
failure: {
|
|
7793
|
+
...chunk.reason.failure,
|
|
7794
|
+
message: bodyTimeout
|
|
7795
|
+
}
|
|
7796
|
+
}
|
|
7797
|
+
};
|
|
7798
|
+
continue;
|
|
7799
|
+
}
|
|
7755
7800
|
yield chunk;
|
|
7756
7801
|
}
|
|
7757
7802
|
if (requestFailure !== void 0) throw requestFailure;
|
|
@@ -25,6 +25,8 @@ export interface PreviewProviderGuard {
|
|
|
25
25
|
onReplayFailure?(error: CopilotResponsesReplayError): void;
|
|
26
26
|
/** Preserve an owned abort cause before SDK terminal delivery and lease cleanup. */
|
|
27
27
|
onWireAbort?(code: ManagedWireAbortCode): void;
|
|
28
|
+
/** Request-local safe guidance from a verified HTTP response; undefined clears prior evidence. */
|
|
29
|
+
onRequestBodyTimeout?(diagnostic: string | undefined): void;
|
|
28
30
|
}
|
|
29
31
|
/** Guard for one selected model in an account-bound descriptor snapshot. */
|
|
30
32
|
export interface AccountProviderGuard extends PreviewProviderGuard {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Verified provider evidence, not guessed capabilities, token limits or network cause. */
|
|
2
|
+
export declare function requestBodyTimeoutDiagnostic(response: Response, body?: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
3
|
+
//# sourceMappingURL=request-body-timeout.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-github-copilot",
|
|
3
3
|
"description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
|
|
4
|
-
"version": "0.4.0-alpha.
|
|
4
|
+
"version": "0.4.0-alpha.75",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|