dsh-github-copilot 0.4.0-alpha.39 → 0.4.0-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.40 (prepared)
4
+
5
+ - Sanitize authorization failures into allowlisted begin-stage and post-auth route-repair diagnostics in the existing Remote error field; unknown or legacy arbitrary errors remain generic.
6
+ - Stop retaining or logging raw authorization errors, including message, URL, response body, token, device code, and nested cause content; render safe stage-specific next steps.
7
+ - Add regressions for cancellation, successful authorization, route-repair failure, nested causes, secret-bearing errors, arbitrary thrown values, and backward-compatible generic Client behavior (#172).
8
+ - Diagnostics identify only where the flow failed; they do not explain or resolve the underlying OAuth failure.
9
+
3
10
  ## 0.4.0-alpha.39 (prepared)
4
11
 
5
12
  - Qualify the exact official DSH and signed Windows Desktop `0.2.0-rc.2` peer graph; retain rc.1 as historical evidence.
package/README.md CHANGED
@@ -85,7 +85,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
85
85
 
86
86
  ## Install and sign in
87
87
 
88
- The commands below target the package version `0.4.0-alpha.39`. 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):
88
+ The commands below target the package version `0.4.0-alpha.40`. 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.39/dsh-github-copilot-0.4.0-alpha.39.tgz
101
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.40/dsh-github-copilot-0.4.0-alpha.40.tgz
102
102
  ```
103
103
 
104
- For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.39` 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.
104
+ For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.40` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
105
105
 
106
106
  Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in**, and complete the GitHub device-code flow. Plugin installation changes the selected profile; activation follows that profile's normal reload/restart policy.
107
107
 
@@ -110,7 +110,7 @@ Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in*
110
110
  1. Open **Settings → Models** and find **GitHub Copilot**. Account controls appear in an existing configured canonical `github-copilot` card, suppressing the separate footer controller; otherwise the footer fallback (or old-Core **Settings → GitHub Copilot**) remains usable. An already-signed-in account automatically ensures missing/idle/stale/error/loading metadata once on opening; fresh ready metadata makes no discovery request. No native provider or manual refresh is needed for the normal discovery flow.
111
111
  2. Select **Sign in with GitHub**. The authorization area expands automatically with a prominent one-time code, **Open GitHub verification page**, **Copy code**, and **Cancel sign-in**. No extra **Manage** click is needed. Recognized Desktop v1 hosts use their existing same-window external-navigation handoff to the system browser instead of a popup; web hosts retain a new tab. If nothing opens, select and copy the displayed verification address into your browser. The plugin cannot confirm that the system browser opened.
112
112
  3. Copy the code, open the verification link, and complete authorization in your own GitHub browser session. Copy success/failure is announced accessibly; manual copying remains available. Never paste a GitHub token into DSH.
113
- 4. DSH polls only while authorization is in flight. Successful explicit **Start sign-in** (the **Sign in with GitHub** button), including a UI account switch, forces exactly one bounded discovery after immediate or polled success. The code and verification link clear, the automatic authorization area closes, and the account shows **Signed in** and **Manage**. Manually opened details stay open; cancellation clears the old code and errors remain visible.
113
+ 4. DSH polls only while authorization is in flight. Successful explicit **Start sign-in** (the **Sign in with GitHub** button), including a UI account switch, forces exactly one bounded discovery after immediate or polled success. The code and verification link clear, the automatic authorization area closes, and the account shows **Signed in** and **Manage**. Manually opened details stay open; cancellation clears the old code. Failures show only a safe stage diagnostic: `COPILOT_AUTHORIZATION_BEGIN_FAILED` means authorization did not complete; `COPILOT_ROUTE_REPAIR_FAILED` means authorization completed but local route repair failed. The latter retains authentication and directs you to **Manage → Repair model configuration**. These codes do not explain or resolve the underlying sign-in failure; raw provider details are never displayed or logged.
114
114
  5. Choose an accepted model under **GitHub Copilot** (stable route ID `github-copilot-preview`). Normal opening/use maintains metadata without requiring **Refresh models**. **Manage** contains the optional manual refresh, model details and sign-out. The compatibility disclosure is removed; legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation. Errors remain visible with **Retry**, including when details are collapsed; neither discovery nor retry changes your current/default model or replays messages.
115
115
 
116
116
  One shared account-state owner survives transfer while another eligible surface remains mounted. Last-surface unmount or nonoverlapping declaration replacement stops polling; a later mount reads status and separately ensures metadata if needed. Status reads and details toggles themselves remain network-free, but opening Models can discover missing/stale signed-in metadata. Background credential/reset notifications clear Client state and read status rather than forcing discovery on every token event; the next open/use ensures metadata.
@@ -163,7 +163,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
163
163
  5. Confirm **Signed in** and inspect the automatic discovery result before asking the user to choose a model. Already-signed-in Models opening ensures missing/stale metadata automatically; fresh ready cache makes no request. Use visible **Retry** for errors or **Manage → Refresh models** for an intentional forced update, not routine setup. Status alone does not discover, and login, metadata and successful model calls remain separate evidence.
164
164
  6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
165
165
 
166
- GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.39`, 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).
166
+ GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.40`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
167
167
 
168
168
  No `copilot2api` process, external gateway, placeholder API key, pasted GitHub token, or separate `dsh-web-search-provider` installation is required.
169
169
 
@@ -427,8 +427,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
427
427
  `package.json` declares public npm distribution. A release tag must equal `v${package.json.version}`. Versions use standard SemVer prerelease labels (`alpha`, `beta`, or `rc`), each with its matching npm dist-tag; only stable versions use `latest`. The Release workflow performs the frozen install and complete verification gate, packs once (or recovers the original archive on retry), verifies `SHA256SUMS`, publishes the immutable GitHub Release and then publishes those same bytes to npm through OIDC. Either channel failing means delivery is incomplete. First package creation needs an authorized maintainer; staging requires an existing package and is not a first-package bootstrap. Historical releases are not republished.
428
428
 
429
429
  ```sh
