dsh-github-copilot 0.4.0-alpha.60 → 0.4.0-alpha.62

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 CHANGED
@@ -236,6 +236,8 @@ Never say GPT-6/search works merely because settings, typecheck or a package imp
236
236
 
237
237
  ## Changing capabilities
238
238
 
239
+ Model preferences must survive the Client's owned-field projection before strict decoding. `excludedModelIds` is a hidden volatile Config leaf, read via `readInlineConfig`; exercise native SettingsForms CAS, fiber preservation and restart persistence, not only map-backed settings mocks. Missing preference/selection evidence leaves model rows read-only with named diagnostics and status-only Retry. Unknown exclusion state is not an empty exclusion set. Discovery diagnostics stay in a separate Manage disclosure.
240
+
239
241
  Auto history compatibility (alpha.54, #204): official rc.2 `Session.append()` has no public ignorable-envelope option. Do not emit optional `github-copilot/auto-model-decision` events or borrow another event type; retain native real-model provenance and durable Auto selection without new durable decision recording. The assistant-actions selection footer reads bounded Host-lifetime decisions through native agent-scoped lookup and compatible historical events. Explicit captured fixed selection alone proves Manual; missing evidence is unknown, never reconstructed from today's picker. Do not repeat model names, add Model details, change native Usage/context metering or modify parent DOM. `scripts/repair-auto-model-history.mjs` is explicit source-checkout maintenance, not a runtime hook: strict pinned official v4 validation, check-only by default, optional detached repaired copy plus byte-exact backup. It never replaces live history. Applying a copy requires separately approved stopped writers and a fresh source-hash check. See `docs/automatic-model-routing.md`.
240
242
 
241
243
  1. Identify the owning seam using `agent-contract.json`; do not duplicate an upstream owner.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## 0.4.0-alpha.60 (prepared)
3
+ ## 0.4.0-alpha.62 (prepared)
4
+
5
+ - Preserve model preferences through Client authorization decoding and make hidden exclusions a native live Config field, fixing both invisible controls and rejected settings writes (#223).
6
+ - Add All/Enabled/Excluded filtering, searchable model rows, explicit selected-model locks, status-only Retry and named read-only diagnostics. Keep discovery details separate and reject stale action results after account changes or unmount.
7
+ - Add shared-account-to-Manage regression coverage and unchanged native SettingsForms CAS/fiber/persistence evidence. No Core, credentials, histories or native picker layout are changed.
8
+
9
+ ## 0.4.0-alpha.61 (released)
10
+
11
+ - Preserve the exact normalized managed Responses request across Core's freshly prepared retry attempts only after the previous request actually received HTTP 408. Short-lived state is scoped to the original turn signal, Session, model and account proof, and cleared on new step/turn end. Retry-only item references or incomplete ID-bearing items must identify matching complete prior items without contradictory fields, and all other payload and transcript bytes must agree; changed inputs, concurrent requests and cold resumes fail closed (#217).
12
+ - Keep native retry policy, SDK transport, durable replay, credentials, and model selection unchanged. A synthetic native-SDK regression covers two 408 responses followed by a reference-only third attempt; real account acceptance and Desktop installation remain unverified.
13
+
14
+ ## 0.4.0-alpha.60 (released)
4
15
 
5
16
  - Add exact account-model exclusions under **GitHub Copilot → Manage → Model preferences**, with local search, visible/excluded counts, explicit **Exclude/Restore** actions, and retained rows for excluded IDs temporarily absent from account metadata (#192).
6
17
  - Remove excluded IDs from the managed picker, every Auto candidate pool, aggregate Auto modalities, hosted-search route facts, and request-budget admission. Stale picker or direct requests fail with `COPILOT_PREVIEW_MODEL_EXCLUDED`; Auto fails closed when no eligible model remains.
package/README.md CHANGED
@@ -98,7 +98,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
98
98
 
99
99
  ## Install and sign in
100
100
 
101
- The commands below target the package version `0.4.0-alpha.60`. 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):
101
+ The commands below target the package version `0.4.0-alpha.62`. 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):
102
102
 
103
103
  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):
104
104
 
@@ -111,10 +111,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
111
111
  For a standalone named profile only, the supported CLI command is:
112
112
 
113
113
  ```sh
114
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
114
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.62/dsh-github-copilot-0.4.0-alpha.62.tgz
115
115
  ```
116
116
 
117
- For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.60` 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.
117
+ For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.62` 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.
118
118
 
119
119
  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.
120
120
 
@@ -124,7 +124,9 @@ Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in*
124
124
  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.
125
125
  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.
126
126
  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. A failed begin can also show a fixed **latest observed milestone** (`AUTHORIZATION_REQUESTED`, `INTERACTION_PROMPT_OBSERVED`, or `INTERACTION_NOTICE_OBSERVED`). It reports only progress observed through the public interaction callbacks, not the failing operation or a credential commit. The latter route-repair code retains authentication and directs you to **Manage → Repair model configuration**. These codes and milestones do not explain or resolve the underlying sign-in failure; raw provider details are never displayed or logged.
