dsh-github-copilot 0.4.0-alpha.118 → 0.4.0-alpha.120

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.120 (prepared)
4
+
5
+ - Let explicitly account-bound model preparation, native dispatch and subsequent turn steps continue during global selector switching, fixing `COPILOT_ACCOUNTS_BUSY` from the overly broad acquisition fence (#344).
6
+ - Keep unbound/global request fences, credential authorization/removal/sign-out protection, pinned-record leases, cancellation, route checks and original turn accounts. No automatic retry, message replay, fallback account, history rewrite, Core change, installation or restart.
7
+ - Exercise native Responses, Chat Completions and Anthropic dispatch while switch preflight is pending, then verify that the next turn adopts the confirmed new default.
8
+
9
+ ## 0.4.0-alpha.119 (prepared)
10
+
11
+ - Show Models global account metadata before background identity-name hydration, keeping Switch available when metadata and route/activity evidence allow it (#342). Hydration never authorizes a switch and late results cannot undo a confirmed change.
12
+ - Capture the latest parent callback without rebuilding the account card lifetime, avoiding duplicate identity ensures and lost switch responses.
13
+ - Overlap fresh switch identity/model validation under one bounded mutation fence. Both must succeed before CAS; failures cancel and drain sibling work before releasing the fence. Preserve credential identity, membership, route/activity, revision and post-commit checks.
14
+ - Keep Session account/Follows global default ownership, real running turns, native directory transport and account-bound discovery unchanged. No live latency claim, automatic write retry, Core changes, installation or restart.
15
+
3
16
  ## 0.4.0-alpha.118 (prepared)
4
17
 
5
18
  - Reuse confirmed model-preference CAS readback instead of describing all settings a third time for successful Exclude/Restore/High cost saves (#339).
package/README.md CHANGED
@@ -13,6 +13,8 @@ independent official authorizations in the existing credentials service.
13
13
  **Models → Manage → GitHub accounts** manages authorizations and the global default.
14
14
  Inside **Credits**, choose a saved account for this Session's subsequent turns or
15
15
  restore **Follow global default**. Running turns retain their original account.
16
+ Selector-only switching permits their account-bound model preparation and
17
+ dispatch to continue; unbound requests and credential mutations remain fenced.
16
18
  Identity display accepts GitHub Enterprise Managed User names, including their underscore-separated enterprise suffixes.
17
19
 
18
20
  Models and Chat share an opaque, theme-aware account dropdown; translucent native menu tokens cannot reveal underlying controls or quota text. Both use restrained dark elevation in light and dark mode.
@@ -23,7 +25,7 @@ Visible Models and Credits resolve missing names for saved accounts without acti
23
25
 
24
26
  Adding an account now keeps the device-authorization link, selectable URL, one-time code, Copy code action and Cancel together while authorization is pending. After GitHub authorizes, identity and model verification are shown as a separate phase. Adding never changes the global default; use the existing explicit **Switch** action when ready. Technical diagnostics are secondary, and account/turn identity fallbacks never expose opaque account IDs or infer historical identity from today's settings.
25
27
 
26
- **Source candidate: `0.4.0-alpha.118` (unreleased). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. The versioned commands below are for this candidate after publication, not evidence that its assets exist.
28
+ **Source candidate: `0.4.0-alpha.120` (unreleased). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. The versioned commands below are for this candidate after publication, not evidence that its assets exist.
27
29
 
28
30
  ## What you can do
29
31
 
@@ -80,10 +82,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
80
82
  For a **standalone named profile**:
81
83
 
82
84
  ```sh
83
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.118/dsh-github-copilot-0.4.0-alpha.118.tgz
85
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.120/dsh-github-copilot-0.4.0-alpha.120.tgz
84
86
  ```
85
87
 
86
- For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.118` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
88
+ For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.120` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
87
89
 
88
90
  After an approved reload/restart:
89
91
 
@@ -99,6 +101,8 @@ Completed managed turns show **Account** beside native Usage. It records the req
99
101
 
100
102
  Account eligibility reads official rc.2 SettingsForms values, without requiring the retired settings `get()` API. Missing or malformed configuration remains incomplete evidence; upgrading does not bypass native-route or activity restrictions.
101
103
 
104
+ **Global switch waiting:** Models shows metadata first and hydrates identity names independently; background name checks do not lock Switch when route/activity evidence permits it. Fresh identity and model validation overlap, but both must succeed before CAS and strict readback. Failures cancel/drain outstanding preflight without retry; identity-cache display never authorizes switching. The confirmed account result is not discarded when parent callbacks change, and late name reads cannot roll it back. This is separate from Session **Follow global default**, and does not remove necessary network checks or establish live millisecond savings.
105
+
102
106
  `COPILOT_ACCOUNTS_BUSY` is reevaluated from current activity, not retained after work ends. The authorization-in-progress state is presented as progress rather than a terminal busy error; unrelated unknown blockers remain unknown. Use **Refresh account information** to update the open card after relevant work settles. If only the active account is listed, first **Add GitHub account**; **Switch** appears beside another saved account.
103
107
 
104
108
  **Desktop lifecycle:** disable/remove/upgrade can require a full cold restart for Web service recomposition. If the plugin is Off and the native manager reports only `pending (waiting for service: web)`, do not repeatedly toggle or reinstall. Obtain restart approval and follow [rc.2 lifecycle guidance](./docs/web-lifecycle-rc2.md).
@@ -243,14 +247,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
243
247
  GitHub Releases and npm distribute the same original verified tarball. Pin a version; verify Release SHA-256 or npm `dist.integrity`. Never repack an immutable release or move/reuse its tag.
244
248
 
245
249
  ```sh
246
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.118/dsh-github-copilot-0.4.0-alpha.118.tgz
247
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.118/SHA256SUMS
250
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.120/dsh-github-copilot-0.4.0-alpha.120.tgz
251
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.120/SHA256SUMS
248
252
  sha256sum --check SHA256SUMS
249
253
  ```
250
254
 
251
255
  ```powershell
252
256
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
253
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.118.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
257
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.120.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
254
258
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
255
259
  ```
256
260
 
package/README.zh.md CHANGED
@@ -11,6 +11,7 @@
11
11
  [账号需求与技术方案](./docs/copilot-accounts.md)说明如何在现有凭据服务中
12
12
  分别保存独立官方授权。**模型 → Manage → GitHub accounts**管理授权和全局默认;
13
13
  在 Credits 内选择本 Session 后续 turn 的账号,或恢复跟随全局默认;正在运行的 turn 保持原账号。
14
+ 仅切换全局选择期间,已绑定账号的模型准备和发送可以继续;未绑定请求及授权记录变更仍受锁保护。
14
15
  身份展示支持 GitHub 企业托管账号,包括带下划线企业后缀的用户名。
15
16
 
16
17
  Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜单 token 即使半透明,也不会透出底下的按钮或额度文字。明暗主题均使用克制的深色投影,不产生白色光晕。
@@ -21,7 +22,7 @@ Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜
21
22
 
22
23
  添加账号时,设备授权链接、可选择的网址、一次性授权码、复制授权码和取消操作会同时显示。GitHub 授权完成后,会单独显示身份与可用模型验证阶段。添加账号不会更改全局默认;准备好后仍需显式执行现有的**切换**操作。技术诊断收在次级折叠区;账号/历史 turn 缺少身份时不会暴露不透明账号 ID,也不会根据当前设置推断历史身份。
23
24
 
24
- **源码候选版本:`0.4.0-alpha.118`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
25
+ **源码候选版本:`0.4.0-alpha.120`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
25
26
 
26
27
  ## 你可以做什么
27
28
 
@@ -73,10 +74,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
73
74
  **独立具名 profile**:
74
75
 
75
76
  ```sh
76
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.118/dsh-github-copilot-0.4.0-alpha.118.tgz
77
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.120/dsh-github-copilot-0.4.0-alpha.120.tgz
77
78
  ```
78
79
 
79
- **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.118`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
80
+ **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.120`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
80
81
 
81
82
  经批准 reload/restart 后:
82
83
 
@@ -92,6 +93,8 @@ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/release
92
93
 
93
94
  切换资格通过官方 rc.2 SettingsForms 的配置值读取,不再依赖已退役的 Settings `get()` API。缺失或无效配置仍视为证据不完整;升级不会绕过原生路由或运行中工作的限制。
94
95
 
96
+ **全局切换等待:**Models 先显示账号元数据,再独立补齐身份名称;后台名称查询不再锁住满足路由/活动证据条件的 Switch。真正切换仍需新鲜身份和模型校验,两项并行但必须都成功,之后才能 CAS 保存并严格读回。失败会取消并收尾另一项,不自动重试;身份展示缓存不授权切换。父组件更换回调不再丢弃已确认结果,旧名称响应也不能覆盖新账号。这与 Session **Follow global default** 是不同路径,不意味着省略必要网络校验或已测得真实毫秒级提速。
97
+
95
98
  `COPILOT_ACCOUNTS_BUSY` 根据当前活动重新判断,不会在工作结束后保留旧拒绝。授权进行中会显示为进度状态,而不是终止性 busy 错误;其它未知阻塞因素仍明确保持未知。相关工作结束后,点击 **Refresh account information** 更新已打开的卡片。如果只列出活动账号,需先 **Add GitHub account**;另一个已保存账号旁才会出现 **Switch**。
96
99
 
97
100
  **Desktop 生命周期:**停用、移除、升级后的 Web 服务重组可能需要完整冷重启。若插件已 Off,而原生 manager 仅提示 `pending (waiting for service: web)`,不要反复切换或重装。先取得重启许可,遵循[rc.2 生命周期说明](./docs/web-lifecycle-rc2.md)。
@@ -236,14 +239,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
236
239
  GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
237
240
 
238
241
  ```sh
239
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.118/dsh-github-copilot-0.4.0-alpha.118.tgz
240
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.118/SHA256SUMS
242
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.120/dsh-github-copilot-0.4.0-alpha.120.tgz
243
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.120/SHA256SUMS
241
244
  sha256sum --check SHA256SUMS
242
245
  ```
243
246
 
244
247
  ```powershell
245
248
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
246
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.118.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
249
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.120.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
247
250
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
248
251
  ```
249
252
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.118"
11
+ "version": "0.4.0-alpha.120"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -333,6 +333,12 @@
333
333
  {"file": "tests/copilot-usage-card.spec.ts", "name": "retains confirmed following when consent is cancelled and disables it during confirmation"},
334
334
  {"file": "tests/copilot-usage-card.spec.ts", "name": "disables following when the Session selection cannot be read instead of treating it as a fixed account"},
335
335
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "never writes a captured A refresh into B after an external selection change"},
336
+ {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "runs fresh switch identity and model preflight concurrently but commits only after both settle"},
337
+ {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "permits record-bound requests during selector switching without admitting global requests or credential mutations"},
338
+ {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "cancels and drains sibling switch preflight before releasing its mutation fence"},
339
+ {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "rejects a changed credential identity during overlapping switch checks without saving"},
340
+ {"file": "tests/copilot-accounts-card.spec.ts", "name": "renders metadata and permits a confirmed switch while unrelated identity names remain pending"},
341
+ {"file": "tests/copilot-accounts-card.spec.ts", "name": "uses the latest parent callback without resetting a pending switch or repeating initial reads"},
336
342
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "preserves uncertain commit ahead of missing-slot recovery"},
337
343
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "rechecks externally started canonical authorization before selector CAS"},
338
344
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "retains canonical admission through polling and cancellation settlement"},
@@ -10,6 +10,41 @@ publication, installation and loaded runtime state are separate evidence.
10
10
 