430
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.39/dsh-github-copilot-0.4.0-alpha.39.tgz
431
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.39/SHA256SUMS
430
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.40/dsh-github-copilot-0.4.0-alpha.40.tgz
431
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.40/SHA256SUMS
432
432
  sha256sum --check SHA256SUMS
433
433
  ```
434
434
 
@@ -436,7 +436,7 @@ PowerShell can verify the same two downloaded files with:
436
436
 
437
437
  ```powershell
438
438
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
439
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.39.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
439
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.40.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
440
440
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
441
441
  ```
442
442
 
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.39`;这不代表已有的两条真实路由被合并或移除。版本化 URL 不表示 Release 已发布或本机已加载;仅在该 Release 与校验和可用后使用安装命令。源码、发布制品、已安装版本和实际加载运行时需分别确认,本地升级和中断会话的重启仍需用户批准。
12
+ > 下文自动维护账号模型元数据与 provider 集成控件描述目标版本 `0.4.0-alpha.40`;这不代表已有的两条真实路由被合并或移除。版本化 URL 不表示 Release 已发布或本机已加载;仅在该 Release 与校验和可用后使用安装命令。源码、发布制品、已安装版本和实际加载运行时需分别确认,本地升级和中断会话的重启仍需用户批准。
13
13
 
14
14
  Alpha.24 修复 Web search 卡片缺少精确 Remote 依赖声明的问题。卡片仍位于 **Settings → Models**(`settings.models.footer`,list/root),旧 Core 回退到独立 Web search section,而非 General。搜索子 Fiber 独立等待 routing namespace,不影响账号控件和既有搜索安全检查;实际打包 Desktop 验收仍是独立关卡。
15
15
 
@@ -100,10 +100,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
100
100
  仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
101
101
 
102
102
  ```sh
103
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.39/dsh-github-copilot-0.4.0-alpha.39.tgz
103
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.40/dsh-github-copilot-0.4.0-alpha.40.tgz
104
104
  ```
105
105
 
106
- Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.39`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
106
+ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.40`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
107
107
 
108
108
  随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
109
109
 
@@ -112,7 +112,7 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
112
112
  1. 打开 **设置 → 模型**,找到 **GitHub Copilot**。账号控件嵌入已有配置的 canonical `github-copilot` 卡片,不另显示页脚控制器;没有此类卡片时仍可用页脚 fallback(旧 Core 使用 **Settings → GitHub Copilot**)。已登录时,页面打开会自动确保缺失/idle/过期/error/loading的模型元数据就绪;新鲜 ready 缓存不发发现请求。正常流程无需添加原生 provider 或手动刷新。
