dsh-github-copilot 0.4.0-alpha.103 → 0.4.0-alpha.105

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
@@ -47,9 +47,13 @@ This repository owns eleven narrow surfaces:
47
47
 
48
48
  ## Approved multi-account ownership extension (#297)
49
49
 
50
+ Identity presentation uses additive `ensureIdentity` Remotes, including explicit-Agent Session lookup. Keep `get` metadata-only; visible surfaces may ensure on their sixty-second cadence. Fresh ten-minute cache avoids requests, same-account consumers join a bounded flight, and failures cool down thirty seconds unless explicitly refreshed. Credential notifications revoke pending work even when token bytes are unchanged; no late cache publication. Quota may settle independently only with account-coherent metadata. Presentation cache never replaces fresh identity validation for switch, reauthorization or duplicate checks. Preserve strict sanitized diagnostics and Session/turn ownership (#309).
51
+
50
52
  The user approved independently authorized account records in the existing DSH credentials service. The canonical `llm-pi-ai/github-copilot` record remains unchanged as the compatibility account. Additional plugin-owned `github-copilot/account-<opaque-id>` records must be written directly by official pi-ai OAuth through public account-bound stores; never copy/move grants, refill the canonical record, introduce a separate credential storage service, patch Core, or implement another wire/catalog. Native `Models.getAuth()` and DSH `modifyRecord()` remain the refresh and serialization owners.
51
53
 
52
- Only an opaque active account selector belongs in Settings. Capture one immutable account binding across each operation's reads, refreshes and writes. Missing/invalid selectors or records fail explicitly, without another-account fallback. Switching requires managed-only route evidence, target validation, activity fencing, path-level CAS and readback; preserve history, defaults, explicit selections, native retries and Usage. Models is the only management/switching surface; Credits identity is read-only. See [the requirements and acceptance gates](./docs/copilot-accounts.md). This narrow extension changes account addressing, not the plugin-only implementation boundary.
54
+ Settings store only the opaque global account selector and explicit `sessionAccounts` rows. Missing/invalid selectors or records fail explicitly, without another-account fallback. Models alone manages authorizations and the global default; Credits may select an already authorized account for this Session's subsequent turns or restore global inheritance (#305). An explicit choice equal to the default remains explicit. Freeze account ownership before Auto assessment and request admission, holding mutation fences until native `turn/end`/disposal; later Session/default changes never redirect running steps, retries or search. Account-local credentials, metadata, quota, proof cancellation and native adapter composition must remain isolated. Keep one public adapter/controller registration, with no second wire/catalog or Core changes. Reauthorization/removal of a pinned record stays blocked; global-default selection may continue independently.
55
+
56
+ Use hidden volatile `sessionAccounts` with path-level SettingsForms CAS, readback and restart evidence. Session account Remotes use explicit viewed IDs, native Agent lookup and strict codecs, never automatic Client scope. Credits uses that Session's account for identity/quota, rejecting mismatched or late results. Historical Account is an additive assistant-actions disclosure beside native Usage, captured only after a real ordinary native chunk; bounded Host-lifetime evidence becomes unknown after restart/eviction and is never reconstructed from today's settings. No new durable events, history/default/model/Usage writes, automatic account fallback, replay deletion or message retry. See [the requirements and acceptance gates](./docs/copilot-accounts.md).
53
57
 
54
58
  ## Retired model-role compatibility boundary (#158)
55
59
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.105 (prepared)
4
+
5
+ - Renew expired account identity from visible Models and Credits through nonforcing, account-scoped ensure reads. Fresh ten-minute cache avoids requests; concurrent consumers share one bounded request and failed renewals retain a thirty-second cooldown (#309).
6
+ - Revoke pending identity on credential changes, selection changes and disposal, rejecting late results even when credentials retain the same bytes. Explicit account switching/reauthorization still validates fresh identity.
7
+ - Settle account-coherent Credits independently of slow identity renewal. Preserve Session account choices, running-turn pins, quota freshness semantics and metadata-only status reads.
8
+ - Add strict additive global/Session ensure Remotes and sanitized timeout, TLS, network, authentication, rate-limit and HTTP diagnostics. No authenticated provider calls, installation or restart are implied by synthetic evidence.
9
+
10
+ ## 0.4.0-alpha.104 (prepared)
11
+
12
+ - Select an already authorized account inside Credits for this Session's subsequent turns, or follow the Models global default. Explicit same-as-default choices remain overrides; running turns keep their frozen account (#305).
13
+ - Isolate managed account metadata, OAuth resolution, Auto assessment, request recovery, quota and search proofs through the published native adapter. Default or Session preference changes do not redirect running steps, retries or search; pinned accounts remain protected from reauthorization/removal.
14
+ - Add Account beside native turn Usage using captured ordinary-request evidence. This bounded Host-lifetime evidence becomes unknown after restart or eviction; no durable events, history changes, inferred billing receipts or subagent totals.
15
+ - Persist only opaque Session preferences through native path-level SettingsForms CAS. Reuse existing Credits/turn popover styles and explicit Session lookup with separate strict Remotes; preserve native account compatibility and credential ownership.
16
+
3
17
  ## 0.4.0-alpha.103 (prepared)
4
18
 
5
19
  - Reevaluate transient account BUSY failures from current leases, authorization and managed Agent activity on status reads instead of retaining a stale rejection after work ends (#303).
package/README.md CHANGED
@@ -6,15 +6,18 @@
6
6
 
7
7
  **English** | [简体中文](./README.zh.md)
8
8
 
9
- GitHub Copilot account discovery, contextual Auto routing and hosted search for DSH. The plugin reuses DSH's published native adapter with one active Host-side OAuth account per profile; it does not patch Core or maintain a second model catalog.
9
+ GitHub Copilot account discovery, contextual Auto routing and hosted search for DSH. The plugin reuses DSH's published native adapter, retaining a profile-wide account default with independent Session next-turn choices; it does not patch Core or maintain a second model catalog.
10
10
 
11
11
  The [account requirements and design](./docs/copilot-accounts.md) cover
12
12
  independent official authorizations in the existing credentials service.
13
- **Models → Manage → GitHub accounts** is the only management/switching entry;
14
- Credits details show the current GitHub identity read-only.
13
+ **Models → Manage → GitHub accounts** manages authorizations and the global default.
14
+ Inside **Credits**, choose a saved account for this Session's subsequent turns or
15
+ restore **Follow global default**. Running turns retain their original account.
15
16
  Identity display accepts GitHub Enterprise Managed User names, including their underscore-separated enterprise suffixes.
16
17
 
17
- **Source candidate: `0.4.0-alpha.103` (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.
18
+ Visible Models and Credits renew expired identity without forcing fresh reads on every mount: ten-minute identity cache, shared per-account requests and a thirty-second failure cooldown. Explicit refresh retries immediately; quota can settle while identity renews. Unknown or revoked identity is never shown as current, and Session account isolation is unchanged. See [account lifecycle](./docs/copilot-accounts.md).
19
+
20
+ **Source candidate: `0.4.0-alpha.105` (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.
18
21
 
19
22
  ## What you can do
20
23
 
@@ -22,6 +25,7 @@ Identity display accepts GitHub Enterprise Managed User names, including their u
22
25
  |---|---|
23
26
  | Sign in and manage account models | **Settings → Models → GitHub Copilot → Sign in** |
24
27
  | Add or switch GitHub accounts | **Manage → GitHub accounts**; managed-only profiles |
28
+ | Select this Session's next-turn account | **Credits → Switch account**; saved authorizations only |
25
29
  | Exclude or restore individual models | **Manage → Model preferences** |
26
30
  | Choose models automatically | Pick **Auto · Balance**, **Auto · Efficiency** or **Auto · Intelligence** |
27
31
  | Follow a parent model in supported subagents | **Plugins → dsh-github-copilot → Details → Follow parent model** |
@@ -30,7 +34,13 @@ Identity display accepts GitHub Enterprise Managed User names, including their u
30
34
 
31
35
  ![Account controls and model preferences from the published Client](./docs/images/copilot-model-preferences.png)
32
36
 
33
- Actual published Client components with synthetic models in an isolated browser. These screenshots demonstrate presentation, not live sign-in, model availability, search or loaded Desktop state.
37
+ Actual published Client components with synthetic models in an isolated browser. This screenshot demonstrates presentation, not live sign-in, model availability, search or loaded Desktop state.
38
+
39
+ ![Switching between saved GitHub accounts in Models](./docs/images/copilot-accounts.png)
40
+
41
+ ![Read-only current GitHub identity in Credits](./docs/images/copilot-accounts-credits.png)
42
+
43
+ The account images show the earlier account-management components with synthetic accounts and quota in an isolated browser. The current Session switcher is inside Credits; these images show account management and identity presentation, not real authorization, supplier availability, live account data or loaded Desktop state.
34
44
 
35
45
  ## Install and sign in
36
46
 
@@ -47,10 +57,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
47
57
  For a **standalone named profile**:
48
58
 
49
59
  ```sh
50
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.103/dsh-github-copilot-0.4.0-alpha.103.tgz
60
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/dsh-github-copilot-0.4.0-alpha.105.tgz
51
61
  ```
52
62
 
53
- For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.103` 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.
63
+ For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.105` 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.
54
64
 
55
65
  After an approved reload/restart:
56
66
 
@@ -60,7 +70,9 @@ After an approved reload/restart:
60
70
 
61
71
  Sign-out requires an explicit action and removes only the active account's authorization, not other saved grants or route settings. Upgrades preserve existing native Copilot profiles; two groups can remain until [explicit single-route migration](./docs/single-route-migration.md). Installation never migrates conversations or defaults.
62
72
 
63
- In **Manage → GitHub accounts**, adding an account never replaces the active one. A confirmed switch applies profile-wide to subsequent managed requests; relevant active work and native-route or incomplete evidence block it. The new account may not offer your selected model, and old encrypted replay may be account-bound: no automatic model substitution or history removal occurs. **Reauthorize** renews the same saved identity; **Remove** deletes only an inactive saved authorization. Missing/revoked accounts never fall back to another account.
73
+ In **Manage → GitHub accounts**, adding an account never replaces the global default. A confirmed switch changes future inherited turns, not running turns or explicit Session overrides. **Credits → Switch account** persists a choice only for this Session's subsequent turns; **Follow global default** clears it. Explicitly choosing today's default still remains a Session override. Native-route or incomplete evidence blocks account switching. The new account may not offer your selected model, and old encrypted replay may be account-bound: no automatic model substitution or history removal occurs. **Reauthorize** renews the same saved identity; **Remove** deletes only an inactive saved authorization and cannot mutate a running turn's pinned account. Missing/revoked accounts never fall back.
74
+
75
+ Completed managed turns show **Account** beside native Usage. It records the request account, not billing or subagent totals. Evidence is bounded to the Host lifetime; restart, cold history or missing delivery displays unknown, never reconstructed from the current picker/default.
64
76
 
65
77
  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.
66
78
 
@@ -194,14 +206,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
194
206
  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.
195
207
 
196
208
  ```sh
197
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.103/dsh-github-copilot-0.4.0-alpha.103.tgz
198
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.103/SHA256SUMS
209
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/dsh-github-copilot-0.4.0-alpha.105.tgz
210
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/SHA256SUMS
199
211
  sha256sum --check SHA256SUMS
200
212
  ```
201
213
 
202
214
  ```powershell
203
215
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
204
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.103.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
216
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.105.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
205
217
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
206
218
  ```
207
219
 
package/README.zh.md CHANGED
@@ -6,14 +6,16 @@
6
6
 
7
7
  [English](./README.md) | **简体中文**
8
8
 
9
- 为 DSH 提供 GitHub Copilot 账号模型发现、上下文 Auto 选模和 hosted search。插件复用 DSH 公开的原生适配器,每个 profile 同时使用一个 Host 端活动 OAuth 账号,不修改 Core,也不维护第二套模型目录。
9
+ 为 DSH 提供 GitHub Copilot 账号模型发现、上下文 Auto 选模和 hosted search。插件复用 DSH 公开的原生适配器,保留 profile 全局默认账号,并支持 Session 后续 turn 指定独立账号;不修改 Core,也不维护第二套模型目录。
10
10
 
11
11
  [账号需求与技术方案](./docs/copilot-accounts.md)说明如何在现有凭据服务中
12
- 分别保存独立官方授权。**模型 → Manage → GitHub accounts**是唯一管理/
13
- 切换入口;Credits 详情只读展示当前 GitHub 身份。
12
+ 分别保存独立官方授权。**模型 → Manage → GitHub accounts**管理授权和全局默认;
13
+ 在 Credits 内选择本 Session 后续 turn 的账号,或恢复跟随全局默认;正在运行的 turn 保持原账号。
14
14
  身份展示支持 GitHub 企业托管账号,包括带下划线企业后缀的用户名。
15
15
 
16
- **源码候选版本:`0.4.0-alpha.103`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
16
+ 可见的 Models 和 Credits 会续期已过期身份,不会在每次挂载时强制请求:身份缓存十分钟,同账号共享请求,失败冷却三十秒。显式刷新可立即重试;额度可先于身份续期完成展示。未知或已撤销身份不会作为当前用户名展示,Session 账号隔离保持不变。参见[账号生命周期](./docs/copilot-accounts.md)。
17
+
18
+ **源码候选版本:`0.4.0-alpha.105`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
17
19
 
18
20
  ## 你可以做什么
19
21
 
@@ -21,6 +23,7 @@
21
23
  |---|---|
22
24
  | 登录并管理账号模型 | **设置 → 模型 → GitHub Copilot → Sign in** |
23
25
  | 添加/切换 GitHub 账号 | **Manage → GitHub accounts**;仅限托管路由 profile |
26
+ | 指定本 Session 后续 turn 的账号 | **Credits → Switch account**;仅选择已保存授权 |
24
27
  | 排除/恢复单个模型 | **Manage → Model preferences** |
25
28
  | 自动选择模型 | 选择 **Auto · Balance / Efficiency / Intelligence** |
26
29
  | 让受支持子代理跟随父模型 | **插件 → dsh-github-copilot → 详情 → Follow parent model** |
@@ -31,6 +34,12 @@
31
34
 
32
35
  图片来自实际已发布 Client 组件和隔离浏览器中的模拟模型,仅说明界面,不证明真实登录、模型可用性、搜索或 Desktop 已加载。
33
36
 
37
+ ![在 Models 中切换已保存的 GitHub 账号](./docs/images/copilot-accounts.png)
38
+
39
+ ![Credits 中只读展示当前 GitHub 身份](./docs/images/copilot-accounts-credits.png)
40
+
41
+ 账号图片来自较早的账号管理组件和隔离浏览器中的模拟账号及额度。当前 Session 切换入口位于 Credits 内;这些图片仅说明账号管理与身份展示,不证明真实授权、供应方可用性、真实账号数据或 Desktop 已加载。
42
+
34
43
  ## 安装与登录
35
44
 
36
45
  使用已校验的固定版本、指定 profile 和获准的包源。不需要 `copilot2api`、外部网关、手工粘贴 GitHub token、占位 key 或另装 `dsh-web-search-provider`。
@@ -46,10 +55,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
46
55
  **独立具名 profile**:
47
56
 
48
57
  ```sh
49
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.103/dsh-github-copilot-0.4.0-alpha.103.tgz
58
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/dsh-github-copilot-0.4.0-alpha.105.tgz
50
59
  ```
51
60
 
52
- **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.103`。官方 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 或删除配置。
61
+ **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.105`。官方 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 或删除配置。
53
62
 
54
63
  经批准 reload/restart 后:
55
64
 
@@ -59,7 +68,9 @@ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/release
59
68
 
60
69
  退出须显式操作,只删除活动账号的授权,保留其它授权与路由设置。升级保留已有原生 Copilot profile;在[显式单路由迁移](./docs/single-route-migration.md)前,仍可能存在两个分组。安装不迁移会话或默认模型。
61
70
 
62
- 在 **Manage → GitHub accounts**添加账号不会替换活动账号。确认切换后,当前 profile 的后续托管请求使用新账号;相关工作仍在运行、原生路由尚存或证据不完整时会阻止切换。新账号可能没有已选模型,旧加密 replay 也可能绑定原账号;不会自动替换模型或删除历史。**Reauthorize**仅更新同一已存身份的授权;**Remove**仅删除非活动授权。账号缺失/失效不会自动回退到其它账号。
71
+ 在 **Manage → GitHub accounts**添加账号不会替换全局默认。确认切换只影响后续跟随默认的 turn,不影响正在运行的 turn 或 Session 已指定账号。**Credits → 切换账号**只为本 Session 后续 turn 保存选择;**跟随全局默认**清除该选择。即使显式选中的账号恰好等于全局默认,也仍是 Session 覆盖。原生路由尚存或证据不完整时会阻止账号切换。新账号可能没有已选模型,旧加密 replay 也可能绑定原账号;不会自动替换模型或删除历史。**Reauthorize**仅更新同一已存身份的授权;**Remove**仅删除非全局活动授权,正在运行 turn 锁定的授权不能修改。账号缺失/失效不会自动回退到其它账号。
72
+
73
+ 已完成的托管 turn 在原生 Usage 旁显示 **Account**,记录实际请求账号,不是计费归因或子 Agent 汇总。证据仅在 Host 生命周期内有界保留;重启、冷历史或没有原生流返回时显示未知,不从当前选择或全局默认反推历史。
63
74
 
64
75
  切换资格通过官方 rc.2 SettingsForms 的配置值读取,不再依赖已退役的 Settings `get()` API。缺失或无效配置仍视为证据不完整;升级不会绕过原生路由或运行中工作的限制。
65
76
 
@@ -193,14 +204,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
193
204
  GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
194
205
 
195
206
  ```sh
196
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.103/dsh-github-copilot-0.4.0-alpha.103.tgz
197
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.103/SHA256SUMS
207
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/dsh-github-copilot-0.4.0-alpha.105.tgz
208
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/SHA256SUMS
198
209
  sha256sum --check SHA256SUMS
199
210
  ```
200
211
 
201
212
  ```powershell
202
213
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
203
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.103.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
214
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.105.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
204
215
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
205
216
  ```
206
217
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.103"
11
+ "version": "0.4.0-alpha.105"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -288,12 +288,34 @@
288
288
  ]
289
289
  },
290
290
  "capabilities": [
291
+ {
292
+ "id": "copilot-session-accounts",
293
+ "required": true,
294
+ "evidenceScope": "synthetic-turn-routing-native-gateways-settings-persistence-and-ui-not-live-account-access",
295
+ "activation": "managed-only-explicit-session-choice-or-global-default",
296
+ "sourceMarkers": [
297
+ {"file": "src/session-accounts-host.ts", "marker": "class SessionAccountsHost"},
298
+ {"file": "src/session-accounts-controller.ts", "marker": "extends TypertRemoteService"},
299
+ {"file": "src/session-accounts-remote.ts", "marker": "githubCopilotSessionAccount"},
300
+ {"file": "src/config.ts", "marker": "sessionAccounts:"},
301
+ {"file": "src/remote.ts", "marker": "...sessionAccountsRemote.descriptors"},
302
+ {"file": "AGENTS.md", "marker": "Historical Account is an additive assistant-actions disclosure"}
303
+ ],
304
+ "tests": [
305
+ {"file": "tests/session-accounts.spec.ts", "name": "freezes each turn across preference changes, steps and retries"},
306
+ {"file": "tests/session-accounts-host.spec.ts", "name": "holds account mutation fencing through abort until the actual turn boundary"},
307
+ {"file": "tests/copilot-usage-card.spec.ts", "name": "switches only subsequent Session turns inside Credits and can restore inheritance"},
308
+ {"file": "tests/fixtures/remote-core.fixture.ts", "name": "binds Session account choices and historical reads through native Client and %s Host gateways"},
309
+ {"file": "tests/fixtures/copilot-accounts-persistence-core.fixture.ts", "name": "persists independent native credentials and SettingsForms CAS across profile restart without cross-account OAuth writes"}
310
+ ]
311
+ },
291
312
  {
292
313
  "id": "independent-copilot-accounts",
293
314
  "required": true,
294
315
  "evidenceScope": "synthetic-public-services-native-adapter-and-ui-not-live-oauth-or-provider-access",
295
316
  "activation": "managed-only-explicit-account-selector",
296
317
  "sourceMarkers": [
318
+ {"file": "src/copilot-accounts-host.ts", "marker": "async ensureIdentityFor(accountId: string)"},
297
319
  {"file": "AGENTS.md", "marker": "Approved multi-account ownership extension (#297)"},
298
320
  {"file": "src/remote.ts", "marker": "...copilotAccountsRemote.descriptors"},
299
321
  {"file": "src/copilot-accounts-card.ts", "marker": "removeAccount(accountId: string, expectedRevision: number)"},
@@ -301,6 +323,8 @@
301
323
  {"file": "docs/copilot-accounts.md", "marker": "A mutable active-account lookup inside each store method is forbidden"}
302
324
  ],
303
325
  "tests": [
326
+ {"file": "tests/copilot-identity-refresh.spec.ts", "name": "renews expired identity once for account %s without changing metadata-only reads"},
327
+ {"file": "tests/copilot-usage-card.spec.ts", "name": "settles quota before a slow identity renewal and uses nonforcing ensure on visible refresh cadence"},
304
328
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "never writes a captured A refresh into B after an external selection change"},
305
329
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "preserves uncertain commit ahead of missing-slot recovery"},
306
330
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "rechecks externally started canonical authorization before selector CAS"},
@@ -3,19 +3,19 @@
3
3
  ## Delivery status
4
4
 
5
5
  This document records the approved requirements and implementation design for
6
- issue #297. Multi-account behavior is not released or installed until the
6
+ issues #297 and #305. Candidate behavior is not released or installed until the
7
7
  acceptance gates below complete. The existing single-account behavior remains
8
- the compatibility baseline. The current source candidate is `0.4.0-alpha.103`;
8
+ the compatibility baseline. The current source candidate is `0.4.0-alpha.104`;
9
9
  publication, installation and loaded runtime state are separate evidence.
10
10
 
11
11
  ## Requirements
12
12
 
13
13
  - Keep multiple independently authorized GitHub Copilot accounts in one DSH
14
- profile. Exactly one account is active for subsequent managed Copilot work.
15
- This is not per-Session simultaneous account routing.
16
- - Models is the only account management and switching surface. Existing Credits
17
- details show the current GitHub identity read-only; do not add a Chat switcher
18
- or replace the DSH application identity.
14
+ profile. Models retains the global default. Sessions without an override
15
+ inherit that default at each new turn; explicit Session choices take priority.
16
+ - Models alone manages authorizations. A low-frequency account selector inside
17
+ existing Credits applies to this Session's subsequent turns. No standalone
18
+ composer selector, one-turn override or DSH application identity replacement.
19
19
  - Persist OAuth grants through the existing DSH credentials service. Use
20
20
  official pi-ai login, refresh and transport, not copied credentials, a token
21
21
  backup/refill scheme, a separate credential store, a second wire or Core edits.
@@ -25,8 +25,10 @@ publication, installation and loaded runtime state are separate evidence.
25
25
  - Changing the account must not change Session histories, selected models,
26
26
  future global defaults, model exclusions or billing/Usage records. A selected
27
27
  model unavailable to the new account fails explicitly, without substitution.
28
- - Block switches while relevant operations are admitted. Never cancel a running
29
- answer automatically. Explain that encrypted historical replay can be
28
+ - Freeze an admitted turn's account before Auto assessment. Later Session/global
29
+ choices do not redirect its steps, native retries or hosted search. Block
30
+ reauthorization/removal of its pinned record until native turn end/disposal.
31
+ Never cancel a running answer automatically. Explain that encrypted historical replay can be
30
32
  account-bound; do not silently remove replay or replay a message.
31
33
  - No automatic fallback to another account on quota exhaustion, authorization
32
34
  failure, missing records or invalid settings.
@@ -79,17 +81,20 @@ single-record policy:
79
81
 
80
82
  ## Account binding and persistence
81
83
 
82
- Settings contain only an opaque active account identifier, written with a
84
+ Settings contain an opaque global active account identifier, written with a
83
85
  path-level compare-and-swap in the existing `github-copilot` namespace. An
84
86
  absent selector means the canonical compatibility account. An invalid selector
85
87
  or missing selected record is an error, not permission to use canonical.
86
88
  There is no persisted membership list: native `credentials.listRecords()`
87
89
  enumerates record keys and kinds, while public identity stays in bounded
88
90
  Host-memory cache. No usernames, grants or auxiliary account list are stored
89
- in Settings.
91
+ in Settings. Hidden volatile `sessionAccounts` additionally persists bounded
92
+ `{sessionId, accountId}` overrides, changed through a separate path-level CAS.
93
+ Selecting the same account as the default is still an explicit override.
94
+ Choosing **Follow global default** removes only this Session's row.
90
95
 
91
96
  A request captures an immutable account identifier, record key and selection
92
- generation. Its `CredentialStore.read/modify/delete` methods all refer to that
97
+ ownership. Its `CredentialStore.read/modify/delete` methods all refer to that
93
98
  record. A mutable active-account lookup inside each store method is forbidden:
94
99
  an A refresh must never commit into B after a switch.
95
100
 
@@ -130,11 +135,12 @@ eligibility override.
130
135
  1. Capture the selector revision and verify managed-only route eligibility.
131
136
  2. Validate target identity, refresh authorization as needed and check account
132
137
  model metadata without publishing it as the active account.
133
- 3. Refuse if an operation is active; hold an admission fence during commit so
134
- a new operation cannot race the final activity check.
138
+ 3. Hold an admission fence during commit. Existing account-pinned managed
139
+ turns may continue; unbound legacy preparation remains conservatively fenced.
135
140
  4. CAS the selector, read back committed settings and confirm target evidence.
136
- 5. Revoke old model, Auto, search, quota, identity and recovery evidence and
137
- update the directory and UI without model/history/default writes.
141
+ 5. Update the default directory and UI without revoking another account's
142
+ running turn/proofs or writing model/history/default selection. Credential
143
+ replacement revokes only the matching account runtime and search/quota proof.
138
144
 
139
145
  `COPILOT_ACCOUNTS_BUSY` is transient: each account status read reevaluates
140
146
  current managed Agent activity, operation leases and authorization. A rejected
@@ -155,8 +161,9 @@ native auth refresh, managed answer streams and hosted search. Release leases
155
161
  on completion, failure, cancellation and disposal. Switching never terminates
156
162
  native retries, rewrites native retry policy or manufactures Usage.
157
163
  An abandoned signal-free prepared call has no public completion/cancellation
158
- evidence; it conservatively retains its barrier until disposal. A guessed idle
159
- timeout must not permit switching under potentially live work.
164
+ evidence; it conservatively retains its account mutation barrier until disposal.
165
+ Changing the global default can still proceed without redirecting that call.
166
+ A guessed idle timeout must not permit reauthorization/removal of its account.
160
167
 
161
168
  ## Route compatibility
162
169
 
@@ -193,15 +200,28 @@ These images render the actual candidate components with synthetic accounts
193
200
  and quota in an isolated browser. They are not real authorization, supplier
194
201
  availability or loaded Desktop evidence.
195
202
 
196
- The separate `githubCopilotAccounts` namespace exposes `get`,
203
+ The separate `githubCopilotAccounts` namespace exposes `get`, `ensureIdentity`,
197
204
  `refreshIdentity`, `add`, `cancel`, `switchAccount`, `reauthorize` and
198
205
  `removeAccount`. Existing Remote descriptors are retained. The removal method
199
206
  cannot be named `remove`: official rc.2 reserves that inherited service name
200
207
  and rejects the entire Client contribution.
201
208
 
202
- Credits shows only the current identity under the title. No account selector,
203
- Add, sign-out or switching action appears in Chat. Unknown identity is
204
- unavailable, not a stale username presented as current.
209
+ Credits shows the Session's next-turn account and quota under the existing title.
210
+ Its **Switch account** disclosure lists saved authorizations and **Follow global
211
+ default**. No Add, reauthorization or sign-out action appears in Chat. Changing
212
+ the preference while a turn runs leaves that turn's old account pinned; the
213
+ popover identifies it separately. Other Sessions are unchanged. Unknown identity
214
+ is unavailable, not a stale username presented as current.
215
+
216
+ Completed managed turns have a compact **Account** disclosure alongside native
217
+ Usage/selection actions through the public assistant-actions slot. This is
218
+ request-account evidence, not billing attribution or a subagent account rollup.
219
+ It captures an optional cached identity on the first real ordinary native chunk,
220
+ not discovery, preparation or auxiliary Auto assessment. Host memory retains at
221
+ most 64 Sessions and 128 turns per Session. Restart, cold history, eviction or a
222
+ request with no native delivery is unknown. Failed reads are distinct from
223
+ unknown evidence; Retry rereads the same turn without inference. Official rc.2
224
+ has no ignorable account-history event seam: no new durable event is emitted.
205
225
 
206
226
  Identity and quota have separate error states but must share account evidence.
207
227
  Models account mutations invalidate mounted Credits presentation before the
@@ -211,8 +231,26 @@ identity, grants or quota between surfaces. Failed reads never restore the
211
231
  previous username as current.
212
232
  Missing quota is not zero; pooled, stale, request-based and credit-based
213
233
  snapshots retain their distinct meanings. Do not claim cross-app aggregation
214
- or relabel request counts as AI credits. No new periodic account network poll
215
- or inference is introduced.
234
+ or relabel request counts as AI credits.
235
+
236
+ Visible Models and Credits surfaces ensure identity on mount, visibility return
237
+ and their sixty-second display cadence. `get` and `viewForAccount` remain
238
+ metadata-only. Nonforcing ensure reuses a fresh ten-minute identity, joins
239
+ same-account in-flight work and observes a thirty-second failure cooldown;
240
+ explicit **Refresh account information** bypasses cooldown but joins active
241
+ work. There is no render-driven request loop or background polling after
242
+ unmount. Credential changes revoke identity and pending work; cancelled or
243
+ expired identity is never shown as current. Session ensure retains explicit
244
+ Agent lookup and rechecks account selection before returning.
245
+
246
+ Quota settles independently of identity renewal only after account-coherent
247
+ metadata checks. Identity failures cannot turn account quota into zero or
248
+ discard an otherwise valid same-account reading. Sanitized diagnostics separate
249
+ timeout, certificate, network, auth rejection, rate limiting and other HTTP
250
+ failures; no raw response/error text or credentials enter the Remote. These
251
+ diagnostics do not establish the cause of earlier screenshots or prove live
252
+ supplier health. Account switching, duplicate checks and reauthorization still
253
+ require fresh authenticated identity validation, not the presentation cache.
216
254
 
217
255
  ## Acceptance gates
218
256
 
@@ -228,7 +266,9 @@ or inference is introduced.
228
266
  - Behavior: absent-selector compatibility, missing-selector fail-closed,
229
267
  duplicate identity, same-account renewal, canonical route blocker, selected
230
268
  model missing, revoked permissions and account-bound replay.
231
- - UI: Models-only switching, readonly Credits identity, dark/light/mobile,
269
+ - UI: Models global-default management, Session switching only inside Credits,
270
+ global inheritance/explicit same-value override, frozen running turns,
271
+ historical Account/unknown/read-error distinctions, dark/light/mobile,
232
272
  keyboard interaction, loading/error states and no overlapping controllers.
233
273
  - No native Usage filtering, history edits, default selection changes or
234
274
  automatic model/account substitution.
@@ -247,7 +287,7 @@ The temporary-profile persistence fixture uses native `LocalCredentialProvider`,
247
287
  profile boot/Loader, ConfigEditor, SettingsForms CAS, authorization and SDK.
248
288
  Independent grants and the selector survive disposal/reopen; stale CAS does
249
289
  not replace the config fiber; account A refresh never writes B. It injects
250
- route/Session eligibility and model preflight, and mocks identity/provider
290
+ model preflight, and mocks identity/provider
251
291
  HTTP. It is not full production lifecycle or live OAuth qualification.
252
292
 
253
293
  The local frozen install and full gate are blocked by HTTP 404s for unchanged
@@ -15,9 +15,11 @@ The control is an additive `conversation.composer.dock` contribution for the cur
15
15
  The compact control shows reported usage and remaining allocation where available. Its details explain the unit, budget, reset timestamp, freshness and unavailable data. Legacy premium requests must never be relabeled AI credits. A pooled organization account can have absolute credits used without a personal denominator; it does not imply unlimited use or expose a knowable organization balance. Percentage-only data must not create falsely precise absolute amounts.
16
16
 
17
17
  The account extension described in [Copilot accounts](./copilot-accounts.md)
18
- adds a readonly GitHub identity under the details title. Account management and
19
- switching remain in Models; no Chat switcher is added. Identity and quota must
20
- carry matching active-account evidence before they are presented together.
18
+ adds a readonly GitHub identity under the details title. Models retains account
19
+ authorization and the global default. Managed Sessions can select an already
20
+ authorized account inside Credits for subsequent turns, or restore global
21
+ inheritance; running turns remain on their frozen account. Identity and quota
22
+ must carry matching Session-account evidence before they are presented together.
21
23
  Failure to read identity is not a different account or a zero balance.
22
24
 
23
25
  Detailed amounts are rounded to two decimal places for display; a positive amount below 0.01 is shown as `<0.01`, not zero. GitHub billing remains authoritative. Known individual budgets at 90% used show a low-budget warning, not a spending restriction. The plan link uses the supported Desktop browser handoff with a selectable URL fallback. Details use the browser's native popover top layer when available and a fixed-position fallback otherwise; no additional ReactDOM copy or private Core DOM access is introduced.