127
- 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 manual refresh, model details, **Model preferences**, and sign-out. Model preferences provide local search and explicit **Exclude/Restore** actions. Excluded exact IDs disappear from the managed picker and every Auto pool; temporarily absent excluded IDs remain restorable. The current fixed managed model is locked until another model is selected. No exclusion rewrites history, changes selection, or mutates account entitlement. Legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation.
127
+ 5. Choose an accepted model under **GitHub Copilot** (stable route ID `github-copilot-preview`). Normal opening/use maintains metadata without requiring **Refresh models**. **Manage → Model preferences** provides search, **All / Enabled / Excluded** filters, and immediate **Exclude/Restore** actions. Excluded exact IDs disappear from the managed picker and every Auto pool; temporarily absent excluded IDs remain restorable. Models selected by a live session or the future default are locked until those fixed selections change. No exclusion rewrites history, changes selection, or mutates account entitlement. **Discovery details** contains metadata diagnostics separately from the model controls. Legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation.
128
+
129
+ If preferences cannot be read, available account rows remain visible but read-only. Unknown exclusion status is not shown as enabled. A named diagnostic distinguishes unavailable/invalid settings from incomplete selection evidence; **Retry** reads Host status only, without refreshing OAuth or discovering models. Failed writes retain the last confirmed state. Exclusions use native live, hidden Config fields and path-level settings CAS, so saving does not remount the plugin. Account model discovery alone does not prove that preference settings or model transport are working.
128
130
 
129
131
  ### Auto model routing
130
132
 
@@ -157,7 +159,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
157
159
  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.
158
160
  6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
159
161
 
160
- 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.60`, 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).
162
+ 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.62`, 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).
161
163
 
162
164
  **Desktop package-update and Web-lifecycle boundaries:** the native manager's `restart-required` result for an in-place installed-package upgrade is authoritative and distinct from plugin-bundle removal/re-add behavior. Any disable, removal, or upgrade involving service recomposition (`cordis.patch.yml`, such as the isolated routed web search layer) may leave dependent entries pending until Desktop is fully exited and cold-restarted. If the native manager reports only entries such as `pending (waiting for service: web)` while this plugin already shows **Off**, the requested disabled state has been persisted; cold-restart Desktop instead of repeatedly toggling or reinstalling the plugin. Other errors are not covered by this guidance and must still be investigated.
163
165
 