11
11
  ## Requirements
12
12
 
13
+ ### Selector switching and account-bound turns (#344)
14
+
15
+ A global switch changes only the selector. Explicit record-bound request leases
16
+ may be acquired during its preflight and CAS so already admitted turns can
17
+ prepare and dispatch their next native step with their frozen account. A new
18
+ turn still captures its account once at admission; it does not adopt a later
19
+ selector. Unbound/global leases remain blocked during switching, and all
20
+ requests remain blocked during credential authorization/removal/sign-out.
21
+ Pinned records cannot be reauthorized or removed until their leases end.
22
+ Cancellation, route eligibility, credential validity and account-model checks
23
+ remain independent. This is not automatic retry or permission to redirect an
24
+ existing turn. Deferred native fixtures exercise all three supported protocols
25
+ while the selector operation is still pending, not just after it settles.
26
+
27
+ ### Global switch responsiveness (#342)
28
+
29
+ Models first reads metadata-only `get()` and separately hydrates display names
30
+ with nonforcing `ensureIdentity()`. Slow inactive-name queries do not hold the
31
+ Switch control. Unknown names remain unknown; route/activity/membership evidence
32
+ still gates controls and the Host independently verifies any requested switch.
33
+ An identity hydration result captured before a mutation or actual Remote/
34
+ authorization/credential lifecycle replacement cannot overwrite newer state.
35
+ Parent callback identity changes alone do not recreate the account lifetime.
36
+
37
+ The Host overlaps fresh identity and available-model preflight under one
38
+ 60-second operation signal. It never replaces fresh verification with the
39
+ ten-minute display cache. Both must finish successfully before selector CAS;
40
+ identity key, membership, route/activity, canonical authorization and revision
41
+ checks remain, including post-commit confirmation. A failed branch aborts the
42
+ other and drains both before releasing the mutation fence, without automatic
43
+ retry or another account fallback. The strict save result updates the account
44
+ card; parent status refresh remains separate. This reduces a serial preflight
45
+ critical path to overlapping work, not zero network latency or proven live
46
+ timing. Synthetic deferred tests establish ordering, not production speed.
47
+
13
48
  - Keep multiple independently authorized GitHub Copilot accounts in one DSH