113
113
  2. 点击 **Sign in with GitHub** 后,验证码区域自动展开,提供醒目的一次性验证码、**Open GitHub verification page**、**Copy code** 和 **Cancel sign-in**。不需要再点一次 **Manage**。识别到 Desktop v1 宿主时,通过现有的同窗口外部导航处理交给系统浏览器,不依赖弹出窗口;网页版仍打开新标签页。如果没有打开,可选中并复制界面显示的验证网址到浏览器。插件无法确认系统浏览器是否已打开。
114
114
  3. 复制验证码,打开验证链接,在自己的 GitHub 浏览器会话中完成授权。复制成功/失败均有可访问的反馈;手工复制仍可用。不要把 GitHub token 粘贴到 DSH。
115
- 4. DSH 只在授权进行中轮询。显式 **Start sign-in**(**Sign in with GitHub** 按钮,包括界面切换账号)成功后,无论立即返回还是轮询观察到成功,都只强制执行一次有界发现。验证码和验证链接清除,自动授权区域收起,账号显示 **Signed in、Manage**。手动打开的详情保持展开;取消清除旧验证码,错误仍明确显示。
115
+ 4. DSH 只在授权进行中轮询。显式 **Start sign-in**(**Sign in with GitHub** 按钮,包括界面切换账号)成功后,无论立即返回还是轮询观察到成功,都只强制执行一次有界发现。验证码和验证链接清除,自动授权区域收起,账号显示 **Signed in、Manage**。手动打开的详情保持展开;取消清除旧验证码。失败仅显示安全的阶段诊断:`COPILOT_AUTHORIZATION_BEGIN_FAILED` 表示授权流程未完成;`COPILOT_ROUTE_REPAIR_FAILED` 表示授权已完成但本地路由修复失败。后者会保留认证,并提示前往 **Manage → Repair model configuration**。这些代码不解释或解决底层登录失败,原始 provider 详情不会显示或记录。
116
116
  5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage** 内保留可选的手动刷新、模型明细与退出登录,移除兼容说明折叠区;需要时仍显示旧配置诊断和显式修复操作,[迁移指南](./docs/single-route-migration.md)继续保留在文档中。错误即使在详情折叠时也会显示并提供 **Retry**;发现或重试均不切换当前/默认模型,也不重放消息。
117
117
 
118
118
  只有另一个符合条件的表面仍挂载时,切换才保留共享账号状态 owner。最后一个表面卸载或声明替换没有挂载重叠时停止轮询;以后挂载会先读状态,再按需另行确保元数据。状态读取和详情切换本身仍不访问网络,但打开 Models 可以发现缺失/过期的已登录账号元数据。后台凭据/reset 通知清除 Client 状态并只读查询,不在每次 token 事件强制发现;下次打开/使用时再确保元数据。
@@ -165,7 +165,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
165
165
  5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
166
166
  6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
167
167
 
168
- 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.39`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
168
+ 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.40`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
169
169
 
170
170
  不需要运行 `copilot2api`,不需要外部 gateway、placeholder API key、原始 GitHub token 或单独安装 `dsh-web-search-provider`。
171
171
 
@@ -438,8 +438,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
438
438
  `package.json` 声明公开 npm 分发。Release tag 必须严格等于 `v${package.json.version}`。预发布使用 `alpha`、`beta` 或 `rc` 及对应 npm dist-tag,只有稳定版使用 `latest`。Release workflow 执行 frozen install 和完整门禁,只打包一次(重试恢复原始归档),验证 `SHA256SUMS`,发布不可变 GitHub Release,再通过 OIDC 将同一份字节发布到 npm。任一渠道失败都表示交付未完成。首次建包须由获准环境中的维护者完成;staging 要求包已存在,不能代替首次建包。不会批量补发历史版本。
439
439
 
440
440
  ```sh
441
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.39/dsh-github-copilot-0.4.0-alpha.39.tgz
442
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.39/SHA256SUMS
441
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.40/dsh-github-copilot-0.4.0-alpha.40.tgz
442
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.40/SHA256SUMS
443
443
  sha256sum --check SHA256SUMS
444
444
  ```
445
445
 
@@ -447,7 +447,7 @@ PowerShell 可以对已下载的同一组文件执行:
447
447
 
448
448
  ```powershell
449
449
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
450
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.39.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
450
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.40.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
451
451
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
452
452
  ```