@@ -361,7 +363,7 @@ Existing installations must follow the [single-route migration guide](./docs/sin
361
363
  - **Signed in but a new model is missing:** opening Models ensures missing/stale metadata automatically; inspect accepted/rejected models for `github-copilot-preview`. Use **Retry** after errors or **Manage → Refresh models** to intentionally refresh before the TTL expires. Unsupported endpoints or incomplete metadata produce diagnostics, not static-catalog fallback. Do not repeat login or disable validation.
362
364
  - **`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.
363
365
  - **`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.
364
- - **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.
366
+ - **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. After an actual HTTP 408, a newly prepared attempt in the same Core step may reuse the exact previously normalized wire payload if it substitutes only matching item-ID references or incomplete ID-bearing items without conflicting fields, and the complete transcript and every other request field agree. The entry is bound to the original turn signal, Session, model and account proof; it expires after 60 seconds, is limited to 2 MiB, and is cleared on the next step/turn end, concurrency, cancellation, credential discontinuity or a different request. It neither creates a retry nor bypasses native policy. Cold-history reference-only, incomplete or unsupported ID-bearing items still fail explicitly with `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`. `call_id` pairing, encrypted bytes, public summaries, `phase`, nested IDs and durable history are unchanged; 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.
365
367
  - **Quota TLS verification failure (`COPILOT_USAGE_TLS` / `UNABLE_TO_VERIFY_LEAF_SIGNATURE`):** the quota request uses a reusable, TLS-verified agent combining Node's default and system CA roots, including trusted Windows roots installed by Watt Toolkit / Steam++-style accelerators. `NODE_USE_SYSTEM_CA=1` is no longer required for this plugin-owned request after the updated plugin is loaded; it can still matter for unrelated Desktop traffic. `COPILOT_USAGE_TRUST_UNAVAILABLE` means system roots could not be loaded or the agent could not be created, and no request was sent. Check the Host certificate store and proxy configuration without disabling verification; neither diagnostic proves a specific proxy or live account status.
366
368
  - **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.
367
369
  - **Canonical route says `not-configured`:** with configured login this is normal managed-only mode; inspect account discovery separately rather than creating a native profile.
@@ -430,8 +432,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
430
432
  `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.
431
433
 
432
434
  ```sh
433
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
434
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/SHA256SUMS
435
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.62/dsh-github-copilot-0.4.0-alpha.62.tgz
436
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.62/SHA256SUMS
435
437
  sha256sum --check SHA256SUMS
436
438
  ```
437
439
 
@@ -439,7 +441,7 @@ PowerShell can verify the same two downloaded files with:
439
441
 
440
442
  ```powershell
441
443
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
442
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.60.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
444
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.62.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
443
445
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
444
446
  ```
445
447
 
package/README.zh.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
22
22
 
23
- > 当前文档与安装命令对应版本 `0.4.0-alpha.60`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
23
+ > 当前文档与安装命令对应版本 `0.4.0-alpha.62`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
24
24
 
25
25
  Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
26
26
 
@@ -113,10 +113,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
113
113
  仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
114
114
 
115
115
  ```sh
116
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
116
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.62/dsh-github-copilot-0.4.0-alpha.62.tgz
117
117
  ```
118
118
 
119
- Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.60`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
119
+ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.62`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
120
120
 
121
121
  随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
122
122
 
@@ -126,7 +126,9 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
126
126
  2. 点击 **Sign in with GitHub** 后,验证码区域自动展开,提供醒目的一次性验证码、**Open GitHub verification page**、**Copy code** 和 **Cancel sign-in**。不需要再点一次 **Manage**。识别到 Desktop v1 宿主时,通过现有的同窗口外部导航处理交给系统浏览器,不依赖弹出窗口;网页版仍打开新标签页。如果没有打开,可选中并复制界面显示的验证网址到浏览器。插件无法确认系统浏览器是否已打开。
127
127
  3. 复制验证码,打开验证链接,在自己的 GitHub 浏览器会话中完成授权。复制成功/失败均有可访问的反馈;手工复制仍可用。不要把 GitHub token 粘贴到 DSH。
128
128
  4. DSH 只在授权进行中轮询。显式 **Start sign-in**(**Sign in with GitHub** 按钮,包括界面切换账号)成功后,无论立即返回还是轮询观察到成功,都只强制执行一次有界发现。验证码和验证链接清除,自动授权区域收起,账号显示 **Signed in、Manage**。手动打开的详情保持展开;取消清除旧验证码。失败仅显示安全的阶段诊断:`COPILOT_AUTHORIZATION_BEGIN_FAILED` 表示授权流程未完成;`COPILOT_ROUTE_REPAIR_FAILED` 表示授权已完成但本地路由修复失败。begin 失败还可以显示固定的“最近观察到的里程碑” (`AUTHORIZATION_REQUESTED`、`INTERACTION_PROMPT_OBSERVED` 或 `INTERACTION_NOTICE_OBSERVED`);它只表示公开 interaction callback 已观察到的进度,不代表失败操作或 credential commit。后者会保留认证,并提示前往 **Manage → Repair model configuration**。这些代码和里程碑不解释或解决底层登录失败,原始 provider 详情不会显示或记录。
129
- 5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage** 内包含手动刷新、模型明细、**Model preferences** 与退出登录。模型偏好提供本地搜索和明确的 **Exclude/Restore** 操作;被排除的精确 ID 会退出托管 picker 与所有 Auto 候选,暂时不在账号元数据中的排除 ID 仍可恢复。当前固定托管模型在切换到其他模型前不可排除。排除不会改写历史、切换选择或修改账号权限。
129
+ 5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage → Model preferences** 提供搜索、**All / Enabled / Excluded** 筛选,以及立即保存的 **Exclude/Restore** 操作;被排除的精确 ID 会退出托管 picker 与所有 Auto 候选,暂时不在账号元数据中的排除 ID 仍可恢复。被实时会话或未来默认设置选中的固定模型,在对应选择改变前不可排除。排除不会改写历史、切换选择或修改账号权限。发现说明及能力警告收纳在独立的 **Discovery details** 中。
130
+
131
+ 偏好读取失败时,已有账号模型仍以只读列表显示,未知排除状态不会伪装成已启用。明确的诊断码区分设置不可用、设置无效与选择证据不完整;**Retry** 仅重读 Host 状态,不刷新 OAuth 或发现模型。保存失败保留最后确认的状态。排除设置使用原生动态隐藏 Config 字段及路径级 CAS,保存无需重新挂载插件。账号模型发现成功不等于偏好设置或模型调用已正常工作。
130
132
 
131
133
  ### Auto 模型路由
132
134
 
@@ -159,7 +161,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
159
161
  5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
160
162
  6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
161
163
 
162
- 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.60`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
164
+ 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.62`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
163
165
 
164
166
  **Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
165
167
 
@@ -372,7 +374,7 @@ Copilot Session 如需更宽的文件或命令权限,必须在调用前选择
372
374
  - **已登录但新模型缺失:**打开 Models 会自动确保缺失/过期元数据,查看 `github-copilot-preview` 的接受/拒绝结果。错误可点 **Retry**;希望在 TTL 到期前有意强制更新时,使用 **Manage → Refresh models**。接口不支持或元数据不完整时显示诊断,不退回静态目录,也不要反复登录或关闭校验。
373
375
  - **重新登录后出现 `AUTH`/“API key is invalid”:**这个标签并不证明旧会话缓存了旧 Key。托管路由实际收到模型 HTTP 401 后,只撤销与当前请求精确匹配的 Token 证明,但下述严格识别的 Responses 历史引用错误除外;该次请求仍然失败,不自动重发消息、退出登录或切换模型。下一次请求(或模型发现)可通过原生 OAuth 进行一次续期,即使记录的有效期尚未到期,随后重新校验账号模型元数据。连续拒绝受账号级 `accountModelFailureCooldownMs` 限制(默认五分钟,至少一秒),强制发现也不能绕过该恢复冷却。续期后仍被拒绝时,请等待冷却并检查账号/权限状态,不要反复退出登录。迟到的旧响应不能覆盖新登录;403、网络错误和仅含 401 字样的错误不触发恢复。这里只观察原生 HTTP 传输,不声称覆盖 WebSocket,也不代表真实端点验收通过。
374
376
  - **`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`;不撤销共享账号证明、不连带中止其他请求、不续期凭据,也不自动重发。未知、格式错误、过大或存在歧义的错误体继续沿用原生鉴权处理;历史报错记录不会被改写。
375
- - **托管 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 协议保持不变;安装、激活和旧会话端点验收需分别确认。
377
+ - **托管 Responses 历史兼容处理:**通过 SDK 公开 `onPayload` 回调,只处理完整 assistant 消息、函数调用以及携带加密内容的 reasoning 条目的直接 item ID。只有上次真实收到 HTTP 408、同一 Core step 重新 prepare 的后续尝试仅把对应完整条目替换成匹配 ID 的引用或无冲突字段的不完整带 ID 条目,且完整上下文与其余请求字段完全一致时,才复用之前规范化的相同 wire payload。此状态绑定原始 turn signal、Session、模型及账号证明,60 秒内、2 MiB 内有效;新 step/turn 结束、并发、取消、凭据变更或请求变化均会清除,不新增重试,也不绕过原生策略。冷历史中仅含引用、不完整或不支持的带 ID 条目仍明确报 `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`。`call_id` 配对、加密字节、公开摘要、`phase`、嵌套 ID 和持久化历史不变,不暗中裁剪历史或切换模型。这是 Copilot 特定兼容策略,不是对通用 OpenAI 协议的改写:公开 OpenAI 类型要求部分回放条目具有 ID。原生 SDK/固定 Core 的合成测试只证明请求形态与隔离行为,不证明真实 Copilot 已接受旧会话。Core 自有 `github-copilot`、其他供应方和非 Responses 协议保持不变;安装、激活和旧会话端点验收需分别确认。
376
378
  - **用量与额度 TLS 验签失败(`COPILOT_USAGE_TLS` / `UNABLE_TO_VERIFY_LEAF_SIGNATURE`):**额度请求使用可复用的专用 agent,组合 Node 默认与系统证书信任根,包括 Watt Toolkit/Steam++ 等加速器安装的受信任 Windows 根证书。更新插件实际加载后,此请求不再需要 `NODE_USE_SYSTEM_CA=1`;其他 Desktop 流量仍可能依赖该进程设置。`COPILOT_USAGE_TRUST_UNAVAILABLE` 表示无法读取系统证书或创建 agent,请求未发送。请检查 Host 证书库和代理配置,不要关闭 TLS 验签;仅凭诊断无法证明具体代理路径或账号状态。
377
379
  - **alpha.36 后仍有历史作用域拒绝:**原先的精确分类漏掉了不含 `ID` 的已观测文案。Alpha.37 只补齐分类与隔离,不进一步改写 payload,也不证明原被拒绝的历史已经可用。不加载 cron 的原生适配器测试已复现并行请求被连带中断,证明的是 Copilot 插件错误处理缺陷,而不是上游拒绝条目的原始原因。`Request aborted` 单独不能确定取消来源;`COPILOT_MODEL_SOURCE_AUTH_FAILED` 是目录发现前认证解析的泛化错误,缓存结果可重复返回而不代表再次认证。判断另一台机器为何正常,需对齐实际加载版本、请求来源和同一历史/模型,不能直接归因于降级插件或卸载 cron。不要暗中丢弃加密 reasoning、重发旧业务或重置凭据。
378
380
  - **Canonical 状态为 `not-configured`:**已登录时属于正常单托管路由模式;账号发现就绪与否另行检查,不需要创建原生 profile。
@@ -441,8 +443,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
441
443
  `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 要求包已存在,不能代替首次建包。不会批量补发历史版本。
442
444
 
443
445
  ```sh
444
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
445
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/SHA256SUMS
446
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.62/dsh-github-copilot-0.4.0-alpha.62.tgz
447
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.62/SHA256SUMS
446
448
  sha256sum --check SHA256SUMS
447
449
  ```
448
450
 
@@ -450,7 +452,7 @@ PowerShell 可以对已下载的同一组文件执行:
450
452
 
451
453
  ```powershell
452
454
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
453
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.60.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
455
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.62.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
454
456
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
455
457
  ```
456
458
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.60"
11
+ "version": "0.4.0-alpha.62"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -558,6 +558,7 @@
558
558
  ],