14
49
  profile. Models retains the global default. Sessions without an override
15
50
  inherit that default at each new turn; explicit Session choices take priority.
package/lib/client.js CHANGED
@@ -9104,6 +9104,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9104
9104
  const managementRemote = props.addOnly ? void 0 : props.remote;
9105
9105
  const [view, setView] = (0, react.useState)();
9106
9106
  const [busy, setBusy] = (0, react.useState)(false);
9107
+ const [identityChecking, setIdentityChecking] = (0, react.useState)(false);
9107
9108
  const [failed, setFailed] = (0, react.useState)(false);
9108
9109
  const [copyState, setCopyState] = (0, react.useState)("idle");
9109
9110
  const [cancelRequested, setCancelRequested] = (0, react.useState)(false);
@@ -9116,6 +9117,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9116
9117
  busy: false,
9117
9118
  copyGeneration: 0
9118
9119
  });
9120
+ const changedCallback = (0, react.useRef)(props.onChanged);
9121
+ changedCallback.current = props.onChanged;
9122
+ const identityRead = (0, react.useRef)();
9119
9123
  const refreshed = (0, react.useRef)(props.refreshKey);
9120
9124
  const text = props.locale?.toLowerCase().startsWith("zh") ? accountCopy.zh : accountCopy.en;
