dsh-github-copilot 0.4.0-alpha.39 → 0.4.0-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +12 -8
- package/README.zh.md +12 -8
- package/deployment-baseline.json +24 -2
- package/docs/automatic-model-routing.md +151 -0
- package/lib/client.js +206 -33
- package/lib/client.js.map +1 -1
- package/lib/index.js +313 -59
- package/lib/routed-web.js +1 -1
- package/lib/{search-routing-C1o895V6.js → search-routing-D5tmOCvH.js} +2 -1
- package/lib/types/auto-model-host.d.ts +8 -0
- package/lib/types/auto-model-presentation.d.ts +45 -0
- package/lib/types/auto-model-routing.d.ts +26 -0
- package/lib/types/copilot-identity.d.ts +1 -0
- package/output/auto-model-mockup/index.html +207 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.42 (prepared)
|
|
4
|
+
|
|
5
|
+
- Add a plugin-owned virtual **Auto** model to the managed GitHub Copilot route, resolving once per Core turn to a real account model while preserving explicit selections and truthful request provenance (#174).
|
|
6
|
+
- Filter image turns by account-verified image capability, keep search independently owned, and preserve native subagent concrete-route inheritance.
|
|
7
|
+
- Reuse the existing local request-pressure signal and Core transactional compaction so a smaller-context Auto choice can recover with the same real model and no oversized wire request.
|
|
8
|
+
- Record credential-free Auto decisions for a public turn-tail `Auto · actual model` disclosure with an inline explanation, and correct virtual-Auto model-switch guidance before it reaches the model.
|
|
9
|
+
- Document the plugin-only MVP and interactive multi-provider mockup. The deterministic capacity heuristic does not claim model quality, latency, price, health, or parity with GitHub's private Auto router.
|
|
10
|
+
|
|
11
|
+
## 0.4.0-alpha.40 (prepared)
|
|
12
|
+
|
|
13
|
+
- Sanitize authorization failures into allowlisted begin-stage and post-auth route-repair diagnostics in the existing Remote error field; unknown or legacy arbitrary errors remain generic.
|
|
14
|
+
- Stop retaining or logging raw authorization errors, including message, URL, response body, token, device code, and nested cause content; render safe stage-specific next steps.
|
|
15
|
+
- Add regressions for cancellation, successful authorization, route-repair failure, nested causes, secret-bearing errors, arbitrary thrown values, and backward-compatible generic Client behavior (#172).
|
|
16
|
+
- Diagnostics identify only where the flow failed; they do not explain or resolve the underlying OAuth failure.
|
|
17
|
+
|
|
3
18
|
## 0.4.0-alpha.39 (prepared)
|
|
4
19
|
|
|
5
20
|
- Qualify the exact official DSH and signed Windows Desktop `0.2.0-rc.2` peer graph; retain rc.1 as historical evidence.
|
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
|
|
|
85
85
|
|
|
86
86
|
## Install and sign in
|
|
87
87
|
|
|
88
|
-
The commands below target the package version `0.4.0-alpha.
|
|
88
|
+
The commands below target the package version `0.4.0-alpha.42`. 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):
|
|
89
89
|
|
|
90
90
|
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):
|
|
91
91
|
|
|
@@ -98,10 +98,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
|
|
|
98
98
|
For a standalone named profile only, the supported CLI command is:
|
|
99
99
|
|
|
100
100
|
```sh
|
|
101
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
101
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.42/dsh-github-copilot-0.4.0-alpha.42.tgz
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.
|
|
104
|
+
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.42` 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.
|
|
105
105
|
|
|
106
106
|
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.
|
|
107
107
|
|
|
@@ -110,9 +110,13 @@ Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in*
|
|
|
110
110
|
1. Open **Settings → Models** and find **GitHub Copilot**. Account controls appear in an existing configured canonical `github-copilot` card, suppressing the separate footer controller; otherwise the footer fallback (or old-Core **Settings → GitHub Copilot**) remains usable. An already-signed-in account automatically ensures missing/idle/stale/error/loading metadata once on opening; fresh ready metadata makes no discovery request. No native provider or manual refresh is needed for the normal discovery flow.
|
|
111
111
|
2. Select **Sign in with GitHub**. The authorization area expands automatically with a prominent one-time code, **Open GitHub verification page**, **Copy code**, and **Cancel sign-in**. No extra **Manage** click is needed. Recognized Desktop v1 hosts use their existing same-window external-navigation handoff to the system browser instead of a popup; web hosts retain a new tab. If nothing opens, select and copy the displayed verification address into your browser. The plugin cannot confirm that the system browser opened.
|
|
112
112
|
3. Copy the code, open the verification link, and complete authorization in your own GitHub browser session. Copy success/failure is announced accessibly; manual copying remains available. Never paste a GitHub token into DSH.
|
|
113
|
-
4. DSH polls only while authorization is in flight. Successful explicit **Start sign-in** (the **Sign in with GitHub** button), including a UI account switch, forces exactly one bounded discovery after immediate or polled success. The code and verification link clear, the automatic authorization area closes, and the account shows **Signed in** and **Manage**. Manually opened details stay open; cancellation clears the old code and
|
|
113
|
+
4. DSH polls only while authorization is in flight. Successful explicit **Start sign-in** (the **Sign in with GitHub** button), including a UI account switch, forces exactly one bounded discovery after immediate or polled success. The code and verification link clear, the automatic authorization area closes, and the account shows **Signed in** and **Manage**. Manually opened details stay open; cancellation clears the old code. Failures show only a safe stage diagnostic: `COPILOT_AUTHORIZATION_BEGIN_FAILED` means authorization did not complete; `COPILOT_ROUTE_REPAIR_FAILED` means authorization completed but local route repair failed. The latter retains authentication and directs you to **Manage → Repair model configuration**. These codes do not explain or resolve the underlying sign-in failure; raw provider details are never displayed or logged.
|
|
114
114
|
5. Choose an accepted model under **GitHub Copilot** (stable route ID `github-copilot-preview`). Normal opening/use maintains metadata without requiring **Refresh models**. **Manage** contains the optional manual refresh, model details and sign-out. The compatibility disclosure is removed; legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation. Errors remain visible with **Retry**, including when details are collapsed; neither discovery nor retry changes your current/default model or replays messages.
|
|
115
115
|
|
|
116
|
+
### Auto model routing
|
|
117
|
+
|
|
118
|
+
The managed GitHub Copilot group includes a virtual **Auto** model. Auto resolves once per Core turn to a real model from the current authenticated account catalog; every tool step, retry and automatic compaction recovery in that turn stays on that real model, while a later Chat or Goal turn may choose again. Image turns require an account-verified image-capable candidate. The completed turn tail shows `Auto · <actual model>` with a compact `?` explanation. Search keeps its independent provider-owned model policy, and general native subagents continue to inherit Core's concrete route rather than being relabeled as Auto. The deterministic MVP uses advertised capacity only and makes no model-quality, latency, price, health or GitHub-private-router claim. See the [MVP contract and mockup](./docs/automatic-model-routing.md).
|
|
119
|
+
|
|
116
120
|
One shared account-state owner survives transfer while another eligible surface remains mounted. Last-surface unmount or nonoverlapping declaration replacement stops polling; a later mount reads status and separately ensures metadata if needed. Status reads and details toggles themselves remain network-free, but opening Models can discover missing/stale signed-in metadata. Background credential/reset notifications clear Client state and read status rather than forcing discovery on every token event; the next open/use ensures metadata.
|
|
117
121
|
|
|
118
122
|
Concurrent status retries join the compact account's pending read. An obsolete read must settle before that controller reads for a new lifetime; Remote has no cancellation contract, so a permanently hung read still needs connection recovery. Authorization polling backs off from 500 ms to 1 s and then 2 s (32 reads in the first minute with immediate replies). Status errors stop polling and expose an explicit retry; sign-in, cancellation and other mutations are never automatically replayed. Credential invalidation and the bounded initial metadata check retain their existing behavior. These are plugin request-pressure safeguards, not a fix for incompatible Agent presets or Core-wide request scheduling.
|
|
@@ -163,7 +167,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
|
|
|
163
167
|
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.
|
|
164
168
|
6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
|
|
165
169
|
|
|
166
|
-
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.
|
|
170
|
+
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.42`, 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).
|
|
167
171
|
|
|
168
172
|
No `copilot2api` process, external gateway, placeholder API key, pasted GitHub token, or separate `dsh-web-search-provider` installation is required.
|
|
169
173
|
|
|
@@ -427,8 +431,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
|
|
|
427
431
|
`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.
|
|
428
432
|
|
|
429
433
|
```sh
|
|
430
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
431
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
434
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.42/dsh-github-copilot-0.4.0-alpha.42.tgz
|
|
435
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.42/SHA256SUMS
|
|
432
436
|
sha256sum --check SHA256SUMS
|
|
433
437
|
```
|
|
434
438
|
|
|
@@ -436,7 +440,7 @@ PowerShell can verify the same two downloaded files with:
|
|
|
436
440
|
|
|
437
441
|
```powershell
|
|
438
442
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
439
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
443
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.42.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
440
444
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
441
445
|
```
|
|
442
446
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
一个聚焦 GitHub Copilot 登录、通用账号模型发现、Copilot 专用 Tool 兼容与供应方托管搜索的 DSH companion。插件根据供应方返回的端点和能力元数据组装模型,复用公开的 `@deepseek-ai/dsh-llm-pi-ai` adapter 与 pi-ai SDK,不另写一套通用传输/序列化器,也不维护需要逐个添加新模型 ID 的静态目录。
|
|
11
11
|
|
|
12
|
-
> 下文自动维护账号模型元数据与 provider 集成控件描述目标版本 `0.4.0-alpha.
|
|
12
|
+
> 下文自动维护账号模型元数据与 provider 集成控件描述目标版本 `0.4.0-alpha.42`;这不代表已有的两条真实路由被合并或移除。版本化 URL 不表示 Release 已发布或本机已加载;仅在该 Release 与校验和可用后使用安装命令。源码、发布制品、已安装版本和实际加载运行时需分别确认,本地升级和中断会话的重启仍需用户批准。
|
|
13
13
|
|
|
14
14
|
Alpha.24 修复 Web search 卡片缺少精确 Remote 依赖声明的问题。卡片仍位于 **Settings → Models**(`settings.models.footer`,list/root),旧 Core 回退到独立 Web search section,而非 General。搜索子 Fiber 独立等待 routing namespace,不影响账号控件和既有搜索安全检查;实际打包 Desktop 验收仍是独立关卡。
|
|
15
15
|
|
|
@@ -100,10 +100,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
100
100
|
仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
103
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.42/dsh-github-copilot-0.4.0-alpha.42.tgz
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.
|
|
106
|
+
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.42`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
|
|
107
107
|
|
|
108
108
|
随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
|
|
109
109
|
|
|
@@ -112,9 +112,13 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
|
|
|
112
112
|
1. 打开 **设置 → 模型**,找到 **GitHub Copilot**。账号控件嵌入已有配置的 canonical `github-copilot` 卡片,不另显示页脚控制器;没有此类卡片时仍可用页脚 fallback(旧 Core 使用 **Settings → GitHub Copilot**)。已登录时,页面打开会自动确保缺失/idle/过期/error/loading的模型元数据就绪;新鲜 ready 缓存不发发现请求。正常流程无需添加原生 provider 或手动刷新。
|
|
113
113
|
2. 点击 **Sign in with GitHub** 后,验证码区域自动展开,提供醒目的一次性验证码、**Open GitHub verification page**、**Copy code** 和 **Cancel sign-in**。不需要再点一次 **Manage**。识别到 Desktop v1 宿主时,通过现有的同窗口外部导航处理交给系统浏览器,不依赖弹出窗口;网页版仍打开新标签页。如果没有打开,可选中并复制界面显示的验证网址到浏览器。插件无法确认系统浏览器是否已打开。
|
|
114
114
|
3. 复制验证码,打开验证链接,在自己的 GitHub 浏览器会话中完成授权。复制成功/失败均有可访问的反馈;手工复制仍可用。不要把 GitHub token 粘贴到 DSH。
|
|
115
|
-
4. DSH 只在授权进行中轮询。显式 **Start sign-in**(**Sign in with GitHub** 按钮,包括界面切换账号)成功后,无论立即返回还是轮询观察到成功,都只强制执行一次有界发现。验证码和验证链接清除,自动授权区域收起,账号显示 **Signed in、Manage
|
|
115
|
+
4. DSH 只在授权进行中轮询。显式 **Start sign-in**(**Sign in with GitHub** 按钮,包括界面切换账号)成功后,无论立即返回还是轮询观察到成功,都只强制执行一次有界发现。验证码和验证链接清除,自动授权区域收起,账号显示 **Signed in、Manage**。手动打开的详情保持展开;取消清除旧验证码。失败仅显示安全的阶段诊断:`COPILOT_AUTHORIZATION_BEGIN_FAILED` 表示授权流程未完成;`COPILOT_ROUTE_REPAIR_FAILED` 表示授权已完成但本地路由修复失败。后者会保留认证,并提示前往 **Manage → Repair model configuration**。这些代码不解释或解决底层登录失败,原始 provider 详情不会显示或记录。
|
|
116
116
|
5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage** 内保留可选的手动刷新、模型明细与退出登录,移除兼容说明折叠区;需要时仍显示旧配置诊断和显式修复操作,[迁移指南](./docs/single-route-migration.md)继续保留在文档中。错误即使在详情折叠时也会显示并提供 **Retry**;发现或重试均不切换当前/默认模型,也不重放消息。
|
|
117
117
|
|
|
118
|
+
### Auto 模型路由
|
|
119
|
+
|
|
120
|
+
托管 GitHub Copilot 分组包含一个虚拟 **Auto** 模型。Auto 在每个 Core turn 只解析一次,从当前认证账号目录选择一个真实模型;同轮的工具步骤、重试和自动 compact 恢复始终使用该真实模型,后续 Chat 或 Goal 新轮次可以重新选择。图片轮次必须有账号元数据验证过的图片模型。完成回复的末尾显示 `Auto · <真实模型>`,同一行 `?` 提供简短原因。搜索继续使用独立的 Provider 内部模型策略;通用原生子代理仍继承 Core 的具体路由,不被重新标成 Auto。首版确定性策略只使用供应方公布的容量,不声称知道模型质量、延迟、价格、健康状态或 GitHub 私有 Auto 算法。详见 [MVP 合同与 mockup](./docs/automatic-model-routing.md)。
|
|
121
|
+
|
|
118
122
|
只有另一个符合条件的表面仍挂载时,切换才保留共享账号状态 owner。最后一个表面卸载或声明替换没有挂载重叠时停止轮询;以后挂载会先读状态,再按需另行确保元数据。状态读取和详情切换本身仍不访问网络,但打开 Models 可以发现缺失/过期的已登录账号元数据。后台凭据/reset 通知清除 Client 状态并只读查询,不在每次 token 事件强制发现;下次打开/使用时再确保元数据。
|
|
119
123
|
|
|
120
124
|
并发的状态重试共用紧凑账号控件尚未完成的读取。旧读取结束后,该控制器才为新的挂载生命周期读取;Remote 没有取消协议,因此永久挂起仍需恢复连接。授权轮询从 500 毫秒退避至 1 秒、再到 2 秒(响应立即返回时首分钟 32 次读取)。状态错误停止轮询并提供显式重试;登录、取消等写操作绝不自动重放。凭据失效通知和有界的首次元数据检查保留原有行为。这些措施只降低插件请求压力,不修复不兼容的 Agent preset 或 Core 全局请求调度。
|
|
@@ -165,7 +169,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
|
|
|
165
169
|
5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
|
|
166
170
|
6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
|
|
167
171
|
|
|
168
|
-
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.
|
|
172
|
+
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.42`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
|
|
169
173
|
|
|
170
174
|
不需要运行 `copilot2api`,不需要外部 gateway、placeholder API key、原始 GitHub token 或单独安装 `dsh-web-search-provider`。
|
|
171
175
|
|
|
@@ -438,8 +442,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
|
|
|
438
442
|
`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 要求包已存在,不能代替首次建包。不会批量补发历史版本。
|
|
439
443
|
|
|
440
444
|
```sh
|
|
441
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
442
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
445
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.42/dsh-github-copilot-0.4.0-alpha.42.tgz
|
|
446
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.42/SHA256SUMS
|
|
443
447
|
sha256sum --check SHA256SUMS
|
|
444
448
|
```
|
|
445
449
|
|
|
@@ -447,7 +451,7 @@ PowerShell 可以对已下载的同一组文件执行:
|
|
|
447
451
|
|
|
448
452
|
```powershell
|
|
449
453
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
450
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
454
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.42.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
451
455
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
452
456
|
```
|
|
453
457
|
|
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.42"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -88,6 +88,9 @@
|
|
|
88
88
|
"evidenceScope": "unchanged-tagged-source-target",
|
|
89
89
|
"standaloneNpmArtifacts": "not-tested",
|
|
90
90
|
"managedProviderValidation": "synthetic-tagged-source-runtime",
|
|
91
|
+
"autoModelRouting": "plugin-owned-virtual-selection-with-real-request-header",
|
|
92
|
+
"autoModelCompaction": "same-real-model-core-overflow-recovery",
|
|
93
|
+
"autoModelPresentation": "public-turn-tail-durable-decision",
|
|
91
94
|
"resolvedProfileDiagnostics": "plugin-owned-empty-modelErrors",
|
|
92
95
|
"runtimeTests": ["tests/preview-route.spec.ts", "tests/published-core.spec.ts", "tests/single-route.spec.ts", "tests/fixtures/session-context-core.fixture.ts", "tests/fixtures/remote-core.fixture.ts"]
|
|
93
96
|
},
|
|
@@ -705,7 +708,7 @@
|
|
|
705
708
|
{"file": "tests/client.spec.ts", "name": "mounts its Remote contribution and registers the rc.1 provider-card seat"},
|
|
706
709
|
{"file": "tests/authorization-controller.spec.ts", "name": "signs in through the built-in flow without recreating a canonical profile"},
|
|
707
710
|
{"file": "tests/authorization-controller.spec.ts", "name": "clears the one-time device code immediately when sign-in is cancelled"},
|
|
708
|
-
{"file": "tests/authorization-controller.spec.ts", "name": "
|
|
711
|
+
{"file": "tests/authorization-controller.spec.ts", "name": "reports only the safe begin-stage diagnostic and never logs rejected values"}
|
|
709
712
|
]
|
|
710
713
|
},
|
|
711
714
|
{
|
|
@@ -970,6 +973,25 @@
|
|
|
970
973
|
{"file": "tests/client-no-model-roles.spec.ts", "name": "does not resurrect a role entry when a retained legacy Remote arrives later"}
|
|
971
974
|
]
|
|
972
975
|
},
|
|
976
|
+
{
|
|
977
|
+
"id": "managed-copilot-auto-model-routing",
|
|
978
|
+
"required": true,
|
|
979
|
+
"sourceMarkers": [
|
|
980
|
+
{"file": "src/preview-route.ts", "marker": "GITHUB_COPILOT_AUTO_MODEL_ID"},
|
|
981
|
+
{"file": "src/auto-model-host.ts", "marker": "github-copilot/auto-model-decision"},
|
|
982
|
+
{"file": "src/auto-model-presentation.ts", "marker": "conversation.chat.turnTail"},
|
|
983
|
+
{"file": "docs/automatic-model-routing.md", "marker": "plugin-only"}
|
|
984
|
+
],
|
|
985
|
+
"tests": [
|
|
986
|
+
{"file": "tests/auto-model-routing.spec.ts", "name": "classifies only the latest user turn and selects a deterministic capacity tier"},
|
|
987
|
+
{"file": "tests/auto-model-routing.spec.ts", "name": "requires account-verified image capability for image turns"},
|
|
988
|
+
{"file": "tests/auto-model-host.spec.ts", "name": "resolves after downstream model selection and freezes one decision per turn"},
|
|
989
|
+
{"file": "tests/auto-model-host.spec.ts", "name": "replaces Core virtual-Auto switch guidance with the resolved real route"},
|
|
990
|
+
{"file": "tests/auto-model-presentation.spec.ts", "name": "folds a durable decision into turn-scoped credential-free attribution"},
|
|
991
|
+
{"file": "tests/preview-route.spec.ts", "name": "publishes Auto as a virtual picker entry but refuses unresolved adapter dispatch"},
|
|
992
|
+
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "shrinks durable history and rebuilds the switched model request without sending the oversized original"}
|
|
993
|
+
]
|
|
994
|
+
},
|
|
973
995
|
{
|
|
974
996
|
"id": "single-managed-route-native-oauth",
|
|
975
997
|
"required": true,
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# GitHub Copilot Auto model routing MVP
|
|
2
|
+
|
|
3
|
+
**Tracking:** [#174](https://github.com/cloga/dsh-github-copilot/issues/174)
|
|
4
|
+
|
|
5
|
+
**Target:** official DSH and Windows Desktop `0.2.0-rc.2`
|
|
6
|
+
|
|
7
|
+
**Boundary:** plugin-only; no Core source, artifact, registry, prototype, or history patch
|
|
8
|
+
|
|
9
|
+
**Interactive mockup:** [`output/auto-model-mockup/index.html`](../output/auto-model-mockup/index.html)
|
|
10
|
+
|
|
11
|
+
## User contract
|
|
12
|
+
|
|
13
|
+
The managed `github-copilot-preview` provider contributes one virtual model named **Auto** to the ordinary model picker. Auto never appears under another provider and never routes across providers or accounts.
|
|
14
|
+
|
|
15
|
+
Selecting Auto uses normal Core selection behavior, including saving it as the future default selection. For every Core turn, the plugin resolves Auto to one real model from the authenticated account catalog:
|
|
16
|
+
|
|
17
|
+
- one decision is made for the turn;
|
|
18
|
+
- every model request, tool continuation, request-error retry, and compaction retry in that turn uses the same real model;
|
|
19
|
+
- a later user turn or Goal continuation is a new turn and may select a different model;
|
|
20
|
+
- an explicit real model selection always wins;
|
|
21
|
+
- the actual model remains the provider transport, usage, replay, and billing identity.
|
|
22
|
+
|
|
23
|
+
A Goal does not become one indefinitely frozen Auto decision. Each automatic continuation that Core opens as a new turn is classified independently. Tool steps inside that turn do not trigger another decision.
|
|
24
|
+
|
|
25
|
+
## MVP routing policy
|
|
26
|
+
|
|
27
|
+
The account `/models` catalog is authoritative for entitlement and hard capabilities: protocol, context and output limits, image input, tool support, reasoning efforts, and server policy. Unknown or incomplete capability metadata fails closed.
|
|
28
|
+
|
|
29
|
+
The catalog does not provide trustworthy quality, latency, price, or global-health rankings. The MVP therefore does **not** infer model quality from a marketing name, model-ID prefix, provider order, or token price. It does not claim to reproduce GitHub's private Auto algorithm.
|
|
30
|
+
|
|
31
|
+
The initial deterministic policy classifies only the latest user turn:
|
|
32
|
+
|
|
33
|
+
| Class | Structural signal | Selection |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| Fast | short text turn with little structured content | lowest eligible advertised capacity |
|
|
36
|
+
| Balanced | ordinary text turn or image turn | median eligible advertised capacity |
|
|
37
|
+
| Strong | large or highly structured text turn | highest eligible advertised capacity |
|
|
38
|
+
|
|
39
|
+
Capacity ordering is based on account-advertised reasoning range, context window, and output capacity, with model ID used only as a deterministic tie-breaker. Capacity is not presented as a quality, latency, or cost fact. The policy is intentionally replaceable by reviewed benchmark evidence later.
|
|
40
|
+
|
|
41
|
+
The MVP makes no additional model call to classify a turn. It does not retry another model after provider output begins, replay tool side effects, or implement wire-time fallback.
|
|
42
|
+
|
|
43
|
+
## Images
|
|
44
|
+
|
|
45
|
+
Image input is part of the MVP.
|
|
46
|
+
|
|
47
|
+
The virtual Auto picker entry advertises image input only when the current authenticated catalog contains at least one eligible image-capable model. At routing time, an image turn filters out every text-only candidate. If catalog changes leave no eligible image model, the turn fails with a named Auto routing error instead of sending the image to an unverified model.
|
|
48
|
+
|
|
49
|
+
This preserves two separate checks:
|
|
50
|
+
|
|
51
|
+
1. Core's normal picker/admission path sees truthful aggregate Auto modalities.
|
|
52
|
+
2. The resolved real model is independently verified against the current account snapshot before transport.
|
|
53
|
+
|
|
54
|
+
## Context pressure and automatic compaction
|
|
55
|
+
|
|
56
|
+
Auto may choose a model with a smaller context window than the previous turn. The plugin must not trim history, create a competing compaction service, or silently switch models during recovery.
|
|
57
|
+
|
|
58
|
+
The resolved real model enters the existing managed-route request-budget path. If the estimated committed request exceeds that model's input budget, [`src/compaction-pressure.ts`](../src/compaction-pressure.ts) emits the normal `CONTEXT_WINDOW_EXCEEDED` signal before transport. Core's stock transactional compaction then:
|
|
59
|
+
|
|
60
|
+
1. summarizes and replaces eligible history;
|
|
61
|
+
2. rebuilds the request;
|
|
62
|
+
3. retries the same turn with the same resolved real model;
|
|
63
|
+
4. keeps the ordinary bounded overflow retry policy.
|
|
64
|
+
|
|
65
|
+
The guarantee is limited to compressible history. A fixed prompt, current attachment, or indivisible content block that cannot fit after compaction remains an explicit error. See [Copilot compaction](./copilot-compaction.md).
|
|
66
|
+
|
|
67
|
+
## Search ownership
|
|
68
|
+
|
|
69
|
+
Chat Auto does not own or alter the independent `github-copilot-hosted` search provider.
|
|
70
|
+
|
|
71
|
+
- A nonempty explicit `searchModel` remains authoritative.
|
|
72
|
+
- Automatic hosted-search candidate selection continues to use its own bounded account-owned Responses policy and capability proof.
|
|
73
|
+
- Routed search that follows the initiating Chat request sees the durable real request header, not the virtual Auto ID.
|
|
74
|
+
- The final query is still sent once; Chat Auto introduces no search replay or fallback.
|
|
75
|
+
|
|
76
|
+
## Attribution and explanation
|
|
77
|
+
|
|
78
|
+
Core already places route and usage details at the end of a completed turn. The MVP follows that interaction pattern rather than adding provider/model tags above the answer.
|
|
79
|
+
|
|
80
|
+
For a completed Auto response, the proposed turn-tail display is:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
Auto · <actual model> ?
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The `?` opens a compact explanation using normalized facts such as:
|
|
87
|
+
|
|
88
|
+
- short text turn;
|
|
89
|
+
- standard turn;
|
|
90
|
+
- large structured turn;
|
|
91
|
+
- image capability required;
|
|
92
|
+
- number of eligible account models.
|
|
93
|
+
|
|
94
|
+
The plugin records a credential-free `github-copilot/auto-model-decision` Session event before Core persists the real request header. Historical attribution is derived from that durable decision plus assistant/request provenance, never from the current picker or a later catalog snapshot. Raw prompts, credentials, provider response bodies, and guessed prices are never disclosed.
|
|
95
|
+
|
|
96
|
+
## Subagents
|
|
97
|
+
|
|
98
|
+
General native subagent Auto inheritance is **not** in the base MVP.
|
|
99
|
+
|
|
100
|
+
Core currently creates a native child from the parent's effective real request configuration. Continuable descriptors retain the merged provider/model/effort but do not preserve enough public evidence to distinguish inherited Auto intent from an explicit child override that happens to equal the same real model. The plugin must not relabel that concrete child route as Auto or write a fabricated child selection.
|
|
101
|
+
|
|
102
|
+
The MVP therefore preserves native behavior:
|
|
103
|
+
|
|
104
|
+
- a child with an explicit model override uses that model;
|
|
105
|
+
- a child without an override inherits Core's resolved concrete route;
|
|
106
|
+
- the child UI shows the real model truthfully;
|
|
107
|
+
- no plugin code claims independent child Auto classification.
|
|
108
|
+
|
|
109
|
+
A later plugin-owned delegation entry may carry explicit Auto intent in its own public descriptor and let each child classify independently, but only after cold-resume and override precedence are proven without Core changes.
|
|
110
|
+
|
|
111
|
+
## Public API implementation
|
|
112
|
+
|
|
113
|
+
The plugin uses only published public seams:
|
|
114
|
+
|
|
115
|
+
- `PreviewAdapter.listModels()` publishes the virtual Auto picker entry alongside real account models.
|
|
116
|
+
- `PreviewAdapter.resolveModel()` returns aggregate Auto modalities for picker admission.
|
|
117
|
+
- `agent/pre-step` captures the admitted current-turn messages.
|
|
118
|
+
- a prepended `agent/request` listener awaits Core's model-selection middleware, recognizes only `github-copilot-preview/auto`, resolves one real account descriptor, and returns the real model before `request/header` persistence.
|
|
119
|
+
- the adapter refuses unresolved Auto in `prepareCall()` and `stream()` so a missing middleware path fails loudly.
|
|
120
|
+
- a per-Agent, per-turn decision cache keeps all later steps and request-error retries on the same model.
|
|
121
|
+
- existing descriptor leases, credential proof, account continuity, request budgets, native pi-ai transport, replay, and cancellation remain unchanged.
|
|
122
|
+
|
|
123
|
+
The virtual Auto selection can remain pending while the real request header records the actual model. This is intentional: an unrelated real header must not consume the durable Auto preference. A later explicit picker selection replaces the pending Auto choice through Core's normal projection.
|
|
124
|
+
|
|
125
|
+
## Acceptance criteria
|
|
126
|
+
|
|
127
|
+
The MVP is accepted only when unchanged official Core contract tests prove:
|
|
128
|
+
|
|
129
|
+
1. Auto appears only in the managed Copilot provider and explicit real/provider selections remain untouched.
|
|
130
|
+
2. Core's downstream model-selection result is visible to the prepended plugin listener, and the committed request header contains the resolved real model.
|
|
131
|
+
3. Auto intent remains durable while actual request provenance remains real.
|
|
132
|
+
4. one turn with multiple steps or request-error retries loads one routing decision.
|
|
133
|
+
5. a new user or Goal turn may make a new decision.
|
|
134
|
+
6. image admission and real candidate filtering agree, including the no-image-candidate failure.
|
|
135
|
+
7. choosing a smaller-context model can trigger the existing local pressure signal, Core compaction, and same-model retry without sending the oversized request.
|
|
136
|
+
8. hosted search remains independent and never receives the virtual Auto ID as a transport model.
|
|
137
|
+
9. the turn-tail attribution is derived from durable decision/provenance data and is hidden for explicit model turns.
|
|
138
|
+
10. no Core file, dependency artifact, private registry, shared model catalog, or live history is modified.
|
|
139
|
+
|
|
140
|
+
Synthetic tests prove composition and contracts only. They do not prove a live account's model availability, provider quality, pricing, OAuth readiness, Desktop activation, or real transport success.
|
|
141
|
+
|
|
142
|
+
## Deferred work
|
|
143
|
+
|
|
144
|
+
- benchmark-backed quality/latency/cost ranking;
|
|
145
|
+
- GitHub health signals or GitHub's private Auto service;
|
|
146
|
+
- user-selectable Efficiency/Balance/Intelligence tiers;
|
|
147
|
+
- cross-provider routing;
|
|
148
|
+
- native subagent Auto inheritance;
|
|
149
|
+
- model fallback after a provider failure;
|
|
150
|
+
- side-effect replay;
|
|
151
|
+
- automatic changes to existing Session selections, settings, or histories.
|