559
559
  "sourceMarkers": [
560
560
  {"file": "src/responses-replay-compat.ts", "marker": "normalizeCopilotResponsesPayload"},
561
+ {"file": "src/responses-replay-compat.ts", "marker": "ResponsesRetryReplay"},
561
562
  {"file": "src/responses-replay-compat.ts", "marker": "isCopilotInputItemScopeError"},
562
563
  {"file": "src/responses-replay-compat.ts", "marker": "input item does not belong to this connection"},
563
564
  {"file": "src/preview-provider.ts", "marker": "onPayload"},
@@ -565,6 +566,9 @@
565
566
  ],
566
567
  "tests": [
567
568
  {"file": "tests/preview-provider.spec.ts", "name": "normalizes only wire item IDs after native serialization while preserving durable replay and tool pairing"},
569
+ {"file": "tests/preview-provider.spec.ts", "name": "sends identical normalized bytes on the third Core-style attempt after two HTTP 408s"},
570
+ {"file": "tests/responses-replay-compat.spec.ts", "name": "refuses a new step, session, signal, cold resume, stale entry and concurrent requests"},
571
+ {"file": "tests/preview-route.spec.ts", "name": "clears only the matching Session retry cache on %s across fresh Core preparations"},
568
572
  {"file": "tests/preview-route.spec.ts", "name": "classifies \"$message\" in a $envelope Responses 401 locally and reuses the same credential without discovery or refresh"},
569
573
  {"file": "tests/preview-route.spec.ts", "name": "does not abort a parallel native request when another dispatch receives a replay-scope 401: %s"},
570
574
  {"file": "tests/preview-route.spec.ts", "name": "does not retain a replay-scope failure across independent dispatches of one native prepared lease: %s"}
package/lib/client.js CHANGED
@@ -90,7 +90,7 @@ window.__ModuleLoader__.load({
90
90
  publish({ copyState: "idle" });
91
91
  return;
92
92
  }
93
- const { accountModels: _models, notices: _notices, ...view } = state.view;
93
+ const { accountModels: _models, modelPreferences: _preferences, notices: _notices, ...view } = state.view;
94
94
  publish({
95
95
  view: {
96
96
  ...view,
@@ -107,12 +107,13 @@ window.__ModuleLoader__.load({
107
107
  };
108
108
  const accept = (decoded, operation) => {
109
109
  const previousCode = noticeCode();
110
- const { accountModels, notices, error, ...rest } = decoded;
110
+ const { accountModels, modelPreferences, notices, error, ...rest } = decoded;
111
111
  const failure = error !== void 0 || decoded.phase === "error" ? safeAuthorizationFailure(error) : void 0;
112
112
  const view = {
113
113
  ...rest,
114
114
  notices: decoded.inFlight && !suppressNotice ? notices : [],
115
115
  ...decoded.configured && !decoded.inFlight && accountModels !== void 0 ? { accountModels } : {},
116
+ ...decoded.configured && !decoded.inFlight && modelPreferences !== void 0 ? { modelPreferences } : {},
116
117
  ...failure === void 0 ? {} : { error: failure }
117
118
  };
118
119
  let actionError = failure;
@@ -5764,6 +5765,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5764
5765
  unavailableExcludedModelIds: array(string().min(1).max(512)).max(512),
5765
5766
  error: _enum([
5766
5767
  "COPILOT_MODEL_PREFERENCES_UNAVAILABLE",
5768
+ "COPILOT_MODEL_SETTINGS_UNAVAILABLE",
5769
+ "COPILOT_MODEL_SETTINGS_INVALID",
5770
+ "COPILOT_MODEL_SELECTION_UNAVAILABLE",
5767
5771
  "COPILOT_MODEL_EXCLUSION_SELECTED",
5768
5772
  "COPILOT_MODEL_EXCLUSION_CONFLICT",
5769
5773
  "COPILOT_MODEL_EXCLUSION_SAVE_FAILED"
@@ -7816,91 +7820,212 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7816
7820
  }
7817
7821
  //#endregion
7818
7822
  //#region lib/types/model-preferences-card.js
7823
+ const controlStyle = {
7824
+ color: "inherit",
7825
+ background: "transparent",
7826
+ font: "inherit",
7827
+ fontSize: "14px",
7828
+ border: "1px solid color-mix(in srgb, currentColor 30%, transparent)",
7829
+ borderRadius: "8px",
7830
+ padding: "7px 12px",
7831
+ minHeight: "36px"
7832
+ };
7833
+ function preferenceMessage(code) {
7834
+ switch (code) {
7835
+ case "COPILOT_MODEL_SETTINGS_UNAVAILABLE": return "Cannot read model exclusion settings. Models are read-only. Retry to read settings again.";
7836
+ case "COPILOT_MODEL_SETTINGS_INVALID": return "Model exclusion settings are invalid. No settings were changed. Review the settings before retrying.";
7837
+ case "COPILOT_MODEL_SELECTION_UNAVAILABLE": return "Cannot confirm the models selected by sessions or the default. Changes are disabled to protect those selections. Retry to check again.";
7838
+ case "COPILOT_MODEL_EXCLUSION_SELECTED": return "This model is selected by a session or the default. Select another fixed model there before excluding it.";
7839
+ case "COPILOT_MODEL_EXCLUSION_CONFLICT": return "Settings changed elsewhere. Review the current list before trying again.";
7840
+ case "COPILOT_MODEL_EXCLUSION_SAVE_FAILED": return "Could not confirm the change. Retry to read the saved settings before trying again.";
7841
+ default: return "The Host did not provide model preferences. Models are read-only. Retry; if this persists, check that Host and Client are running the same plugin version.";
7842
+ }
7843
+ }
7819
7844
  function GitHubCopilotModelPreferencesPanel(props) {
7820
7845
  const [query, setQuery] = (0, react.useState)("");
7846
+ const [filter, setFilter] = (0, react.useState)("all");
7821
7847
  const [preferences, setPreferences] = (0, react.useState)(props.preferences);
7848
+ const [models, setModels] = (0, react.useState)(props.models);
7822
7849
  const [busyModel, setBusyModel] = (0, react.useState)();
7823
7850
  const [error, setError] = (0, react.useState)();
7851
+ const [errorModel, setErrorModel] = (0, react.useState)();
7852
+ const request = (0, react.useRef)({
7853
+ generation: 0,
7854
+ pending: false
7855
+ });
7824
7856
  (0, react.useEffect)(() => {
7857
+ const scope = request.current;
7858
+ scope.generation++;
7859
+ scope.pending = false;
7825
7860
  setPreferences(props.preferences);
7861
+ setModels(props.models);
7826
7862
  setError(void 0);
7827
- }, [props.preferences]);
7828
- const available = props.models?.models ?? [];
7829
- if (preferences === void 0) return (0, react.createElement)("details", { "data-dsh-github-copilot-model-preferences": true }, (0, react.createElement)("summary", null, "Model preferences"), (0, react.createElement)("p", { role: "status" }, "Model exclusions are unavailable in this profile."));
7830
- const excluded = new Set(preferences.excludedModelIds);
7831
- const locked = new Set(preferences.lockedModelIds);
7863
+ setErrorModel(void 0);
7864
+ setBusyModel(void 0);
7865
+ return () => {
7866
+ scope.generation++;
7867
+ scope.pending = false;
7868
+ };
7869
+ }, [
7870
+ props.preferences,
7871
+ props.models,
7872
+ props.remote
7873
+ ]);
7874
+ const available = models?.models ?? [];
7875
+ const settingsKnown = preferences !== void 0 && preferences.revision !== void 0;
7876
+ const excluded = new Set(preferences?.excludedModelIds ?? []);
7877
+ const locked = new Set(preferences?.lockedModelIds ?? []);
7878
+ const diagnostic = error ?? preferences?.error ?? (preferences === void 0 ? "COPILOT_MODEL_PREFERENCES_UNAVAILABLE" : void 0);
7879
+ const writable = preferences?.writable === true && settingsKnown;
7832
7880
  const rows = [...available.map((model) => ({
7833
7881
  id: model.id,
7834
7882
  name: model.name,
7835
7883
  available: true
7836
- })), ...preferences.unavailableExcludedModelIds.filter((id) => !available.some((model) => model.id === id)).map((id) => ({
7884
+ })), ...(preferences?.unavailableExcludedModelIds ?? []).filter((id) => !available.some((model) => model.id === id)).map((id) => ({
7837
7885
  id,
7838
7886
  name: id,
7839
7887
  available: false
7840
7888
  }))];
7841
7889
  const needle = query.trim().toLocaleLowerCase();
7842
- const filtered = rows.filter((model) => needle.length === 0 || model.id.toLocaleLowerCase().includes(needle) || model.name.toLocaleLowerCase().includes(needle));
7890
+ const filtered = rows.filter((model) => (filter === "all" || settingsKnown && (filter === "excluded" ? excluded.has(model.id) : !excluded.has(model.id))) && (needle.length === 0 || model.id.toLocaleLowerCase().includes(needle) || model.name.toLocaleLowerCase().includes(needle)));
7843
7891
  const visibleCount = available.filter((model) => !excluded.has(model.id)).length;
7844
- const update = async (modelId, restore) => {
7845
- if (busyModel !== void 0) return;
7846
- setBusyModel(modelId);
7892
+ const update = async (modelId, restore = false) => {
7893
+ const scope = request.current;
7894
+ if (scope.pending || modelId !== void 0 && !writable) return;
7895
+ scope.pending = true;
7896
+ const generation = ++scope.generation;
7897
+ const current = () => scope.generation === generation;
7898
+ setBusyModel(modelId ?? "");
7847
7899
  setError(void 0);
7900
+ setErrorModel(modelId);
7848
7901
  try {
7849
- const result = restore ? await props.remote.restoreModel(modelId) : await props.remote.excludeModel(modelId);
7902
+ const result = modelId === void 0 ? await props.remote.status() : restore ? await props.remote.restoreModel(modelId) : await props.remote.excludeModel(modelId);
7903
+ if (!current()) return;
7850
7904
  if (!result.ok) {
7851
7905
  setError("COPILOT_MODEL_EXCLUSION_SAVE_FAILED");
7852
7906
  return;
7853
7907
  }
7854
7908
  const parsed = GitHubCopilotAuthorizationViewSchema.safeParse(result.value);
7855
- if (!parsed.success || parsed.data.modelPreferences === void 0) {
7909
+ if (!parsed.success) {
7910
+ setError("COPILOT_MODEL_PREFERENCES_UNAVAILABLE");
7911
+ return;
7912
+ }
7913
+ if (!parsed.data.configured || parsed.data.inFlight) {
7914
+ setPreferences(void 0);
7915
+ setModels(void 0);
7856
7916
  setError("COPILOT_MODEL_PREFERENCES_UNAVAILABLE");
7857
7917
  return;
7858
7918
  }
7859
7919
  setPreferences(parsed.data.modelPreferences);
7860
- setError(parsed.data.modelPreferences.error);
7920
+ setModels(parsed.data.accountModels);
7921
+ setError(parsed.data.modelPreferences?.error);
7861
7922
  } catch {
7862
- setError("COPILOT_MODEL_EXCLUSION_SAVE_FAILED");
7923
+ if (current()) setError("COPILOT_MODEL_EXCLUSION_SAVE_FAILED");
7863
7924
  } finally {
7864
- setBusyModel(void 0);
7925
+ if (current()) {
7926
+ scope.pending = false;
7927
+ setBusyModel(void 0);
7928
+ }
7865
7929
  }
7866
7930
  };
7867
- return (0, react.createElement)("details", { "data-dsh-github-copilot-model-preferences": true }, (0, react.createElement)("summary", null, `Model preferences · ${visibleCount} visible · ${preferences.excludedModelIds.length} excluded`), (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Excluded models disappear from the managed picker and are never considered by Auto. Restoring a model does not select it."), (0, react.createElement)("label", { style: {
7931
+ return (0, react.createElement)("details", { "data-dsh-github-copilot-model-preferences": true }, (0, react.createElement)("summary", null, settingsKnown ? `Model preferences · ${visibleCount} enabled · ${excluded.size} excluded` : "Model preferences · Read-only"), (0, react.createElement)("p", { style: {
7932
+ fontSize: "14px",
7933
+ marginBlock: "12px"
7934
+ } }, "Excluded models disappear from the managed picker and are never considered by Auto. Restoring a model does not select it."), diagnostic === void 0 ? null : (0, react.createElement)("div", {
7935
+ role: "alert",
7936
+ "data-dsh-github-copilot-model-preferences-error": true,
7937
+ style: {
7938
+ fontSize: "14px",
7939
+ marginBlock: "12px"
7940
+ }
7941
+ }, (0, react.createElement)("p", null, preferenceMessage(diagnostic)), (0, react.createElement)("code", { style: { overflowWrap: "anywhere" } }, diagnostic), (0, react.createElement)("div", { style: { marginTop: "8px" } }, (0, react.createElement)("button", {
7942
+ type: "button",
7943
+ style: controlStyle,
7944
+ disabled: busyModel !== void 0,
7945
+ onClick: () => update(),
7946
+ "data-dsh-github-copilot-preferences-retry": true
7947
+ }, busyModel === "" ? "Reading settings…" : "Retry"))), (0, react.createElement)("label", { style: {
7868
7948
  display: "grid",
7869
- gap: "4px",
7870
- fontSize: "13px"
7949
+ gap: "6px",
7950
+ fontSize: "14px"
7871
7951
  } }, "Search models", (0, react.createElement)("input", {
7872
7952
  type: "search",
7873
7953
  value: query,
7954
+ style: {
7955
+ ...controlStyle,
7956
+ fontSize: "16px",
7957
+ width: "100%",
7958
+ boxSizing: "border-box",
7959
+ minWidth: 0
7960
+ },
7874
7961
  onChange: (event) => setQuery(event.currentTarget.value),
7875
7962
  placeholder: "Search by name or exact model ID",
7876
7963
  "data-dsh-github-copilot-model-search": true
7877
- })), error === void 0 && preferences.error === void 0 ? null : (0, react.createElement)("p", {
7878
- role: "alert",
7879
- "data-dsh-github-copilot-model-preferences-error": true
7880
- }, error ?? preferences.error), filtered.length === 0 ? (0, react.createElement)("p", { role: "status" }, "No models match this search.") : (0, react.createElement)("ul", { style: {
7881
- listStyle: "none",
7882
- padding: 0,
7883
- display: "grid",
7884
- gap: "8px"
7885
- } }, filtered.map((model) => {
7964
+ })), (0, react.createElement)("div", {
7965
+ role: "group",
7966
+ "aria-label": "Filter models",
7967
+ style: {
7968
+ display: "flex",
7969
+ flexWrap: "wrap",
7970
+ gap: "8px",
7971
+ marginBlock: "12px"
7972
+ }
7973
+ }, [
7974
+ "all",
7975
+ "enabled",
7976
+ "excluded"
7977
+ ].map((value) => (0, react.createElement)("button", {
7978
+ key: value,
7979
+ type: "button",
7980
+ "aria-pressed": filter === value,
7981
+ disabled: value !== "all" && !settingsKnown,
7982
+ onClick: () => setFilter(value),
7983
+ style: {
7984
+ ...controlStyle,
7985
+ fontWeight: filter === value ? 600 : 400,
7986
+ background: filter === value ? "color-mix(in srgb, currentColor 12%, transparent)" : "transparent"
7987
+ }
7988
+ }, value === "all" ? `All (${rows.length})` : value === "enabled" ? `Enabled (${settingsKnown ? visibleCount : "?"})` : `Excluded (${settingsKnown ? excluded.size : "?"})`))), filtered.length === 0 ? (0, react.createElement)("p", { role: "status" }, rows.length === 0 ? "No account models to display. Use Refresh models to read account metadata." : "No models match this filter or search.") : (0, react.createElement)("ul", {
7989
+ "aria-label": "Account models",
7990
+ style: {
7991
+ listStyle: "none",
7992
+ padding: 0,
7993
+ margin: 0
7994
+ }
7995
+ }, filtered.map((model) => {
7886
7996
  const isExcluded = excluded.has(model.id);
7887
7997
  const isLocked = locked.has(model.id);
7888
- const disabled = busyModel !== void 0 || !isExcluded && isLocked;
7998
+ const disabled = !writable || busyModel !== void 0 || !isExcluded && isLocked;
7889
7999
  return (0, react.createElement)("li", {
7890
8000
  key: model.id,
7891
8001
  style: {
7892
8002
  display: "flex",
7893
- gap: "10px",
7894
- alignItems: "center"
8003
+ gap: "12px",
8004
+ alignItems: "center",
8005
+ paddingBlock: "12px",
8006
+ borderBottom: "1px solid color-mix(in srgb, currentColor 18%, transparent)"
7895
8007
  }
7896
8008
  }, (0, react.createElement)("span", { style: {
7897
8009
  flex: 1,
7898
8010
  minWidth: 0,
7899
- overflowWrap: "anywhere"
7900
- } }, (0, react.createElement)("strong", null, model.name), (0, react.createElement)("br"), (0, react.createElement)("code", null, model.id), model.available ? null : (0, react.createElement)("span", null, " · Temporarily absent from account metadata"), !isExcluded && isLocked ? (0, react.createElement)("span", null, " · Select another model before excluding") : null), (0, react.createElement)("button", {
8011
+ overflowWrap: "anywhere",
8012
+ fontSize: "14px"
8013
+ } }, (0, react.createElement)("strong", null, model.name), (0, react.createElement)("br"), (0, react.createElement)("code", null, model.id), (0, react.createElement)("span", null, !settingsKnown ? " · Exclusion status unknown" : isExcluded ? " · Excluded" : " · Enabled"), model.available ? null : (0, react.createElement)("span", null, " · Temporarily absent from account metadata"), !isExcluded && isLocked ? (0, react.createElement)("span", null, " · Selected by a session or the default. Select another fixed model there before excluding.") : null, errorModel === model.id && error !== void 0 ? (0, react.createElement)("span", {
8014
+ role: "status",
8015
+ style: {
8016
+ display: "block",
8017
+ marginTop: "6px"
8018
+ }
8019
+ }, preferenceMessage(error)) : null), (0, react.createElement)("button", {
7901
8020
  type: "button",
8021
+ style: {
8022
+ ...controlStyle,
8023
+ flexShrink: 0,
8024
+ cursor: disabled ? "not-allowed" : "pointer"
8025
+ },
7902
8026
  disabled,
7903
- onClick: () => void update(model.id, isExcluded),
8027
+ "aria-label": `${isExcluded ? "Restore" : "Exclude"} ${model.name}`,
8028
+ onClick: () => update(model.id, isExcluded),
7904
8029
  title: !isExcluded && isLocked ? "Select another fixed model before excluding this one." : void 0,
7905
8030
  "data-dsh-github-copilot-model-action": isExcluded ? "restore" : "exclude",
7906
8031
  "data-model-id": model.id
@@ -7994,6 +8119,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7994
8119
  if (route !== void 0) owned.route = viewFields(route, ["state", "diagnosticCode"]);
7995
8120
  const accountModels = source.accountModels;
7996
8121
  if (accountModels !== void 0) owned.accountModels = accountModelsSnapshot(accountModels);
8122
+ if (source.modelPreferences !== void 0) {
8123
+ const fields = viewRecord(source.modelPreferences);
8124
+ const next = viewFields(fields, [
8125
+ "state",
8126
+ "writable",
8127
+ "revision",
8128
+ "error"
8129
+ ]);
8130
+ for (const key of [
8131
+ "excludedModelIds",
8132
+ "lockedModelIds",
8133
+ "unavailableExcludedModelIds"
8134
+ ]) next[key] = viewStrings(fields[key]);
8135
+ owned.modelPreferences = next;
8136
+ }
7997
8137
  const parsed = GitHubCopilotAuthorizationViewSchema.safeParse(owned);
7998
8138
  return parsed.success ? parsed.data : void 0;
7999
8139
  } catch {
@@ -8595,14 +8735,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8595
8735
  borderTop: "1px solid color-mix(in srgb, currentColor 18%, transparent)",
8596
8736
  overflowWrap: "anywhere"
8597
8737
  }
8598
- }, (0, react.createElement)("p", { style: {
8599
- margin: "0 0 10px",
8600
- fontSize: "13px"
8601
- } }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, signedIn ? (0, react.createElement)(GitHubCopilotModelPreferencesPanel, {
8738
+ }, signedIn ? (0, react.createElement)(GitHubCopilotModelPreferencesPanel, {
8602
8739
  remote: props.remote,
8603
8740
  models,
8604
8741
  preferences: view?.modelPreferences
8605
- }) : null, models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models }), routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null) : null);
8742
+ }) : null, (0, react.createElement)("details", { style: { marginBlock: "16px" } }, (0, react.createElement)("summary", null, "Discovery details"), (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models })), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null) : null);
8606
8743
  }
8607
8744
  /** Standalone footer presentation; registered Models seats use the shared surface coordinator. */
8608
8745
  function GitHubCopilotPreviewFooter(props) {