9121
9125
  (0, react.useEffect)(() => {
@@ -9143,7 +9147,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9143
9147
  setAuthorizationIntent(void 0);
9144
9148
  setCancelRequested(false);
9145
9149
  }
9146
- if (next !== void 0 && changed && next.operation === void 0) props.onChanged?.();
9150
+ if (next !== void 0 && changed && next.operation === void 0) changedCallback.current?.();
9151
+ return next;
9147
9152
  } catch {
9148
9153
  if (current()) {
9149
9154
  setView(void 0);
@@ -9158,7 +9163,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9158
9163
  }
9159
9164
  finishChange?.();
9160
9165
  }
9161
- }, [props.onChanged]);
9166
+ }, []);
9167
+ const hydrateIdentity = (0, react.useCallback)(() => {
9168
+ const owner = lifetime.current;
9169
+ if (!owner.active || owner.busy || managementRemote === void 0 || identityRead.current !== void 0) return;
9170
+ const generation = owner.generation;
9171
+ const current = () => owner.active && owner.generation === generation;
9172
+ setIdentityChecking(true);
9173
+ const reading = Promise.resolve().then(async () => {
9174
+ try {
9175
+ if (!current()) return;
9176
+ const result = await managementRemote.ensureIdentity();
9177
+ if (!current()) return;
9178
+ const next = result.ok ? accountsViewFrom(result.value) : void 0;
9179
+ if (next === void 0) {
9180
+ setFailed(true);
9181
+ return;
9182
+ }
9183
+ setView(next);
9184
+ setFailed(false);
9185
+ } catch {
9186
+ if (current()) setFailed(true);
9187
+ }
9188
+ }).finally(() => {
9189
+ if (identityRead.current === reading) {
9190
+ identityRead.current = void 0;
9191
+ setIdentityChecking(false);
9192
+ }
9193
+ });
9194
+ identityRead.current = reading;
9195
+ }, [managementRemote]);
9162
9196
  (0, react.useEffect)(() => {
9163
9197
  const owner = lifetime.current;
9164
9198
  owner.active = true;
@@ -9169,19 +9203,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9169
9203
  setCopyState("idle");
9170
9204
  setCancelRequested(false);
9171
9205
  setAuthorizationIntent(void 0);
9206
+ identityRead.current = void 0;
9207
+ setIdentityChecking(false);
9172
9208
  if (props.remote !== void 0 && !props.authorizationBusy) {
9173
9209
  const remote = props.remote;
9174
- run(() => managementRemote !== void 0 ? managementRemote.ensureIdentity() : remote.get());
9210
+ const generation = owner.generation + 1;
9211
+ run(() => remote.get()).then((next) => {
9212
+ if (owner.active && owner.generation === generation && next !== void 0 && next.operation === void 0) hydrateIdentity();
9213
+ });
9175
9214
  }
9176
9215
  return () => {
9177
9216
  owner.active = false;
9178
9217
  owner.generation++;
9179
9218
  owner.busy = false;
9219
+ identityRead.current = void 0;
9180
9220
  };
9181
9221
  }, [
9182
9222
  props.remote,
9183
9223
  managementRemote,
9184
9224
  run,
9225
+ hydrateIdentity,
9185
9226
  props.authorizationBusy,
9186
9227
  props.configured
9187
9228
  ]);
