dsh-github-copilot 0.4.0-alpha.49 → 0.4.0-alpha.51
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 +17 -0
- package/README.md +11 -10
- package/README.zh.md +12 -11
- package/deployment-baseline.json +4 -3
- package/docs/copilot-usage.md +1 -1
- package/docs/session-search-routing.md +2 -2
- package/lib/client.js +55 -19
- package/lib/client.js.map +1 -1
- package/lib/index.js +25 -26
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -57,7 +57,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
|
|
|
57
57
|
- `src/authorization-controller.ts`: sign-in/status/sign-out and route mutation.
|
|
58
58
|
- `src/copilot-grant.ts`, `src/copilot-auth.ts`: strict grant normalization and narrow pi-ai `CredentialStore` adapter over `llm-pi-ai/github-copilot`.
|
|
59
59
|
- `src/client.ts`: `settings.models.provider-card` account UI, a `plugins.bundle.config` search page (routing and independently saved hosted-search options) with Models/footer/section routing fallback, and independently managed optional Chat integration.
|
|
60
|
-
- `src/web-search-routing-config.ts`, `src/web-search-routing-card.ts`: plugin-owned cross-provider live routing settings and the plugin-detail control surface.
|
|
60
|
+
- `src/web-search-routing-config.ts`, `src/web-search-routing-card.ts`: plugin-owned cross-provider live routing settings and the plugin-detail control surface. Routing is stored directly under the existing `github-copilot` settings namespace at `searchRouting`, mutating both leaves via nested paths `['searchRouting', 'searchProvider']` and `['searchRouting', 'defaultSearchProvider']` in one CAS call; legacy separate routing namespaces are read as fallback only. Revisions coordinate between routing and legacy `searchModel` resets so subsequent edits do not false-conflict. The Models fallback retains routing only.
|
|
61
61
|
- `src/reasoning-presentation.ts`: guarded native Chat delegation and historical Copilot provenance; filters temporary view props only, never messages, signatures, replay indexes or usage.
|
|
62
62
|
- `src/remote.ts`: Typert Remote contribution. Never add credential payloads here.
|
|
63
63
|
- `src/copilot-usage-host.ts`, `src/copilot-usage-remote.ts`, `src/copilot-usage-card.ts`, `src/copilot-usage-ui.ts`: bounded Host quota snapshots, an independent strict namespace and reversible composer presentation. No real account fetches in tests, private Client store/DOM injection, new credential owner or general model wire.
|
|
@@ -97,7 +97,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
|
|
|
97
97
|
## Session and migration ownership (V3, alpha.8, #99)
|
|
98
98
|
|
|
99
99
|
- One global Host account supplies many models; selected/history-backed Sessions retain independent model context. Auto-mode native search derives from the captured initiating Session's effective request-header/config or explicit `GenerateOptions`, never another Session or future global default C. Fixed/fallback Copilot search uses the explicit provider-owned `searchModel` override when nonempty, otherwise bounded automatic account-owned Responses selection; it never borrows the Chat model, another Session's selection or the global chat default. `Agent.options` is the activation seed, not selected Session-model evidence; `installModelSelection` overrides request/assembly; Core records the effective `Session.requestHeader().config` before tools. Without proven request context, traditional search is unavailable. A newly selected pending model must not reuse the old request header as current prompt guidance. Per-owner plan caches prevent different-model A/B reuse/cancellation; metadata remains shared.
|
|
100
|
-
- The ordinary Web search card selects only the primary and fallback providers and saves both routing leaves in one namespace
|
|
100
|
+
- The ordinary Web search card selects only the primary and fallback providers and saves both routing leaves in one CAS mutation in the existing `github-copilot` namespace at `['searchRouting', 'searchProvider']` and `['searchRouting', 'defaultSearchProvider']`. It must not depend on Copilot model discovery, account credentials or a model selection to save routing. Capture traced Settings/routing Remote faces once per UI registration so parent renders do not reset drafts. Preserve a legacy nonempty `searchModel` override; display it read-only and reset it only through an explicit, separate narrow CAS setting `searchModel: ''`, never as a routing-save side effect. Because routing and `searchModel` share the `github-copilot` namespace and revision, successful mutation of either updates the other's expected revision to avoid false CAS conflicts while preserving unsaved drafts. Saving settings does not prove hosted-search capability.
|
|
101
101
|
- Cold Chat picker and `/model` `listModels()` ensure the shared managed source without Settings first. Actual cold managed search non-forcing ensures metadata before deriving facts; existing 24h maximum TTL, cooldown, credential, allowlist and capability/probe gates remain.
|
|
102
102
|
- Without `agents.currentInitiator`, traditional hosted search is unavailable with a named diagnostic; explicit marked `GenerateOptions` can still bind guarded inline requests, uncached if necessary. Credential notification during initial lazy discovery cannot distinguish own rotation from external account change via public status: fail closed with `WEB_PROVIDER_UNAVAILABLE` before probe/wire; a later user/driver request may retry, never automatically.
|
|
103
103
|
- The new native Copilot draft warning says Save adds another real group, not a second account. Public additive APIs cannot veto Add or disable Save; this is warning-only, not enforced single-route registration. Core Edit/Delete remain. Alpha.7 screenshots illustrate timestamps, not alpha.8 migration/search proof.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.51 (prepared)
|
|
4
|
+
|
|
5
|
+
- Fix web search routing settings save by reading and writing `searchRouting` under the existing `github-copilot` settings namespace, avoiding the unexported `installSection` limitation in official `@deepseek-ai/dsh-settings@0.2.0-rc.2` (#195).
|
|
6
|
+
- Coordinate CAS revisions between web search routing and legacy `searchModel` resets within the shared `github-copilot` namespace while preserving unsaved drafts.
|
|
7
|
+
- Remove fake separate namespace and `installSection` mocks from synthetic test fixtures and align contracts.
|
|
8
|
+
|
|
9
|
+
## 0.4.0-alpha.50 (prepared)
|
|
10
|
+
|
|
11
|
+
- Add a visible restart banner in `WebSearchRoutingCard` when the routed search service composition is unready, guiding users to cold-restart Desktop (#196).
|
|
12
|
+
- Streamline the plugin details configuration page by removing the internal `HostedSearchSettingsCard` debugging form from `plugins.bundle.config`, leaving only `WebSearchRoutingCard`.
|
|
13
|
+
- Add guidance on `NODE_USE_SYSTEM_CA=1` for Copilot Quota TLS verification when using network accelerators or local proxies like Watt Toolkit (Steam++).
|
|
14
|
+
- Update documentation on cold-restart requirements for `cordis.patch.yml` service recomposition and Windows system CA trust.
|
|
15
|
+
|
|
16
|
+
## 0.4.0-alpha.49 (prepared)
|
|
17
|
+
|
|
18
|
+
- Add bounded soft capacity preferences to Copilot Auto model routing (#192).
|
|
19
|
+
|
|
3
20
|
## 0.4.0-alpha.48 (prepared)
|
|
4
21
|
|
|
5
22
|
- Keep the managed Copilot Auto model selected across turns when inherited as a new Session's default; record its durable intent before the first real-model request header and restore the virtual route on later turns (#189).
|
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ The candidate manifest treats `@deepseek-ai/dsh-authorization` and `@deepseek-ai
|
|
|
53
53
|
|
|
54
54
|
The built Client intentionally requests React from DSH's browser `ModuleLoader` singleton. React is not a Desktop Host shared package and must not be installed as a required Node profile peer. Alpha.22 declares `dsh.client.external: [\"react\"]`, removes the root React peer, and retains React only as a development dependency. Packed verification now audits every required peer and Client external, confirms the real built Client requests exactly React from the loader, and preserves authorization/schemastery as required Host peers. This fixes the packaged Desktop startup error `requires missing react@^18.2.0` without enabling peer auto-install, bundling another React copy, or weakening Desktop graph validation. Actual packaged Electron loading remains a downstream acceptance gate.
|
|
55
55
|
|
|
56
|
-
Alpha.24 fixed the Web search card's missing traced Remote dependency. At that time it lived in **Settings → Models** (`settings.models.footer`, list/root), with an old-Core Web search section fallback. It now prefers the plugin's detail page; the
|
|
56
|
+
Alpha.24 fixed the Web search card's missing traced Remote dependency. At that time it lived in **Settings → Models** (`settings.models.footer`, list/root), with an old-Core Web search section fallback. It now prefers the plugin's detail page; search routing is stored under the existing `github-copilot` namespace via nested paths without requiring a separate section registration, and without affecting account controls or search safety guards. Actual packaged Desktop acceptance is still a separate gate.
|
|
57
57
|
|
|
58
58
|
### Alpha.25 official-first DSH 0.1.6-alpha.2 adaptation
|
|
59
59
|
|
|
@@ -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.51`. 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.51/dsh-github-copilot-0.4.0-alpha.51.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.51` 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
|
|
|
@@ -169,9 +169,9 @@ Agents should treat the browser authorization as a human handoff, not as a token
|
|
|
169
169
|
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.
|
|
170
170
|
6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
|
|
171
171
|
|
|
172
|
-
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.
|
|
172
|
+
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.51`, 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).
|
|
173
173
|
|
|
174
|
-
**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. A pinned public Loader characterization records that, with the exact bundle IDs and an active provider, staged first-add can leave global `ctx.web` and an active consumer unavailable even after the routed row is enabled. A separate complete cold-loaded Web-routing composition works initially but loses global `ctx.web` and its consumer on removal and remains unavailable after re-add/reconciliation. An earlier temporary harness used alias IDs and no active provider, so its successful final add was not equivalent to the exact bundle fixture. These are synthetic Loader observations, not native Desktop manager coverage or proof of restart recovery. Do not use bundle removal/re-add as a hot-upgrade workaround; follow the manager's upgrade result and separately authorized restart requirements. See [the rc.2 lifecycle characterization and bounded public-API finding](https://github.com/cloga/dsh-github-copilot/blob/main/docs/web-lifecycle-rc2.md).
|
|
174
|
+
**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 plugin upgrade involving service recomposition (`cordis.patch.yml`, such as the isolated routed web search layer) cannot rebind active consumers via hot reload; Desktop must be fully exited and cold-restarted to take effect. A pinned public Loader characterization records that, with the exact bundle IDs and an active provider, staged first-add can leave global `ctx.web` and an active consumer unavailable even after the routed row is enabled. A separate complete cold-loaded Web-routing composition works initially but loses global `ctx.web` and its consumer on removal and remains unavailable after re-add/reconciliation. An earlier temporary harness used alias IDs and no active provider, so its successful final add was not equivalent to the exact bundle fixture. These are synthetic Loader observations, not native Desktop manager coverage or proof of restart recovery. Do not use bundle removal/re-add as a hot-upgrade workaround; follow the manager's upgrade result and separately authorized restart requirements. See [the rc.2 lifecycle characterization and bounded public-API finding](https://github.com/cloga/dsh-github-copilot/blob/main/docs/web-lifecycle-rc2.md).
|
|
175
175
|
|
|
176
176
|
**Host TLS trust diagnostics:** no Desktop trust preference was found. The linked lifecycle note records a narrowly scoped, user-owned launcher option for a fresh Desktop process with Node system CA trust enabled; it expands the accepted CA set and is not a fix established for the prior sign-in failure. It requires a full quit first to avoid single-instance handoff and durable launcher/standard-I/O lifetime. It is documentation only: no launcher, global environment, Desktop profile, shortcut, trust store, or live process was changed.
|
|
177
177
|
|
|
@@ -273,7 +273,7 @@ Auto-mode native search identity comes from the captured initiating Session's ef
|
|
|
273
273
|
|
|
274
274
|
The bundle composes a plugin-owned web-service facade while preserving the original official service and its exact configuration in a named realm. It does not edit Core or agent presets. Native `web_search` consumers keep their argument validation, query/source limits, middleware, timeout and presentation; the same routing also covers direct `ctx.web.search` consumers with proven initiating context.
|
|
275
275
|
|
|
276
|
-
The **Web search** card under **Plugins → dsh-github-copilot → Details** controls routing across search backends through the public `plugins.bundle.config` slot (keyed by package name).
|
|
276
|
+
The **Web search** card under **Plugins → dsh-github-copilot → Details** controls routing across search backends through the public `plugins.bundle.config` slot (keyed by package name). Routing has its own revision-checked writes. When the bundle slot is unavailable, routing falls back to **Settings → Models**, or **Settings → Web search** if the Models footer is also unavailable; advanced options remain available through the existing settings section. Only one routing card is registered at a time; leaving the detail page discards unsaved edits. Account sign-in, status, and model refresh remain under **Settings → Models**. No settings values are migrated or rewritten merely by opening the new page. Removing the companion restores the original web service.
|
|
277
277
|
|
|
278
278
|
The **Search provider** selector offers **Auto — follow Chat** and the actual search providers registered through the routed facade. **Fallback provider** uses the same catalog, with an additional **None — no fallback** choice. These are search backends, not individual models: Copilot is one backend even when different account models can execute its search requests. Ordinary setup needs only these provider choices, not a separate search model.
|
|
279
279
|
|
|
@@ -372,6 +372,7 @@ Existing installations must follow the [single-route migration guide](./docs/sin
|
|
|
372
372
|
- **`AUTH` / “API key is invalid” after signing in again:** this label does not prove the conversation cached an old key. On the managed route, an observed model HTTP 401 retires only the exact current token proof, except the narrowly recognized Responses replay-scope rejection described below. The failed request stays failed: no automatic message replay, logout or model switch. Your next request (or model discovery) can perform one native OAuth renewal even before stored expiry, then validate account metadata. Repeated rejection is bounded per account by `accountModelFailureCooldownMs` (five minutes by default, at least one second); even forced discovery cannot bypass this recovery cooldown. If the renewed token is still rejected, wait for the cooldown and inspect account/permission status rather than repeatedly signing out. A new sign-in is not overwritten by a late old response. HTTP 403, network errors and strings mentioning 401 do not trigger this recovery. It observes native HTTP transport only; WebSocket recovery and live endpoint acceptance are not claimed.
|
|
373
373
|
- **`input item ID does not belong to this connection` / `input item does not belong to this connection`:** these are the two observed Responses history-reference rejection messages, not proof of an invalid API key. On `github-copilot-preview` only, a bounded clone of the actual HTTP 401 JSON identifies these exact uncoded errors, with matching outer/nested messages; the plugin reports `INVALID_REQUEST` with `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH` without retiring shared account proof, aborting neighboring calls, renewing credentials or retrying the request. Unknown, malformed, oversized or ambiguous error bodies retain native authentication handling. Historical error records are not rewritten.
|
|
374
374
|
- **Managed Responses replay compatibility:** the public SDK `onPayload` hook normalizes only direct item IDs on complete assistant messages, function calls and reasoning items carrying encrypted content. It preserves `call_id` pairing, encrypted bytes, public summaries, `phase`, nested IDs and durable history. Reference-only, incomplete or unsupported ID-bearing items fail explicitly with `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`; no hidden history trimming or model switch occurs. This is Copilot-specific, not a universal OpenAI schema change: public OpenAI types require IDs on some replay forms. Native SDK/pinned-Core synthetic tests verify transport shape and isolation, not real Copilot acceptance of an old conversation. Canonical `github-copilot`, other providers and non-Responses protocols are unchanged; install/activation and old-session endpoint acceptance require separate review.
|
|
375
|
+
- **Quota TLS verification failure (`COPILOT_USAGE_TLS` / `UNABLE_TO_VERIFY_LEAF_SIGNATURE`):** when using network accelerators or local proxies such as Watt Toolkit / Steam++, GitHub HTTPS requests are intercepted via a local self-signed root CA installed in the Windows system certificate store. Because Node.js defaults to its built-in Mozilla CA bundle, it does not trust the local CA without configuration. On Node.js 22.13.0+ / 24+, configure `NODE_USE_SYSTEM_CA=1` in your User environment variables (via `[Environment]::SetEnvironmentVariable("NODE_USE_SYSTEM_CA", "1", "User")`) or in the Desktop launcher script. This enables Node.js to trust the Windows system certificate store while strictly preserving TLS signature verification. `dsh-doctor.mjs --fix` and `dsh-windows-ops` will automatically configure this environment setting.
|
|
375
376
|
- **Scope rejection persists after alpha.36:** its original exact-message classifier missed the observed wording without `ID`. Alpha.37 only closes that classification/isolation gap; it does not further rewrite payloads or prove that the rejected history can be replayed. The parallel-request failure is reproduced with the native adapter in a fixture that does not load cron. This establishes a companion error-handling defect, not the upstream reason for rejecting the original item. `Request aborted` alone does not identify its cause; `COPILOT_MODEL_SOURCE_AUTH_FAILED` is a generalized pre-catalog auth-resolution failure, whose cached result may recur without another auth attempt. Compare actual loaded version, request provenance and the same history/model before attributing another machine's success to a plugin downgrade or cron removal. Do not silently discard encrypted reasoning, retry old business work or reset credentials.
|
|
376
377
|
- **Canonical route says `not-configured`:** with configured login this is normal managed-only mode; inspect account discovery separately rather than creating a native profile.
|
|
377
378
|
- **Delete dialog stays on “Deleting…”:** this update does not prove that hang fixed. Do not repeatedly delete; after an authorized Host stop, inspect persisted settings and follow the migration guide before deciding whether any removal is still needed.
|
|
@@ -439,8 +440,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
|
|
|
439
440
|
`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.
|
|
440
441
|
|
|
441
442
|
```sh
|
|
442
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
443
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
443
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.51/dsh-github-copilot-0.4.0-alpha.51.tgz
|
|
444
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.51/SHA256SUMS
|
|
444
445
|
sha256sum --check SHA256SUMS
|
|
445
446
|
```
|
|
446
447
|
|
|
@@ -448,7 +449,7 @@ PowerShell can verify the same two downloaded files with:
|
|
|
448
449
|
|
|
449
450
|
```powershell
|
|
450
451
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
451
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
452
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.51.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
452
453
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
453
454
|
```
|
|
454
455
|
|
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.51`;这不代表已有的两条真实路由被合并或移除。版本化 URL 不表示 Release 已发布或本机已加载;仅在该 Release 与校验和可用后使用安装命令。源码、发布制品、已安装版本和实际加载运行时需分别确认,本地升级和中断会话的重启仍需用户批准。
|
|
13
13
|
|
|
14
14
|
Alpha.24 修复了 Web search 卡片缺少精确 Remote 依赖声明的问题。当时卡片位于 **设置 → 模型**(`settings.models.footer`,list/root),旧 Core 回退到独立 Web search section。现在优先显示在插件详情页;搜索子 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.51/dsh-github-copilot-0.4.0-alpha.51.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.51`。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
|
|
|
@@ -171,9 +171,9 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
|
|
|
171
171
|
5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
|
|
172
172
|
6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
|
|
173
173
|
|
|
174
|
-
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.
|
|
174
|
+
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.51`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
|
|
175
175
|
|
|
176
|
-
**Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle
|
|
176
|
+
**Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。任何包含服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的插件升级均无法通过热重载重新绑定活动组件与 consumer,必须退出应用并冷重启 Desktop 才能完全生效。pinned public Loader characterization 记录了:使用 bundle 的精确 ID 且 provider 已激活时,分阶段首次添加可能在 routed row 启用后仍令全局 `ctx.web` 和 consumer 不可用;另一独立序列从完整冷加载且正常工作的 Web-routing composition 开始,移除后全局 `ctx.web` 与 consumer 不可用,重加/重试 reconciliation 仍未恢复。较早的临时 harness 使用别名 ID 且没有 active provider,因此其最终添加成功并不等同于精确 bundle fixture。这些都是合成 Loader 观察,不是原生 Desktop manager 覆盖,也不证明重启后恢复。不要用移除/重加 bundle 作为热升级绕行;遵循 manager 的升级结果及另行批准的重启要求。详见 [rc.2 生命周期 characterization 与有限的 public API 结论](https://github.com/cloga/dsh-github-copilot/blob/main/docs/web-lifecycle-rc2.md)。
|
|
177
177
|
|
|
178
178
|
**Host TLS trust 诊断:**未发现 Desktop trust 设置。上述生命周期说明记录了一个仅供未来选择的、用户自有 launcher 选项:为全新 Desktop process 启用 Node system CA trust;它会扩大可接受 CA 集合,且尚未证明能修复先前 sign-in 失败。必须先完整退出,以免单实例 handoff,并让 launcher 及其标准 I/O 在 Desktop 生命周期内保持有效。这仅是文档建议;没有创建 launcher,也没有修改全局环境、Desktop profile、快捷方式、trust store 或运行中的进程。
|
|
179
179
|
|
|
@@ -281,17 +281,17 @@ Grant 写入或复用前,Host normalizer 只会把 pi-ai 文档化的 `type`
|
|
|
281
281
|
|
|
282
282
|
新版 bundle 通过插件自有的 web 服务外观层分流,将原官方服务及完整配置保留在命名作用域中,不修改 Core 或会话预设。原生 `web_search` 保留参数校验、查询/来源数量限制、执行中间件、超时和结果展示;有可靠发起会话上下文的直接 `ctx.web.search` 调用也使用相同分流规则。
|
|
283
283
|
|
|
284
|
-
在 **插件 → dsh-github-copilot → 详情**中,**Web search** 卡片通过公开的 `plugins.bundle.config
|
|
284
|
+
在 **插件 → dsh-github-copilot → 详情**中,**Web search** 卡片通过公开的 `plugins.bundle.config`(按包名索引)设置跨后端搜索路由;搜索路由直接保存在 `github-copilot` 命名空间的 `searchRouting` 路径下,通过嵌套路径一次完成修订号校验写入,无需额外注册第二设置命名空间;同一页面还可展开 Copilot 托管搜索选项(开关、路由白名单、引用、工具过滤、能力证明、超时及旧兜底),两项操作分别保存并协同更新版本号。若 bundle slot 不可用,路由卡片回退到 **设置 → 模型**;若 Models footer 也不可用,则回退到 **设置 → Web search**;高级选项仍可通过原设置分区修改。同一时间只注册一处路由卡片,离开详情页会丢弃未保存的草稿。账号登录、状态及模型刷新仍在 **设置 → 模型**。仅打开新页面不会迁移或改写已有设置,卸载本插件后恢复原 web 服务。
|
|
285
285
|
|
|
286
286
|
**Search provider** 主选择器提供 **Auto — follow Chat** 和通过路由外观层实际注册的搜索 Provider;**Fallback provider**(兜底后端)使用同一目录,额外提供 **None — no fallback**。选择项代表搜索后端,不代表单个模型:即使多个账号模型可以执行搜索,Copilot 仍然只有一个搜索后端。普通配置只需选择这两个 Provider,不再要求另选搜索模型。
|
|
287
287
|
|
|
288
|
-
- `
|
|
288
|
+
- `searchRouting.searchProvider: auto` 跟随发起 Chat 的 Provider。本插件自有 Copilot 别名保留既有 owner 和模型能力检查;其他 Chat Provider 的原始 ID 必须精确匹配已注册的搜索 Provider ID,不猜名字、后缀或模型家族。这是路由约定,不承诺独立注册的后端一定使用相同模型或账号。
|
|
289
289
|
- 将 `searchProvider` 设为具体 ID,就固定主搜索后端,不再随 Chat 改变。
|
|
290
290
|
- `defaultSearchProvider` 仅在无匹配主后端或主搜索失败时作最终兜底,最多尝试一次;与主后端相同时不重试,成功但结果为空也不触发兜底。`none` 仅关闭兜底,不关闭主搜索。
|
|
291
291
|
- 显式选择 Copilot 或将它作为兜底时,内部按模型 ID 排序,从当前账号路由事实中最多考虑三个符合条件的 Responses 候选。默认要求能力 probe 成功后才发送一次用户的最终查询;元数据本身不是能力证明,最终查询失败也不会跨模型重放。内部选择不改变 Chat 或全局默认模型。其他后端自行管理模型配置(若有)。
|
|
292
292
|
- 已保存的非空 `github-copilot.searchModel` 仍具有优先权;覆盖值无效时不会静默换成其他模型。只读详情提供独立、显式的恢复自动选择操作(`searchModel: ''`);保存 Provider 路由绝不修改该覆盖值。
|
|
293
293
|
|
|
294
|
-
旧 `searchMode: auto/fixed` 配置继续兼容读取,不自动写入。旧 fixed 保留原 default 作为主后端;fixed 加 `none` 继续禁用。用户明确保存后,通过一次带修订号校验的 mutation
|
|
294
|
+
旧 `searchMode: auto/fixed` 配置继续兼容读取,不自动写入。旧 fixed 保留原 default 作为主后端;fixed 加 `none` 继续禁用。用户明确保存后,通过一次带修订号校验的 mutation 在已有的 `github-copilot` 命名空间中同时写入嵌套路径 `searchRouting.searchProvider` 与 `searchRouting.defaultSearchProvider`,不依赖模型发现或账号凭证,并协同维护修订号以避免与独立重置覆盖值发生虚假冲突。稳定的 Remote 引用避免外层页面重渲染重置草稿。发生修订冲突时,应重新加载已保存配置并重新应用所需选择;拒绝或未确认的响应不会被报告为成功。保存只证明配置持久化,不证明真实搜索能力。界面会说明保存将采用选中的最终兜底并可能产生 API 费用;旧的 `github-copilot.searchFallback: none` 失败兜底付费限制保留到明确保存新选择为止。已保存但未注册的 ID 保持显示为不可用,不静默替换。
|
|
295
295
|
|
|
296
296
|
`github-copilot.routeWebSearch: false` 仍委托原始 web 服务。其余情况下,取消、卸载及捕获的账号证明失效都不能触发兜底。通用注册后端必须遵守取消信号,但公开接口没有提供其内部鉴权后、网络发送前的检查钩子;历史 Copilot/DeepSeek 直调路径保留更强的自有发送前保护。两条路径都不会用 Copilot 登录替其他 Provider 提供凭据。
|
|
297
297
|
|
|
@@ -383,6 +383,7 @@ Copilot Session 如需更宽的文件或命令权限,必须在调用前选择
|
|
|
383
383
|
- **重新登录后出现 `AUTH`/“API key is invalid”:**这个标签并不证明旧会话缓存了旧 Key。托管路由实际收到模型 HTTP 401 后,只撤销与当前请求精确匹配的 Token 证明,但下述严格识别的 Responses 历史引用错误除外;该次请求仍然失败,不自动重发消息、退出登录或切换模型。下一次请求(或模型发现)可通过原生 OAuth 进行一次续期,即使记录的有效期尚未到期,随后重新校验账号模型元数据。连续拒绝受账号级 `accountModelFailureCooldownMs` 限制(默认五分钟,至少一秒),强制发现也不能绕过该恢复冷却。续期后仍被拒绝时,请等待冷却并检查账号/权限状态,不要反复退出登录。迟到的旧响应不能覆盖新登录;403、网络错误和仅含 401 字样的错误不触发恢复。这里只观察原生 HTTP 传输,不声称覆盖 WebSocket,也不代表真实端点验收通过。
|
|
384
384
|
- **`input item ID does not belong to this connection`/`input item does not belong to this connection`:**这是已观测到的两种 Responses 历史引用拒绝文案,不证明 API key 无效。仅在 `github-copilot-preview` 上,插件对实际 HTTP 401 JSON 的有界副本严格识别这两种无错误码的精确文案,并要求外层/内层消息一致,返回带 `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH` 的 `INVALID_REQUEST`;不撤销共享账号证明、不连带中止其他请求、不续期凭据,也不自动重发。未知、格式错误、过大或存在歧义的错误体继续沿用原生鉴权处理;历史报错记录不会被改写。
|
|
385
385
|
- **托管 Responses 历史兼容处理:**通过 SDK 公开 `onPayload` 回调,只处理完整 assistant 消息、函数调用以及携带加密内容的 reasoning 条目的直接 item ID。保留 `call_id` 配对、加密字节、公开摘要、`phase`、嵌套 ID 和持久化历史。仅含引用、不完整或不支持的带 ID 条目明确报 `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`,不暗中裁剪历史或切换模型。这是 Copilot 特定兼容策略,不是对通用 OpenAI 协议的改写:公开 OpenAI 类型要求部分回放条目具有 ID。原生 SDK/固定 Core 的合成测试只证明请求形态与隔离行为,不证明真实 Copilot 已接受旧会话。Core 自有 `github-copilot`、其他供应方和非 Responses 协议保持不变;安装、激活和旧会话端点验收需分别确认。
|
|
386
|
+
- **用量与额度 TLS 验签失败(`COPILOT_USAGE_TLS` / `UNABLE_TO_VERIFY_LEAF_SIGNATURE`):**当使用 Watt Toolkit(Steam++)等网络加速器或本地代理时,代理通常会向 Windows 系统证书库安装本地根证书以拦截并代理 GitHub HTTPS 流量。Node.js 默认仅信任内置 Mozilla CA 证书库,因此会出现证书链无法验证的错误。在 Node.js 22.13.0+ / 24+ 环境下,在用户环境变量中设置 `NODE_USE_SYSTEM_CA=1`(或通过 `[Environment]::SetEnvironmentVariable("NODE_USE_SYSTEM_CA", "1", "User")` 固化),或者在 Desktop 启动脚本中添加 `set "NODE_USE_SYSTEM_CA=1"`。该设置让 Node.js 信任 Windows 系统证书库,同时保持严格的 TLS 签名验证。`dsh-doctor.mjs --fix` 及 `dsh-windows-ops` 工具集均已固化该检测与自动修复逻辑。
|
|
386
387
|
- **alpha.36 后仍有历史作用域拒绝:**原先的精确分类漏掉了不含 `ID` 的已观测文案。Alpha.37 只补齐分类与隔离,不进一步改写 payload,也不证明原被拒绝的历史已经可用。不加载 cron 的原生适配器测试已复现并行请求被连带中断,证明的是 Copilot 插件错误处理缺陷,而不是上游拒绝条目的原始原因。`Request aborted` 单独不能确定取消来源;`COPILOT_MODEL_SOURCE_AUTH_FAILED` 是目录发现前认证解析的泛化错误,缓存结果可重复返回而不代表再次认证。判断另一台机器为何正常,需对齐实际加载版本、请求来源和同一历史/模型,不能直接归因于降级插件或卸载 cron。不要暗中丢弃加密 reasoning、重发旧业务或重置凭据。
|
|
387
388
|
- **Canonical 状态为 `not-configured`:**已登录时属于正常单托管路由模式;账号发现就绪与否另行检查,不需要创建原生 profile。
|
|
388
389
|
- **删除对话框一直显示 “Deleting…”:**本次改动不证明该卡住问题已修复。不要重复删除;取得许可停止 Host 后检查持久化设置,按迁移指南判断是否仍需移除。
|
|
@@ -450,8 +451,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
|
|
|
450
451
|
`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 要求包已存在,不能代替首次建包。不会批量补发历史版本。
|
|
451
452
|
|
|
452
453
|
```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.
|
|
454
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.51/dsh-github-copilot-0.4.0-alpha.51.tgz
|
|
455
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.51/SHA256SUMS
|
|
455
456
|
sha256sum --check SHA256SUMS
|
|
456
457
|
```
|
|
457
458
|
|
|
@@ -459,7 +460,7 @@ PowerShell 可以对已下载的同一组文件执行:
|
|
|
459
460
|
|
|
460
461
|
```powershell
|
|
461
462
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
462
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
463
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.51.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
463
464
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
464
465
|
```
|
|
465
466
|
|
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.51"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -393,10 +393,11 @@
|
|
|
393
393
|
{"file": "tests/web-search-routing-card.spec.ts", "name": "resets a legacy override only through an explicit separate action"},
|
|
394
394
|
{"file": "tests/web-search-routing-card.spec.ts", "name": "explains a real Remote settings-conflict without exposing its raw details"},
|
|
395
395
|
{"file": "tests/client-search-inject.spec.ts", "name": "keeps real mounted drafts and pending saves through parent rerenders (bundle=%s)"},
|
|
396
|
+
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "published SettingsForms exposes descriptor/mutation APIs without installSection, and module lacks installSettingsSection"},
|
|
396
397
|
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "real pinned Client namespace lookups require stable capture across render calls"},
|
|
397
|
-
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "
|
|
398
|
+
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "search routing saves both leaves in github-copilot namespace using nested paths"},
|
|
398
399
|
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "stale routing revisions fail CAS and preserve the last successful settings"},
|
|
399
|
-
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "hidden legacy searchModel
|
|
400
|
+
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "hidden legacy searchModel and searchRouting share namespace revision and coordinate CAS"},
|
|
400
401
|
{"file": "tests/scripts/search-settings-contract.test.mjs", "name": "pinned generated Client mutate codecs accept routing ops and a flat namespace revision"},
|
|
401
402
|
{"file": "tests/inline/apply.spec.ts", "name": "automatically resolves account-owned Responses candidates for %s without a search model"},
|
|
402
403
|
{"file": "tests/inline/apply.spec.ts", "name": "bounds automatic proof to three eligible candidates in deterministic id order"},
|
package/docs/copilot-usage.md
CHANGED
|
@@ -24,7 +24,7 @@ The Host uses the existing `llm-pi-ai/github-copilot` OAuth grant through public
|
|
|
24
24
|
|
|
25
25
|
Quota requests are lazy, single-flight and bounded by timeout, response size and cache/failure policy. Account continuity is checked around asynchronous work and before releasing cached data. Authentication denial, sign-out, account invalidation or disposal must not release a previous account's snapshot. A same-account transient failure may expose a timestamped last-known snapshot, never a current balance. Responses and diagnostics exclude tokens, raw provider bodies and account identifiers. Requests do not follow redirects with the credential; custom enterprise hosts are not guessed.
|
|
26
26
|
|
|
27
|
-
Known certificate-validation failures in the Host fetch are reported as `COPILOT_USAGE_TLS` instead of an undifferentiated network failure. This is a read-only diagnostic, not proof of the exact Desktop network path or authorization state; inspect the Host's trust store and approved proxy configuration without disabling TLS validation. Other fetch failures remain `COPILOT_USAGE_NETWORK`. When the account snapshot is unavailable, details show the diagnostic and guidance instead of empty oversized credit columns or an implied budget. The popover background is opaque even if the host's menu token contains transparency.
|
|
27
|
+
Known certificate-validation failures in the Host fetch are reported as `COPILOT_USAGE_TLS` instead of an undifferentiated network failure. This is a read-only diagnostic, not proof of the exact Desktop network path or authorization state; inspect the Host's trust store and approved proxy configuration without disabling TLS validation. On Windows environments using network accelerators or local proxies such as Watt Toolkit / Steam++, the proxy intercepts HTTPS traffic with a local root certificate installed into the Windows system certificate store. Because Node.js historically relies on its built-in Mozilla CA bundle, Node.js 22.13.0+ / 24+ provides native system CA support via `NODE_USE_SYSTEM_CA=1`. Setting `NODE_USE_SYSTEM_CA=1` in the user environment or launcher script allows Node.js to trust the Windows system certificate store while maintaining strict TLS signature verification. Other fetch failures remain `COPILOT_USAGE_NETWORK`. When the account snapshot is unavailable, details show the diagnostic and guidance instead of empty oversized credit columns or an implied budget. The popover background is opaque even if the host's menu token contains transparency.
|
|
28
28
|
|
|
29
29
|
The Client receives only the separate strict `githubCopilotUsage` namespace (`get` and `refresh`). Existing authorization and migration methods retain their schemas. Refresh does not change settings, budget, plan, model selection or billing policy. This meter is informational and does not authorize spending or implement a budget enforcement loop.
|
|
30
30
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Requested behavior
|
|
4
4
|
|
|
5
|
-
Issue #135 separates the primary search provider from the final fallback. `
|
|
5
|
+
Issue #135 separates the primary search provider from the final fallback. `searchRouting.searchProvider` is `auto` or an exact registered search-provider ID; `defaultSearchProvider` is an independent ID or `none`. Auto follows the initiating Chat provider, never the global default. Copilot's owned aliases retain their existing account/model checks; other Chat IDs must exactly match an observed search registration, without name/suffix/model-family inference. This is a provider-level convention, not a promise of the same execution model or account across independent registries. GPT, Gemini and Grok models do not each become a separate Copilot search provider. Issue #148 makes ordinary settings provider-only: explicit/fallback Copilot resolves account-owned Responses candidates internally unless a nonempty legacy `github-copilot.searchModel` override is present. Issue #195 roots search routing under the existing `github-copilot` settings namespace at nested paths `searchRouting.searchProvider` and `searchRouting.defaultSearchProvider`, avoiding the unexported `installSection` limitation and preserving independent provider saves.
|
|
6
6
|
|
|
7
7
|
All implementation belongs to this plugin. No Core source, deployed Core artifact, prototype, private registry, credential copy or global chat-model choice is modified. The original official WebRuntime configuration, including its selected search/fetch providers, is preserved. The routed facade mirrors public search-provider registrations so exact-id selection works for official and community providers without reading Core's private registry.
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ Fallback notices remain inside canonical `WebSearchResult.content`, so Core resu
|
|
|
28
28
|
|
|
29
29
|
Legacy direct callers without the facade capture seam keep the historical `src/search-routing.ts` Copilot/DeepSeek path only for legacy policy. Its `src/deepseek-search-fallback.ts` constructs the unchanged public official adapter and retains its safe URL validation, exact option snapshot, credential ownership and post-auth/pre-fetch guard. The new catalog-based path instead calls the actual registered backend; an identical ID does not authorize replacing it with that factory. Generic `search()` exposes no internal authentication/pre-network hook, so do not claim the stronger legacy guard for arbitrary third-party implementations.
|
|
30
30
|
|
|
31
|
-
`src/search-routing-policy.ts` normalizes settings without writes: a new explicit `searchProvider` wins; old auto remains Auto; old fixed preserves its default as primary; old fixed plus `none` stays disabled. Unknown saved IDs remain visible and fail closed at dispatch. Until an explicit UI save adopts the new fallback choice, legacy `searchFallback: none` preserves its failure-spending restriction. The ordinary save commits both primary and fallback leaves together in one CAS mutation
|
|
31
|
+
`src/search-routing-policy.ts` normalizes settings without writes: a new explicit `searchProvider` wins; old auto remains Auto; old fixed preserves its default as primary; old fixed plus `none` stays disabled. Unknown saved IDs remain visible and fail closed at dispatch. Until an explicit UI save adopts the new fallback choice, legacy `searchFallback: none` preserves its failure-spending restriction. The ordinary save commits both primary and fallback leaves together in one CAS mutation in the existing `github-copilot` namespace at nested paths `['searchRouting', 'searchProvider']` and `['searchRouting', 'defaultSearchProvider']`. It neither requires account credentials nor performs account-status/model-discovery RPC or capability probe. A nonempty legacy `searchModel` remains authoritative and visible read-only; only the separate explicit reset sets `searchModel: ''` with the shared namespace revision, coordinating local revisions after either mutation to prevent false CAS conflicts while preserving unsaved drafts. A failed reset must not prevent an unrelated routing save. Missing namespaces, read-only deployments, stale revisions and uncertain responses must remain visible without exposing raw provider errors. `routeWebSearch: false`, the master enable switch, Copilot allowlists and capability proof keep their existing responsibilities.
|
|
32
32
|
|
|
33
33
|
## Search directory and settings UI
|
|
34
34
|
|
package/lib/client.js
CHANGED
|
@@ -6201,6 +6201,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6201
6201
|
borderRadius: "14px",
|
|
6202
6202
|
background: "color-mix(in srgb, currentColor 4%, transparent)"
|
|
6203
6203
|
};
|
|
6204
|
+
const restartBannerStyle = {
|
|
6205
|
+
padding: "12px 14px",
|
|
6206
|
+
borderRadius: "10px",
|
|
6207
|
+
fontSize: "13px",
|
|
6208
|
+
lineHeight: 1.5,
|
|
6209
|
+
border: "1px solid color-mix(in srgb, var(--dsw-alias-color-warning, #e3a300) 40%, transparent)",
|
|
6210
|
+
background: "color-mix(in srgb, var(--dsw-alias-color-warning, #e3a300) 12%, transparent)",
|
|
6211
|
+
display: "grid",
|
|
6212
|
+
gap: "4px"
|
|
6213
|
+
};
|
|
6204
6214
|
const fieldStyle = {
|
|
6205
6215
|
display: "grid",
|
|
6206
6216
|
gap: "6px",
|
|
@@ -6495,12 +6505,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6495
6505
|
const [draft, setDraft] = (0, react.useState)({
|
|
6496
6506
|
primary: "auto",
|
|
6497
6507
|
provider: DEEPSEEK_SEARCH_PROVIDER,
|
|
6498
|
-
legacy: true
|
|
6499
|
-
routingNamespace: WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE
|
|
6508
|
+
legacy: true
|
|
6500
6509
|
});
|
|
6501
6510
|
const [override, setOverride] = (0, react.useState)({ model: "" });
|
|
6502
6511
|
const [providers, setProviders] = (0, react.useState)([]);
|
|
6503
6512
|
const [catalogReady, setCatalogReady] = (0, react.useState)(false);
|
|
6513
|
+
const [restartRequired, setRestartRequired] = (0, react.useState)(false);
|
|
6504
6514
|
const [loading, setLoading] = (0, react.useState)(true);
|
|
6505
6515
|
const [saving, setSaving] = (0, react.useState)();
|
|
6506
6516
|
const [writable, setWritable] = (0, react.useState)(false);
|
|
@@ -6520,6 +6530,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6520
6530
|
setSaving(void 0);
|
|
6521
6531
|
setWritable(false);
|
|
6522
6532
|
setCatalogReady(false);
|
|
6533
|
+
setRestartRequired(false);
|
|
6523
6534
|
setMessage("");
|
|
6524
6535
|
setProviders([]);
|
|
6525
6536
|
try {
|
|
@@ -6530,35 +6541,40 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6530
6541
|
return;
|
|
6531
6542
|
}
|
|
6532
6543
|
const copilot = result.value.namespaces.find((entry) => entry.ns === GITHUB_COPILOT_SETTINGS_NAMESPACE);
|
|
6533
|
-
const
|
|
6544
|
+
const legacyRouting = result.value.namespaces.find((entry) => entry.ns === WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE);
|
|
6534
6545
|
const copilotValue = record$1(copilot?.value);
|
|
6535
|
-
const
|
|
6546
|
+
const copilotRoutingValue = record$1(copilotValue.searchRouting);
|
|
6547
|
+
const legacyRoutingValue = record$1(legacyRouting?.value);
|
|
6548
|
+
const routingValue = Object.keys(copilotRoutingValue).length > 0 ? copilotRoutingValue : legacyRoutingValue;
|
|
6536
6549
|
const normalized = normalizeWebSearchRouting({
|
|
6537
6550
|
searchProvider: typeof routingValue.searchProvider === "string" ? routingValue.searchProvider : void 0,
|
|
6538
6551
|
searchMode: routingValue.searchMode === "fixed" ? "fixed" : "auto",
|
|
6539
6552
|
defaultSearchProvider: typeof routingValue.defaultSearchProvider === "string" ? routingValue.defaultSearchProvider : void 0
|
|
6540
6553
|
});
|
|
6554
|
+
const copilotRevision = revisionOf(copilot?.revision);
|
|
6541
6555
|
setDraft({
|
|
6542
6556
|
primary: normalized.primaryProvider,
|
|
6543
6557
|
provider: normalized.defaultProvider,
|
|
6544
6558
|
legacy: normalized.legacy,
|
|
6545
|
-
routingRevision:
|
|
6546
|
-
routingNamespace: WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE
|
|
6559
|
+
routingRevision: copilotRevision
|
|
6547
6560
|
});
|
|
6548
6561
|
setOverride({
|
|
6549
6562
|
model: typeof copilotValue.searchModel === "string" ? copilotValue.searchModel.trim() : "",
|
|
6550
|
-
revision:
|
|
6563
|
+
revision: copilotRevision
|
|
6551
6564
|
});
|
|
6552
6565
|
const parsed = catalog?.ok ? SearchProviderCatalogSchema.safeParse(catalog.value) : void 0;
|
|
6553
6566
|
const ids = parsed?.success ? parsed.data.providers.map((entry) => entry.id) : [];
|
|
6554
6567
|
if (!parsed?.success || !parsed.data.supported || new Set(ids).size !== ids.length || ids.includes("auto") || ids.includes("none")) {
|
|
6555
|
-
|
|
6568
|
+
if (parsed?.success && !parsed.data.supported) {
|
|
6569
|
+
setRestartRequired(true);
|
|
6570
|
+
setMessage("Search service is not ready. Please restart Desktop to apply updates.");
|
|
6571
|
+
} else setMessage("Search provider list is unavailable. Reload after the routed search service is active.");
|
|
6556
6572
|
return;
|
|
6557
6573
|
}
|
|
6558
6574
|
setProviders(ids.toSorted());
|
|
6559
6575
|
setCatalogReady(true);
|
|
6560
6576
|
setWritable(result.value.writable === true);
|
|
6561
|
-
if (!
|
|
6577
|
+
if (!copilot || copilotRevision === void 0) setMessage("Web search routing settings are unavailable. Reload after the routing namespace is registered.");
|
|
6562
6578
|
else if (!result.value.writable) setMessage("Search settings are read-only in this deployment.");
|
|
6563
6579
|
} catch {
|
|
6564
6580
|
if (current()) setMessage("Could not load search settings. Reload settings to retry.");
|
|
@@ -6598,13 +6614,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6598
6614
|
setSaving("routing");
|
|
6599
6615
|
setMessage("");
|
|
6600
6616
|
try {
|
|
6601
|
-
const result = await props.settings.mutate(
|
|
6617
|
+
const result = await props.settings.mutate(GITHUB_COPILOT_SETTINGS_NAMESPACE, [{
|
|
6602
6618
|
op: "set",
|
|
6603
|
-
path: ["searchProvider"],
|
|
6619
|
+
path: ["searchRouting", "searchProvider"],
|
|
6604
6620
|
value: primary
|
|
6605
6621
|
}, {
|
|
6606
6622
|
op: "set",
|
|
6607
|
-
path: ["defaultSearchProvider"],
|
|
6623
|
+
path: ["searchRouting", "defaultSearchProvider"],
|
|
6608
6624
|
value: provider
|
|
6609
6625
|
}], draft.routingRevision);
|
|
6610
6626
|
if (!current()) return;
|
|
@@ -6613,6 +6629,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6613
6629
|
return;
|
|
6614
6630
|
}
|
|
6615
6631
|
const revision = revisionOf(result.value.revision);
|
|
6632
|
+
if (revision === void 0) {
|
|
6633
|
+
setDraft((value) => current() ? {
|
|
6634
|
+
...value,
|
|
6635
|
+
routingRevision: void 0
|
|
6636
|
+
} : value);
|
|
6637
|
+
setMessage("Save returned no revision. Reload settings before editing again.");
|
|
6638
|
+
return;
|
|
6639
|
+
}
|
|
6616
6640
|
setDraft((value) => current() ? {
|
|
6617
6641
|
...value,
|
|
6618
6642
|
primary,
|
|
@@ -6620,7 +6644,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6620
6644
|
routingRevision: revision,
|
|
6621
6645
|
legacy: false
|
|
6622
6646
|
} : value);
|
|
6623
|
-
|
|
6647
|
+
setOverride((value) => current() ? {
|
|
6648
|
+
...value,
|
|
6649
|
+
revision
|
|
6650
|
+
} : value);
|
|
6651
|
+
setMessage("Saved. New searches use this routing. Search availability is checked when you search.");
|
|
6624
6652
|
} catch (error) {
|
|
6625
6653
|
if (current()) setMessage(saveFailure(error));
|
|
6626
6654
|
} finally {
|
|
@@ -6656,10 +6684,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6656
6684
|
}
|
|
6657
6685
|
const revision = revisionOf(result.value.revision);
|
|
6658
6686
|
if (revision === void 0) {
|
|
6659
|
-
setOverride((value) => ({
|
|
6687
|
+
setOverride((value) => current() ? {
|
|
6660
6688
|
...value,
|
|
6661
6689
|
revision: void 0
|
|
6662
|
-
})
|
|
6690
|
+
} : value);
|
|
6663
6691
|
setMessage("Save returned no revision. Reload settings before editing again.");
|
|
6664
6692
|
return;
|
|
6665
6693
|
}
|
|
@@ -6667,6 +6695,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6667
6695
|
model: "",
|
|
6668
6696
|
revision
|
|
6669
6697
|
});
|
|
6698
|
+
setDraft((value) => current() ? {
|
|
6699
|
+
...value,
|
|
6700
|
+
routingRevision: revision
|
|
6701
|
+
} : value);
|
|
6670
6702
|
setMessage("Copilot model selection is now automatic. Unsaved provider choices have not been applied.");
|
|
6671
6703
|
} catch (error) {
|
|
6672
6704
|
if (current()) setMessage(saveFailure(error));
|
|
@@ -6695,7 +6727,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6695
6727
|
style: cardStyle,
|
|
6696
6728
|
"data-dsh-web-search-routing": true,
|
|
6697
6729
|
"aria-busy": loading || saving !== void 0
|
|
6698
|
-
},
|
|
6730
|
+
}, restartRequired ? (0, react.createElement)("div", {
|
|
6731
|
+
role: "alert",
|
|
6732
|
+
style: restartBannerStyle,
|
|
6733
|
+
"data-dsh-web-search-restart-banner": true
|
|
6734
|
+
}, (0, react.createElement)("strong", { style: { fontWeight: 600 } }, "Restart required to complete update / 检测到更新,请重启 Desktop 完成生效"), (0, react.createElement)("span", { style: { opacity: .85 } }, "Web search service composition requires a full application restart to rebind components. / Web 搜索服务组件更新需退出并重新启动 Desktop 以完成重编排。")) : null, (0, react.createElement)("div", null, (0, react.createElement)("h3", { style: {
|
|
6699
6735
|
margin: 0,
|
|
6700
6736
|
fontSize: "16px"
|
|
6701
6737
|
} }, "Web search"), (0, react.createElement)("p", { style: {
|
|
@@ -6830,7 +6866,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6830
6866
|
refreshing: "Refreshing…",
|
|
6831
6867
|
error: "Could not refresh usage. Try again.",
|
|
6832
6868
|
unavailableExplanation: "Account usage is currently unavailable.",
|
|
6833
|
-
tlsError: "Could not verify the connection to GitHub.
|
|
6869
|
+
tlsError: "Could not verify the connection to GitHub. If using an accelerator or proxy like Watt Toolkit, enable system CA trust (set NODE_USE_SYSTEM_CA=1 in environment); TLS verification stays enabled.",
|
|
6834
6870
|
signedOut: "Sign in to Copilot in Models to view account usage.",
|
|
6835
6871
|
lastUpdated: "Last updated",
|
|
6836
6872
|
reset: "Resets",
|
|
@@ -6862,7 +6898,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6862
6898
|
refreshing: "正在刷新…",
|
|
6863
6899
|
error: "无法刷新用量,请重试。",
|
|
6864
6900
|
unavailableExplanation: "当前无法获取账号用量。",
|
|
6865
|
-
tlsError: "无法验证与 GitHub
|
|
6901
|
+
tlsError: "无法验证与 GitHub 的连接。若使用 Watt Toolkit 等加速器或代理,可启用系统证书库(设置环境变量 NODE_USE_SYSTEM_CA=1);TLS 验证仍保持开启。",
|
|
6866
6902
|
signedOut: "请在模型设置中登录 Copilot,以查看账号用量。",
|
|
6867
6903
|
lastUpdated: "更新于",
|
|
6868
6904
|
reset: "重置时间",
|
|
@@ -8311,7 +8347,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8311
8347
|
dispose = ctx.slots.register({
|
|
8312
8348
|
name: "plugins.bundle.config",
|
|
8313
8349
|
key: "dsh-github-copilot"
|
|
8314
|
-
}, ({ view }) => view === "page" ?
|
|
8350
|
+
}, ({ view }) => view === "page" ? render() : null);
|
|
8315
8351
|
} catch {
|
|
8316
8352
|
ctx.logger.warn("[github-copilot] WEB_SEARCH_ROUTING_BUNDLE_UNAVAILABLE");
|
|
8317
8353
|
return () => {};
|