453
453
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.39"
11
+ "version": "0.4.0-alpha.40"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -705,7 +705,7 @@
705
705
  {"file": "tests/client.spec.ts", "name": "mounts its Remote contribution and registers the rc.1 provider-card seat"},
706
706
  {"file": "tests/authorization-controller.spec.ts", "name": "signs in through the built-in flow without recreating a canonical profile"},
707
707
  {"file": "tests/authorization-controller.spec.ts", "name": "clears the one-time device code immediately when sign-in is cancelled"},
708
- {"file": "tests/authorization-controller.spec.ts", "name": "clears the one-time device code when authorization fails"}
708
+ {"file": "tests/authorization-controller.spec.ts", "name": "reports only the safe begin-stage diagnostic and never logs rejected values"}
709
709
  ]
710
710
  },
711
711
  {
package/lib/client.js CHANGED
@@ -44,6 +44,14 @@ window.__ModuleLoader__.load({
44
44
  discoverModels: "COPILOT_MODEL_DISCOVERY_FAILED",
45
45
  reconcile: "COPILOT_CONFIGURATION_REPAIR_FAILED"
46
46
  };
47
+ const authorizationFailureCodes = /* @__PURE__ */ new Set([
48
+ "COPILOT_AUTHORIZATION_FAILED",
49
+ "COPILOT_AUTHORIZATION_BEGIN_FAILED",
50
+ "COPILOT_ROUTE_REPAIR_FAILED"
51
+ ]);
52
+ function safeAuthorizationFailure(error) {
53
+ return typeof error === "string" && authorizationFailureCodes.has(error) ? error : "COPILOT_AUTHORIZATION_FAILED";
54
+ }
47
55
  /** One mounted account's snapshot, bounded freshness check and explicit actions.
48
56
  * Initial signed-in status ensures missing/idle/stale/error metadata once or
49
57
  * joins loading metadata; the Host owns single flight and failure cooldown.
@@ -100,7 +108,7 @@ window.__ModuleLoader__.load({
100
108
  const accept = (decoded, operation) => {
101
109
  const previousCode = noticeCode();
102
110
  const { accountModels, notices, error, ...rest } = decoded;
103
- const failure = error !== void 0 || decoded.phase === "error" ? "COPILOT_AUTHORIZATION_FAILED" : void 0;
111
+ const failure = error !== void 0 || decoded.phase === "error" ? safeAuthorizationFailure(error) : void 0;
104
112
  const view = {
105
113
  ...rest,
106
114
  notices: decoded.inFlight && !suppressNotice ? notices : [],
@@ -6949,6 +6957,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6949
6957
  "signed-in",
6950
6958
  "error"
6951
6959
  ].includes(owned.phase) || typeof owned.configured !== "boolean" || typeof owned.writable !== "boolean" || typeof owned.inFlight !== "boolean") return void 0;
6960
+ if (owned.error !== void 0 && typeof owned.error !== "string") owned.error = "COPILOT_AUTHORIZATION_FAILED";
6952
6961
  const notices = source.notices;
6953
6962
  if (!Array.isArray(notices)) return void 0;
6954
6963
  owned.notices = notices.map((notice) => {
@@ -7455,6 +7464,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7455
7464
  };
7456
7465
  function compactErrorMessage(code) {
7457
7466
  if (code === "COPILOT_MODEL_DISCOVERY_FAILED") return "Could not refresh models. Try again.";
7467
+ if (code === "COPILOT_AUTHORIZATION_BEGIN_FAILED") return "GitHub sign-in did not complete. Try again. If it continues, share diagnostic code COPILOT_AUTHORIZATION_BEGIN_FAILED with support.";
7468
+ if (code === "COPILOT_ROUTE_REPAIR_FAILED") return "GitHub sign-in completed, but model configuration repair failed. Authentication is retained. Open Manage and choose Repair model configuration. If it continues, share diagnostic code COPILOT_ROUTE_REPAIR_FAILED with support.";
7458
7469
  if (code === "COPILOT_AUTHORIZATION_START_FAILED") return "Could not confirm sign-in. Retry status to check.";
7459
7470
  if (code === "COPILOT_AUTHORIZATION_CANCEL_FAILED") return "Could not confirm cancellation. Retry status to check.";
7460
7471
  if (code === "COPILOT_SIGN_OUT_FAILED") return "Could not confirm sign-out. Retry status to check.";