@@ -9200,7 +9241,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9200
9241
  (0, react.useEffect)(() => {
9201
9242
  if (managementRemote === void 0 || props.authorizationBusy || view?.operation !== void 0) return;
9202
9243
  const ensure = () => {
9203
- if (document.visibilityState !== "hidden") run(() => managementRemote.ensureIdentity());
9244
+ if (document.visibilityState !== "hidden") hydrateIdentity();
9204
9245
  };
9205
9246
  const timer = window.setInterval(ensure, 6e4);
9206
9247
  document.addEventListener("visibilitychange", ensure);
@@ -9212,7 +9253,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9212
9253
  managementRemote,
9213
9254
  props.authorizationBusy,
9214
9255
  view?.operation,
9215
- run
9256
+ hydrateIdentity
9216
9257
  ]);
9217
9258
  (0, react.useEffect)(() => {
9218
9259
  if (view?.operation !== "authorizing" && view?.operation !== "verifying" || props.remote === void 0) return;
@@ -9324,7 +9365,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9324
9365
  role: "status",
9325
9366
  "aria-live": "polite",
9326
9367
  "data-copilot-current-account": ""
9327
- }, identity ?? (busy ? text.identityChecking : text.identityUnavailable)) : null, !props.expanded ? null : (0, react.createElement)("section", {
9368
+ }, identity ?? (busy || identityChecking ? text.identityChecking : text.identityUnavailable)) : null, !props.expanded ? null : (0, react.createElement)("section", {
9328
9369
  "data-copilot-account-management": props.addOnly ? void 0 : true,
9329
9370
  "data-copilot-account-add": props.addOnly ? true : void 0,
9330
9371
  "aria-label": props.addOnly ? text.add : text.accounts,
@@ -9336,13 +9377,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9336
9377
  }, props.addOnly ? null : (0, react.createElement)("h3", { style: {
9337
9378
  margin: 0,
9338
9379
  fontSize: 16
9339
- } }, text.accounts), props.addOnly ? null : (0, react.createElement)("p", { style: muted$1 }, text.scope), props.remote === void 0 ? (0, react.createElement)("p", {
9380
+ } }, text.accounts), props.addOnly ? null : (0, react.createElement)("p", { style: muted$1 }, text.scope), props.addOnly || !identityChecking ? null : (0, react.createElement)("p", {
9381
+ role: "status",
9382
+ "aria-live": "polite",
9383
+ "data-copilot-identity-checking": true,
9384
+ style: muted$1
9385
+ }, text.identityChecking), props.remote === void 0 ? (0, react.createElement)("p", {
9340
9386
  role: "status",
9341
9387
  style: muted$1
9342
9388
  }, text.remoteUnavailable) : null, failed ? (0, react.createElement)("p", {
9343
9389
  role: "alert",
9344
9390
  style: muted$1
9345
- }, text.readFailed) : null, view?.state === "error" && view.operation === void 0 && view.diagnostic !== void 0 ? (0, react.createElement)("p", {
9391
+ }, view === void 0 ? text.readFailed : text.identityFailed) : null, view?.state === "error" && view.operation === void 0 && view.diagnostic !== void 0 ? (0, react.createElement)("p", {
9346
9392
  role: "alert",
9347
9393
  style: muted$1
9348
9394
  }, accountProblemMessage(view.diagnostic, text)) : null, switchBlocker === void 0 ? null : (0, react.createElement)("p", {