dsh-github-copilot 0.4.0-alpha.88 → 0.4.0-alpha.91

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.
@@ -4,112 +4,127 @@
4
4
 
5
5
  ## Result and boundaries
6
6
 
7
- **V3 target:** one global Copilot account, many shared account models, and independent explicitly selected/history-backed Sessions. Plugin code does not auto-migrate configuration or enforce a single registration. Actual managed-only deployment is an approved Ops step after release: the operator resolves approved Session/default choices separately, then config-only v1 maintenance may CAS-remove the reviewed user-native profile and verify registry readback. The maintenance command does not write Session/default selections. No bulk history/settings/credential mutation or hidden groups.
8
-
9
- The new native Copilot draft warns that **Save** adds another real model group, not a second account. Public additive APIs cannot veto native **Add** or disable **Save**. This is warning-only; users can recreate a native group after migration. Public `session.selectModel` also saves the future global default, so unselected empty Sessions may inherit it even while other selected/history-backed Sessions retain their own context. There is no global current-model/search-status card.
10
-
11
- New installations use **GitHub Copilot**, with the stable actual route ID `github-copilot-preview`. The planned `0.4.0-alpha.9` UI embeds login, status, **Refresh models** and **Manage** in an existing configured canonical `github-copilot` provider card while suppressing the separate footer account controller. When no such row is mounted, footer fallback or the old-Core settings section remains usable. The shared account-state owner survives transfer only while another eligible surface remains mounted. Unmounting the last surface or replacing declarations without overlapping mounts stops polling. A later controller reads status and separately ensures missing/idle/stale/error/loading signed-in metadata, without replaying the old forced-login action. Manual **Refresh models** is inside **Manage**; errors expose **Retry**. This is account-control integration, not a merger or removal of the two actual routes; credentials, configuration, history and selection stay unchanged by that integration.
12
-
13
- Normal discovery needs neither manual model definitions nor routine refresh clicks; the additive slot still cannot replace Core **Edit/Delete**, and the native editor remains. Successful explicit UI sign-in/account switch forces one discovery. Opening Models separately uses non-forcing `ensureModels()` for missing/idle/stale/error/loading signed-in metadata; error re-entry can retry after shared cooldown, never in a same-mount loop; loading joins the existing Host flight without extra network. Fresh ready cache makes no request, and true unavailable/empty models do not auto-retry. Status/details remain network-free. Defaults under `github-copilot` are `accountModelTtlMs: 86400000` (24h maximum reuse) and `accountModelFailureCooldownMs: 300000` (5min); shared Host single flight, no periodic metadata polling. A separate mounted 60-second display-only timer updates the relative timestamp without RPC/status/discovery calls. Background credential/reset events clear Client state and read status, not force every token event; next open/use ensures metadata.
14
-
15
- The alpha.7 last-success timestamp (`snapshot.discoveredAt`) appears once beside the count outside **Manage**: English relative text with a full local date/time/zone tooltip and accessible semantic `time`. Missing/invalid timestamps or no account hide it; future values use absolute text. Pending/error preserves the last success, a successful refresh supplies a new time and sign-out clears it. The display timer is disposed with the timestamp or unmount; it does not alter cache/discovery behavior.
16
-
17
- Last same-account metadata may display during TTL refresh/loading/error, never authorize requests. Credential/account/permission invalidation or proof expiry immediately revokes evidence; TTL does not extend tokens. Definitive `UNKNOWN_MODEL` triggers one bounded metadata refresh, with no message replay or model switching; generic HTTP/network errors are not guessed to mean unknown models. New models still require supported account metadata. README screenshots are presentation-only synthetic evidence; Host TTL/cooldown timing requires unit tests, not screenshots.
18
-
19
- Existing `llm-pi-ai.providers.github-copilot` profiles are not automatically removed. Until you explicitly remove a reviewed legacy profile, both real routes may remain listed. This guide removes that configuration, not merely its display: after removal and catalog refresh, the composer picker and `/model` both list only the managed Copilot group. Discovery failures produce diagnostics; they do not enable a fallback static catalog.
20
-
21
- There is still only one OAuth record, `llm-pi-ai/github-copilot`. Keep the `llm-pi-ai` plugin and authorization services mounted: an empty provider configuration does not mean the OAuth method must be removed. **Do not sign out, delete credentials, remove the companion or remove the native authorization plugin to hide a model group.** Do not use `models: []` as a disable mechanism; it can mean the default catalog, not no models.
22
-
23
- This is a manual migration with separate approvals for installation, any real model request, default/session changes, Host interruption and configuration edits. Reading this guide or installing a new package does not authorize those changes.
24
-
25
- ## Read-only readiness and maintenance scope (alpha.9)
26
-
27
- Use no-argument `githubCopilot.migrationStatus()` for a fresh observation of all live Agent Sessions, rather than relying on possibly stale generic `session/list` or unversioned plugin inventory. It reports the loaded plugin build's `plugin.name/version`, `protocolVersion: 1`, `observedAt`, `capabilities` (`agentsList`, `sessionProjections`, `settingsCas`, `providerRegistry`, `defaultSelection`) and `complete` flags for sessions/default/routes. Missing capability, false completeness or null required selection/route evidence means unknown; do not infer a safe absence. Idle Agents normally report `activeRequestSelection: null`.
28
-
29
- `effectiveSelection` follows pending projection, then request-header config, then default only for genuinely empty live Sessions with known projection state; `selectionSource` identifies that choice. Running Agents separately expose `activeRequestSelection`, the latest recorded header—not proof of an in-flight LLM call. Route flags distinguish native effective configuration from native/managed registration. The method does not call auth status/discovery, access credentials/network or mutate settings/Sessions, and adds no normal UI.
30
-
31
- Protocol v1 declares `historyScope: live-agents-only`: cold stored histories are not inspected. Before migration the operator must acknowledge that those conversations may need explicit model selection on resume. Loaded-version and structural capability self-reports do not attest all Desktop/Core bytes, and the observation is not an atomic cross-namespace transaction; recheck immediately before CAS.
32
-
33
- The planned `tools/migrate-copilot-managed-route.ps1` in `cloga/dsh-windows-ops` is separate **config-only v1 maintenance after plugin release**. It does not automate Session/default selection writes, inspect cold history, install/restart DSH, or certify a full Desktop baseline. Resolve any required Session/default choices manually with separate approval before running it. The planned path is not evidence that the command is published/installed or that live migration has completed.
7
+ One Host-owned OAuth account supplies many account models. The stable managed
8
+ route ID is `github-copilot-preview`, displayed as **GitHub Copilot**.
9
+ Fresh installations need no native provider definition. Upgrades preserve
10
+ existing `llm-pi-ai.providers.github-copilot`; two real groups can remain until
11
+ explicit migration. This is configuration removal, not hiding a card.
12
+
13
+ Native Add/Save can recreate another group. The warning is additive, not
14
+ single-route enforcement; Core Edit/Delete remains. Model discovery/UI lifecycle
15
+ is described in the [current README](../README.md#install-and-sign-in), not a
16
+ prerequisite to removing a route.
17
+
18
+ Keep `llm-pi-ai` and authorization mounted and preserve the sole credential
19
+ record `llm-pi-ai/github-copilot`. Do not sign out, delete credentials or remove
20
+ authorization to hide a group. `models: []` can mean the default catalog, not
21
+ disabled models.
22
+
23
+ Plugin code never auto-migrates settings, selections or histories. Installation,
24
+ real requests, Session/default changes, configuration edits and Host interruption
25
+ need their own explicit approvals. Public `session.selectModel` also writes the
26
+ future global default: other selected/history-backed Sessions keep their context,
27
+ but unselected empty Sessions may inherit it.
28
+
29
+ ## Read-only readiness and maintenance scope
30
+
31
+ Use no-argument `githubCopilot.migrationStatus()` for fresh live-Agent evidence,
32
+ not stale generic `session/list` or an unversioned inventory. It reports:
33
+
34
+ | Field | Interpretation |
35
+ |---|---|
36
+ | `plugin.name/version`, `protocolVersion: 1`, `observedAt` | Loaded build's structural self-report, not full Desktop/Core byte attestation |
37
+ | `capabilities` | `agentsList`, `sessionProjections`, `settingsCas`, `providerRegistry`, `defaultSelection` |
38
+ | `complete.sessions/defaultSelection/routes` | Observation completeness; missing/false is unknown, not safe absence |
39
+ | `effectiveSelection` / `selectionSource` | Pending projection, then request-header config, then default only for genuinely empty Sessions with known projection state |
40
+ | `activeRequestSelection` | Latest recorded header, not proven in-flight model work; idle usually null |
41
+ | Native effective configuration and native/managed registration | Separate facts, never infer one from the other |
42
+
43
+ This read uses no auth/discovery, credentials or network and writes no settings
44
+ or Sessions. `historyScope: live-agents-only` excludes cold stored conversations.
45
+ Operators must acknowledge that old conversations may need explicit selection
46
+ when resumed. The observation is not an atomic cross-namespace transaction;
47
+ recheck immediately before CAS.
48
+
49
+ The planned `cloga/dsh-windows-ops` command
50
+ `tools/migrate-copilot-managed-route.ps1` is separate **config-only v1**
51
+ maintenance. This guide does not attest its publication or execution. It does
52
+ not select Sessions/defaults, scan cold history, install/restart DSH or certify a
53
+ Desktop baseline. Resolve approved selection blockers separately.
34
54
 
35
55
  ## Review before removal
36
56
 
37
- 1. **Run the updated plugin first.** Confirm the active profile has actually loaded the absence-preserving plugin and matching Host/Client artifacts targeted by `0.4.0-alpha.9`. The provider-integrated UI does not require this optional route removal. Installed-on-disk is not loaded-runtime evidence. Do not remove the profile while an older plugin is running: older versions may recreate it during login, startup or authentication refresh. Use a published, checksum-verified release when available; a planned version number is not proof of publication.
38
- 2. **Verify account discovery.** Open Models, confirm sign-in, let automatic ensure complete if needed, and inspect accepted models, rejected IDs and capability warnings. Use **Retry** on error or **Manage → Refresh models** only for an intentional forced update. Confirm the intended model exists on `github-copilot-preview`. Metadata acceptance is not a successful transport test. An optional explicit test request needs the user's approval and consumes the provider's normal resources; report its result separately. Do not repeatedly sign in or disable validation to force a missing model.
39
- 3. **Choose defaults and current sessions deliberately.** Select accepted managed models only for the Sessions explicitly approved for migration, then confirm the approved future default. Core `session.selectModel` also writes that default; do not assume an empty unselected Session is unaffected. Keep the same model ID and reasoning effort only when the managed route actually advertises and supports them. Otherwise ask for a supported choice; do not guess a replacement or silently change effort. Verify the selections before removing their previous route.
40
- 4. **Inspect other references.** Review presets, task configurations and paused conversations for selections of `github-copilot`. Do not bulk-rewrite conversation records, replay state, provenance, presets or task files. Change each future-use selection explicitly where supported. Paused historical sessions that still select the old route will require a new model selection when resumed. Keeping their history intact is not a guarantee that the old route remains runnable after removal.
41
- 5. **Check configuration ownership.** Review the effective canonical profile and its source. If a base composition or another settings layer still supplies it, an ownership journal is present or conflicted, or another process is editing settings, stop for review. Do not delete a journal/marker, override inherited configuration or patch Core to force the result. Verified legacy journal restoration remains its own conservative process; migration does not grant ownership of arbitrary user fields.
42
-
43
- If any prerequisite is uncertain, keep the existing profile until resolved. Merely showing two groups is safer than silently losing a usable route.
57
+ 1. Verify an absence-preserving published plugin is installed **and loaded**,
58
+ with matching Host/Client. Older code may recreate the profile. A version
59
+ declaration or screenshot is not loaded-runtime evidence.
60
+ 2. Ensure discovery and accepted managed models. Use visible Retry or intentional
61
+ Refresh, not repeated sign-in/disabled validation. Metadata is not transport
62
+ proof; a real test request needs separate approval.
63
+ 3. Deliberately select only approved Sessions/defaults. Preserve model/effort
64
+ only if actually supported. Review paused histories, presets/task references
65
+ without bulk rewrites. Confirm selections before removing their old route.
66
+ 4. Review configuration source, effective base layers, namespace revision and
67
+ ownership journals. Inherited configuration, ambiguity or another writer
68
+ blocks removal. Never delete journals or patch Core to force it.
69
+
70
+ Keep the existing profile if any prerequisite is uncertain.
44
71
 
45
72
  ## Apply the reviewed Ops migration after release
46
73
 
47
- 1. Confirm the released plugin is installed and loaded with approval. Query `migrationStatus()` and check protocol/version, required capabilities and completeness; unknown evidence blocks maintenance. Record current Session selections and future default; manually resolve any approved selection blockers outside config-only v1 and query readiness again. Obtain the cold-history acknowledgement; the command never writes those selections. Any required Host interruption still needs explicit permission and an active-session check.
48
- 2. Preserve a **private settings-only backup** in a user-approved location outside Git/shared docs; do not print/upload it or read/copy OAuth credentials. Read the current user-native profile, namespace revision, effective base layers and ownership journal. Stop if inherited/base configuration, journal ambiguity or concurrent change prevents a safe removal.
49
- 3. Through the reviewed public settings path, **compare-and-swap (CAS)** against the observed revision and remove only the user-native `llm-pi-ai.providers.github-copilot` path. Preserve the `llm-pi-ai` mount/section, companion settings, credentials, all other providers and user fields. A conflict or already-absent path is not permission to retry blindly, rewrite whole settings, delete a journal or patch Core.
50
- 4. Read back persisted/effective settings and the real provider registry. Then check the composer and `/model` lists: only report a single managed group when the canonical registration is actually absent and no other layer supplies it. A hidden card or successful write alone is not this evidence. Cold `listModels()` can ensure shared discovery without opening Settings first.
51
- 5. Separately review any nonempty hosted-search `providers` allowlist. Ops may replace the reviewed legacy route entry with `github-copilot-preview` when approved; keep unrelated entries and never clear/broaden the list implicitly. Plugin code does not make this migration for you.
52
- 6. Confirm credentials remain configured, approved selections/default match the review, and other selected/history-backed Sessions and histories are intact. Public `session.selectModel` also saves the future default, so unselected empty Sessions may inherit it. `route: not-configured` describes optional canonical absence, not login failure or proof of successful model/search calls.
53
-
54
- A previously stuck **Deleting…** dialog is not proof the configuration was or was not removed. This change does not establish a fix for that hang. Do not click Delete repeatedly; inspect persisted configuration after the authorized stop before deciding whether any edit is required.
74
+ 1. Recheck readiness/capabilities/completeness and approved selections. Obtain the
75
+ cold-history acknowledgement. Any Host interruption needs separate approval.
76
+ 2. Take a private settings-only backup outside Git/shared docs. Do not copy or
77
+ disclose OAuth credentials. Check current user-native profile/base/journal.
78
+ 3. CAS-remove only the reviewed user-native
79
+ `llm-pi-ai.providers.github-copilot` path against the observed revision.
80
+ Preserve the mount/section, credentials, companion and all other provider
81
+ fields. Conflict/already-absent is not permission for blind retry.
82
+ 4. Read persisted/effective settings and actual registry, then composer and
83
+ `/model`. Report one managed group only when canonical registration is truly
84
+ absent and no other layer supplies it. A hidden card/write success is not enough.
85
+ 5. Separately review any nonempty search `providers` allowlist. An approved
86
+ replacement of the legacy entry with `github-copilot-preview` preserves other
87
+ entries; never clear/broaden automatically.
88
+ 6. Verify credentials, approved selections/default and other histories separately.
89
+ `route: not-configured` is optional canonical absence, not login failure or
90
+ proof of a successful model/search call.
91
+
92
+ A stuck **Deleting…** dialog proves neither removal nor its failure. Do not
93
+ repeat deletion; review persisted state after an authorized stop.
55
94
 
56
95
  ## History, search and rollback
57
96
 
58
- - The route ID `github-copilot-preview` does not change, preserving existing managed-route selections. This migration does not create a transparent alias from `github-copilot`, rewrite history or guarantee seamless continuation of old canonical sessions. Select a supported managed model explicitly when resuming those sessions, or retain/restore the canonical profile if its availability is still required.
59
- - Managed conversations use the published native adapter. Provider-hosted `ctx.web` search remains Responses-only with account/discovery/probe/allowlist checks, using the captured initiating Session's effective request-header/config or explicit `GenerateOptions`, with per-owner plans rather than a global default. `Agent.options` is only the activation seed, not selected-model evidence. Without proven request context, traditional search is unavailable; a pending new selection must not reuse old headers as current prompt guidance. Cold managed search ensures shared metadata first. Missing `agents.currentInitiator` makes traditional search unavailable; explicit marked request paths remain guarded. OAuth notification during initial discovery can fail the first search closed before probe/wire; a later user/driver request may retry, not automatically. The custom inline search path applies only to a still-configured legacy canonical route; removing that route does not turn managed conversations into the legacy inline transport.
60
- - For rollback, stop the relevant Host with permission and compare current settings with the private backup. Restore only the reviewed canonical profile fields and any default changes the user explicitly wants reversed. Do not overwrite the entire current settings file over unrelated later edits. Preserve unresolved journals for review. Restart with permission and verify registration, credentials and selections separately; a restored profile is not proof of a successful model call.
61
- - Downgrading to older plugin code can recreate a canonical profile. Record that behavior before an approved package rollback; do not mistake the reappearing group for a second OAuth account.
62
-
63
- ## 中文操作说明
64
-
65
- ### 目标与限制
66
-
67
- **V3 目标:**一个全局 Copilot 账号、多个共享账号模型,已显式选择/有历史选择的 Session 独立。插件代码不自动迁移配置、不强制唯一注册;实际只保留托管路由是发布后获准的 Ops 步骤:操作者先单独处理批准的 Session/默认值选择,仅配置 v1 维护再按 CAS 移除审核过的 user-native profile 并回读 registry。维护命令不写 Session/默认选择。禁止批量改写历史/设置/凭据或隐藏分组。
97
+ Managed IDs remain stable. No transparent canonical alias/history conversion is
98
+ created. Resumed canonical conversations need an explicit supported selection,
99
+ or preservation/restoration of their original route. Search keeps its existing
100
+ [initiator, metadata, allowlist and proof boundaries](./session-search-routing.md);
101
+ removing canonical does not turn managed chat into custom inline transport.
68
102
 
69
- 新建原生 Copilot draft 警告:**Save** 增加另一真实模型分组,而非第二账号。公开追加式 API 无法否决 **Add** 或禁用 **Save**;它只是警告,用户在迁移后仍能重新添加原生分组。公开 `session.selectModel` 同时保存未来全局默认值,因此其它已选/历史会话虽保留自身上下文,未选择的空会话仍可能继承新默认值。不新增全局当前模型/搜索状态卡片。
103
+ For rollback, stop the relevant Host with permission and compare fresh settings
104
+ with the private backup. Restore only reviewed canonical fields and approved
105
+ selection changes, never overwrite unrelated later edits. Keep ambiguous
106
+ journals for review. Restart with approval and verify registration, credentials
107
+ and selections separately; this is not model-call proof. Older plugin rollback
108
+ may recreate canonical, not a second account.
70
109
 
71
- 新安装使用显示为 **GitHub Copilot** 的账号发现路由,真实 ID 保持 `github-copilot-preview`。计划版本 `0.4.0-alpha.9` 在已有配置的 canonical `github-copilot` provider card 挂载时,将登录、状态、**Refresh models** 和 **Manage** 嵌入其中,抑制独立页脚账号控制器;没有此类行挂载时仍保留页脚或旧 Core settings section fallback。只有另一个符合条件的表面仍保持挂载时,切换才会保留共享账号状态 owner。最后一个表面卸载,或声明替换前后没有挂载重叠时,轮询会停止。之后新建控制器会读状态并另行确保缺失/idle/过期/error/loading的已登录元数据,不重放旧的强制登录动作。手动 **Refresh models** 位于 **Manage** 内,错误提供 **Retry**。这只是账号控件集成,不是合并/移除两条真实路由,也不会因此改写凭据、配置、历史或选择。
72
-
73
- 正常发现无需手工定义模型或常规手动刷新;公开 slot 仍不能替换 Core **Edit/Delete**,原生编辑器保留。显式界面登录/切换账号成功后强制发现一次;打开 Models 会另外通过非强制 `ensureModels()` 确保缺失/idle/过期/error/loading的已登录元数据,error 重开可在共享冷却结束后重试,但无同次挂载循环;loading 加入已有 Host 请求,不增加网络请求。新鲜 ready 不拉取,真正 unavailable 且空模型不自动重试。状态/详情本身仍无网络。`github-copilot` 默认 `accountModelTtlMs: 86400000`(24 小时最大复用)、`accountModelFailureCooldownMs: 300000`(5 分钟失败冷却),Host 合并为一个在途发现,不设周期元数据轮询;另有挂载期间每 60 秒更新相对时间文字的纯显示定时器,不调用 RPC/status/discovery。后台凭据/reset 事件清状态并只读查询,不对每个 token 事件强制发现;下次打开/使用再确保元数据。
74
-
75
- alpha.7 的上次成功时间(`snapshot.discoveredAt`)只在模型数量旁、**Manage** 外显示一次:相对文字为英文,tooltip 和可访问语义 `time` 提供完整本地日期、时间及时区。缺失/无效/无账号时隐藏,未来时间显示绝对值。等待/失败保留上次成功时间,刷新成功才更新,退出登录清除;时间消失或卸载时清理显示定时器。缓存和发现生命周期不变。
76
-
77
- 同账号旧元数据可在 TTL 刷新/loading/error 时展示,但不能授权请求。凭据/账号/权限失效或 proof 到期立即撤销证据,TTL 不延长 token。明确 `UNKNOWN_MODEL` 只触发一次有界元数据刷新,不重放消息或切换模型;普通 HTTP/网络错误不能猜成模型不存在。新模型仍需支持的账号元数据。README 截图只提供合成展示证据;Host TTL/冷却时序需单元测试,不能靠截图证明。
78
-
79
- 升级不会自动删除已有 `llm-pi-ai.providers.github-copilot`。只有用户真正移除经过审核的旧配置后,composer 与 `/model` 才都会只列出托管 Copilot 分组,不是仅隐藏第二条路由。始终保留 `llm-pi-ai` 插件、授权服务和唯一 OAuth record `llm-pi-ai/github-copilot`;不要退出登录、删除凭据或卸载授权插件来隐藏分组,也不要用 `models: []` 冒充禁用。
80
-
81
- 安装、真实测试请求、默认模型/会话选择修改、停止 Host 和离线配置修改都需要各自明确授权。本文不是自动执行这些操作的许可。
82
-
83
- ### 只读就绪检查与维护范围(alpha.9)
84
-
85
- 使用无参数 `githubCopilot.migrationStatus()` 新鲜读取所有 live Agent Session,而不是依赖可能过时的通用 `session/list` 或不含加载版本的 inventory。结果提供加载构建 `plugin.name/version`、`protocolVersion: 1`、`observedAt`、五个 `capabilities` 标记(`agentsList`、`sessionProjections`、`settingsCas`、`providerRegistry`、`defaultSelection`)及 sessions/default/routes 的 `complete` 标记。缺失能力、false 完整性或必要选择/路由证据为 null 表示未知,不能推断安全缺失;idle Agent 的 `activeRequestSelection: null` 是正常值。
86
-
87
- `effectiveSelection` 优先 pending projection,其次 request-header config;只有 projection 已知、确实无 pending/header 的空 live Session 才取默认值,`selectionSource` 表明来源。running Agent 的 `activeRequestSelection` 另报最近记录的 header,不证明 LLM 调用正在进行。路由标记区分有效 native 配置与 native/managed 注册。方法不执行 auth status/发现、不访问凭据/网络、不修改 settings/Session,也不新增常规界面。
88
-
89
- 协议 v1 的 `historyScope: live-agents-only` 不扫描冷存储历史,操作者必须确认知悉旧对话恢复时可能需要显式重选模型。加载版本/结构能力自报告不是完整 Desktop/Core 字节核验,也不是跨 namespace 原子事务;CAS 前立即复查。
90
-
91
- `cloga/dsh-windows-ops` 计划的 `tools/migrate-copilot-managed-route.ps1` 是插件发布后独立的**仅配置 v1 维护**:不自动写 Session/默认值、不读冷历史、不安装/重启 DSH、不验收完整 Desktop 基线。若有选择阻塞,须先另行授权、手工处理;计划路径不表示命令已发布/安装或真实迁移已经完成。
92
-
93
- ### 移除前审核
94
-
95
- 1. **先实际运行新版本。** 确认目标 `0.4.0-alpha.9` 中保留 canonical 缺失的插件已在活动 profile 加载,Host 与 Client 匹配。provider 集成界面不要求执行这项可选路由移除。使用已发布且校验通过的制品;计划版本和磁盘安装都不是已发布/已加载的证明。旧版本可能在启动、登录或认证刷新时重建被删 profile,不能先删除再期待旧进程保留缺失。
96
- 2. **验证发现结果。** 打开 Models 确认登录,等待按需自动 ensure 完成,检查目标模型是否在 `github-copilot-preview` 的接受列表及能力警告中。错误可点 **Retry**;有意强制更新时使用 **Manage → Refresh models**。元数据成功不等于真实调用成功;可选测试请求须明确批准,正常消耗供应方资源,结果单独报告。不要重复登录或关闭校验强行恢复模型。
97
- 3. **有意迁移选择。** 只为明确批准迁移的 Session 选择托管模型,再确认获准的未来默认值。Core `session.selectModel` 也会保存该默认值,不能假设未选择的空会话不受影响。只有账号明确公布且 SDK 支持时才保留同一模型 ID/思考强度;否则请用户选择,不猜测替代项。检查 preset、定时任务和暂停会话的 canonical 引用,逐项审核未来选择,不批量改写历史、回放、来源记录或 preset 文件。
98
- 4. **检查所有权与并发。** 若 base composition/其它配置层仍提供 canonical profile,存在 journal 冲突,或其它进程正在编辑 settings,停止并审核。不强删 marker,不覆盖继承配置,不修改 Core。旧 journal 的精确恢复流程仍需保留其安全检查。
99
-
100
- ### 发布后执行明确批准的 Ops 迁移
101
-
102
- 1. 经批准安装并实际加载已发布插件;调用 `migrationStatus()` 检查协议/版本、必要能力与完整性,未知证据阻止维护。记录当前 Session 选择及未来默认值;如有获准的选择阻塞,在仅配置 v1 之外手工处理后再次查询。取得冷历史范围确认;命令不写这些选择。若需要中断 Host,仍须另行批准并检查活动会话。
103
- 2. 仅将设置私密备份到用户批准、Git/共享文档之外的位置,不打印/上传,不读取或复制 OAuth 凭据。检查当前 user-native profile、namespace revision、有效 base 层及所有权 journal;有继承配置、journal 歧义或并发变更则停止。
104
- 3. 通过已审核的公开 settings 路径,按读取到的 revision 做 **compare-and-swap(CAS)**,只移除 user-native **`llm-pi-ai.providers.github-copilot`**。保留 `llm-pi-ai` 挂载/section、companion 设置、凭据、其它 provider 和用户字段。冲突或路径已不存在时不盲重试,不整份改写设置、不删 journal、不改 Core。
105
- 4. 回读持久化/有效设置及真实 provider registry,再检查 composer 与 `/model`。只有 canonical 注册确实消失、其它层也不提供时,才能报告只剩托管分组;隐藏卡片或写入成功本身不够。冷启动 `listModels()` 可直接确保共享发现,无需先打开 Settings。
106
- 5. 单独审核 hosted-search 非空 `providers` allowlist。经批准,Ops 可将审核过的旧 route 条目改为 `github-copilot-preview`,保留无关条目;不得隐式清空或扩大列表。插件代码不会代做迁移。
107
- 6. 确认凭据仍已配置、获准 Session/默认值符合审核、其它已选/历史会话及历史保持原样。公开 `session.selectModel` 同时保存未来默认值,未选择的空会话可能继承它。`route: not-configured` 仅表示可选 canonical 缺失,不证明发现/模型/搜索调用成功。
108
-
109
- ### 历史、搜索与回退
110
-
111
- 旧 `github-copilot-preview` ID 保持不变。canonical 历史不改写,也不会被自动别名映射;仍选旧路由的暂停会话恢复时须显式选择支持的托管模型。如果必须继续原路由,应暂缓移除或恢复其 profile,不能宣称旧路由仍无缝可用。
112
-
113
- 托管普通对话交给原生 adapter;`ctx.web` 托管搜索仍只支持通过账号元数据/probe/allowlist 检查的 Responses 模型,按捕获的发起 Session 有效 request-header/config 或显式 `GenerateOptions` 与独立 owner plan 处理,不用全局默认值。`Agent.options` 仅是激活 seed,不是已选模型证据;无可证明的请求上下文时传统搜索不可用,新选择尚未发起下一请求时不能拿旧 header 当当前 prompt 指引;冷启动先确保共享元数据。缺少 `agents.currentInitiator` 时传统搜索不可用,显式带标记请求仍受既有检查保护。首次发现中的 OAuth 通知可能让该次搜索在 probe/wire 前保守失败,之后用户/driver 可以重新请求,不自动重试。自定义 inline 只用于仍配置的旧 canonical 路由,删除旧路由不会把托管对话变成旧 inline 路径。
110
+ ## 中文操作说明
114
111
 
115
- 回退同样先取得停止 Host 的许可,对照私密备份,只恢复经过审核的 canonical profile,以及用户明确要撤回的默认值变更。不要用整份旧文件覆盖后来无关改动;保留冲突 journal 以供审核。获准重启后分别验证注册、登录和选择;配置恢复不等于模型调用成功。降级旧插件可能重新创建 canonical profile,须事先说明,不能将再出现的分组当成第二个 OAuth 账号。
112
+ 新安装无需原生 provider;升级保留已有 canonical 配置,两组都是真实路由,
113
+ 不是两个账号。迁移只在明确批准后移除审核过的
114
+ `llm-pi-ai.providers.github-copilot`;唯一凭据、`llm-pi-ai`、授权服务及其它配置保留。
115
+ 不要退出登录、删除凭据或使用 `models: []` 来隐藏分组。
116
+
117
+ 先验证发布版本已实际加载,再调用无参数 `githubCopilot.migrationStatus()`。
118
+ 版本、能力或完整性未知就停止;它只覆盖 live Agent,不扫描冷历史,也不调用
119
+ 凭据/发现/网络。最新 header 不等于正在推理,结构自报不等于完整字节证明。
120
+ 拟议 Ops 命令仅做配置维护,本文不证明其已发布、已执行或迁移已完成。
121
+
122
+ 单独批准 Session/未来默认值选择、真实测试请求、配置写入与停止/重启。
123
+ `session.selectModel` 同时修改未来默认值,未选择的空 Session 可能继承;
124
+ 其它已选/历史 Session 不批量改写。恢复旧 canonical 会话时可能需显式选择支持的
125
+ 托管模型,不能承诺透明续接。
126
+
127
+ 检查 base 层和 journal,私密备份设置但不复制 OAuth。写入前重新查询,
128
+ 按 revision 做窄路径 CAS;冲突不盲重试。回读持久化/有效配置、真实 registry、
129
+ composer 与 `/model`,才能确认单组。搜索 allowlist 修改另行审核,不隐式扩大。
130
+ 回退仅恢复获准字段,不用整份备份覆盖后来改动;注册恢复仍不证明模型调用成功。
package/lib/index.js CHANGED
@@ -1684,7 +1684,7 @@ const usageSchema = z$1.object({
1684
1684
  totalTokens: count.optional(),
1685
1685
  reasoningTokens: count.optional()
1686
1686
  });
1687
- function record$7(value) {
1687
+ function record$8(value) {
1688
1688
  return typeof value === "object" && value !== null && !Array.isArray(value);
1689
1689
  }
1690
1690
  function sameRoute$1(left, right) {
@@ -1703,10 +1703,10 @@ function initialContextEvidence() {
1703
1703
  }
1704
1704
  /** Read only counts and routing leaves; never message content or opaque replay. */
1705
1705
  function foldContextEvidence(state, event) {
1706
- if (!record$7(event) || typeof event.type !== "string" || !record$7(event.data)) return state;
1706
+ if (!record$8(event) || typeof event.type !== "string" || !record$8(event.data)) return state;
1707
1707
  if (event.type === "request/header" || event.type === "model/selection") {
1708
- const raw = event.type === "request/header" ? record$7(event.data.header) ? event.data.header.config : void 0 : event.data;
1709
- if (!record$7(raw)) return {
1708
+ const raw = event.type === "request/header" ? record$8(event.data.header) ? event.data.header.config : void 0 : event.data;
1709
+ if (!record$8(raw)) return {
1710
1710
  ...state,
1711
1711
  route: null,
1712
1712
  sample: null,
@@ -1745,7 +1745,7 @@ function foldContextEvidence(state, event) {
1745
1745
  if (!copilot(state.route)) return state;
1746
1746
  if (event.type === "assistant/message" && event.data.source !== void 0) {
1747
1747
  const source = event.data.source;
1748
- const parsed = routeSchema.safeParse(record$7(source) ? {
1748
+ const parsed = routeSchema.safeParse(record$8(source) ? {
1749
1749
  provider: source.provider,
1750
1750
  model: source.model
1751
1751
  } : source);
@@ -1761,7 +1761,7 @@ function foldContextEvidence(state, event) {
1761
1761
  const settledUsage = usage !== void 0;
1762
1762
  let terminal;
1763
1763
  for (const entry of stream) {
1764
- if (!record$7(entry) || entry.type !== "chunk" || !record$7(entry.chunk)) continue;
1764
+ if (!record$8(entry) || entry.type !== "chunk" || !record$8(entry.chunk)) continue;
1765
1765
  if (!settledUsage && entry.chunk.type === "usage") usage = entry.chunk.usage;
1766
1766
  if (entry.chunk.type === "finish") terminal = entry.chunk.reason;
1767
1767
  }
@@ -1775,7 +1775,7 @@ function foldContextEvidence(state, event) {
1775
1775
  };
1776
1776
  const value = parsed.data;
1777
1777
  const zero = isZeroContextUsage(value);
1778
- const successful = record$7(terminal) && (terminal.kind === "stop" || terminal.kind === "max-tokens" || terminal.kind === "tool-calls");
1778
+ const successful = record$8(terminal) && (terminal.kind === "stop" || terminal.kind === "max-tokens" || terminal.kind === "tool-calls");
1779
1779
  if (zero && !successful) {
1780
1780
  const reason = state.sample !== null || state.reason === "none" ? "failed-zero" : state.reason;
1781
1781
  return {
@@ -1817,7 +1817,7 @@ const contextEvidenceDefinition = {
1817
1817
  function installContextEvidence(ctx) {
1818
1818
  ctx.inject(["sessionProjections"], (scope) => {
1819
1819
  const registry = scope.get("sessionProjections");
1820
- if (!record$7(registry) || typeof registry.register !== "function") {
1820
+ if (!record$8(registry) || typeof registry.register !== "function") {
1821
1821
  scope.logger.warn("[github-copilot] COPILOT_CONTEXT_PROJECTION_UNAVAILABLE");
1822
1822
  return;
1823
1823
  }
@@ -1831,7 +1831,7 @@ function installContextEvidence(ctx) {
1831
1831
  //#endregion
1832
1832
  //#region package.json
1833
1833
  var name$1 = "dsh-github-copilot";
1834
- var version = "0.4.0-alpha.88";
1834
+ var version = "0.4.0-alpha.91";
1835
1835
  //#endregion
1836
1836
  //#region lib/types/probe.js
1837
1837
  /**
@@ -2843,7 +2843,7 @@ function buildAnthropicWireBody(request, cfg, model) {
2843
2843
  }
2844
2844
  //#endregion
2845
2845
  //#region lib/types/responses-reasoning-text.js
2846
- function record$6(value) {
2846
+ function record$7(value) {
2847
2847
  return typeof value === "object" && value !== null;
2848
2848
  }
2849
2849
  function responseIndex(value) {
@@ -2901,13 +2901,13 @@ var ResponsesReasoningText = class {
2901
2901
  }
2902
2902
  /** Only recognized public text fields are examined; no copying of the item. */
2903
2903
  snapshot(item) {
2904
- if (!record$6(item) || item.type !== "reasoning") return "";
2904
+ if (!record$7(item) || item.type !== "reasoning") return "";
2905
2905
  let delta = "";
2906
2906
  for (const family of ["summary", "raw"]) {
2907
2907
  const value = family === "summary" ? item.summary : item.content;
2908
2908
  if (!Array.isArray(value)) continue;
2909
2909
  for (const [index, part] of value.entries()) {
2910
- if (!record$6(part) || part.type !== (family === "summary" ? "summary_text" : "reasoning_text")) continue;
2910
+ if (!record$7(part) || part.type !== (family === "summary" ? "summary_text" : "reasoning_text")) continue;
2911
2911
  delta += this.update(family, index, part.text, true);
2912
2912
  }
2913
2913
  }
@@ -5716,16 +5716,16 @@ function requestBodyEvidence(body, protocol) {
5716
5716
  //#endregion
5717
5717
  //#region lib/types/request-body-timeout.js
5718
5718
  const observedMessage = "Timed out reading request body. Try again, or use a smaller request size.";
5719
- function record$5(value) {
5719
+ function record$6(value) {
5720
5720
  return typeof value === "object" && value !== null && !Array.isArray(value);
5721
5721
  }
5722
5722
  /** Verified provider evidence, not guessed capabilities, token limits or network cause. */
5723
5723
  async function requestBodyTimeoutDiagnostic(response, body, signal, dispatch) {
5724
5724
  if (response.status !== 408 || signal?.aborted) return void 0;
5725
5725
  const value = await readResponseErrorJson(response, signal);
5726
- if (signal?.aborted || !record$5(value)) return void 0;
5726
+ if (signal?.aborted || !record$6(value)) return void 0;
5727
5727
  const error = Object.hasOwn(value, "error") ? value.error : value;
5728
- if (!record$5(error) || error.code !== "user_request_timeout" || error.message !== observedMessage || value.code !== void 0 && value.code !== error.code || value.message !== void 0 && value.message !== error.message) return void 0;
5728
+ if (!record$6(error) || error.code !== "user_request_timeout" || error.message !== observedMessage || value.code !== void 0 && value.code !== error.code || value.message !== void 0 && value.message !== error.message) return void 0;
5729
5729
  const size = body === void 0 ? "Request body size unavailable." : `Request body: ${Buffer.byteLength(body, "utf8")} UTF-8 bytes (not context tokens).`;
5730
5730
  const composition = formatRequestBodyEvidence(dispatch === void 0 ? { state: "unavailable" } : requestBodyEvidence(body, dispatch.protocol), dispatch?.responseHeadersMs);
5731
5731
  return `${REQUEST_BODY_TIMEOUT_MARKER} ${size} ${composition} Native retry policy is unchanged. If retries exhaust, use these numbers to choose an explicit attachment/image-offload budget change or native compaction for compressible history; tool definitions and opaque replay may remain. Also check network/proxy health and GitHub service status. Composition alone does not establish a cause or supplier size limit. A larger client timeout does not change this server timeout. No history was trimmed or model switched.`;
@@ -6199,7 +6199,7 @@ var Budget = class {
6199
6199
  if (this.consumed > ACCOUNT_MODEL_CATALOG_LIMITS.maxBytes) fail("CATALOG_TOO_LARGE", true);
6200
6200
  }
6201
6201
  };
6202
- function record$4(value, code) {
6202
+ function record$5(value, code) {
6203
6203
  if (typeof value !== "object" || value === null || Array.isArray(value)) fail(code);
6204
6204
  return value;
6205
6205
  }
@@ -6218,13 +6218,13 @@ function text$1(value, maxLength, code, budget) {
6218
6218
  budget.charge(encoder.encode(value).byteLength);
6219
6219
  return value;
6220
6220
  }
6221
- function positive(value, code) {
6221
+ function positive$1(value, code) {
6222
6222
  if (typeof value !== "number" || !Number.isSafeInteger(value) || value <= 0) fail(code);
6223
6223
  return value;
6224
6224
  }
6225
6225
  function optionalPositive(parent, key, code, budget) {
6226
6226
  const descriptor = dataProperty(parent, key, budget);
6227
- return descriptor === void 0 ? void 0 : positive(descriptor.value, code);
6227
+ return descriptor === void 0 ? void 0 : positive$1(descriptor.value, code);
6228
6228
  }
6229
6229
  function stringList(value, maxItems, maxLength, code, budget) {
6230
6230
  if (!Array.isArray(value)) fail(code);
@@ -6252,11 +6252,11 @@ function normalizeModel(raw, id, options, budget) {
6252
6252
  if (options.availableModelIds?.has(id) !== true) fail("MISSING_POLICY");
6253
6253
  policySource = "account-available-id";
6254
6254
  } else {
6255
- if (text$1(field(record$4(rawPolicy, "INVALID_POLICY"), "state", budget), 64, "INVALID_POLICY", budget) !== "enabled") fail("POLICY_NOT_ENABLED");
6255
+ if (text$1(field(record$5(rawPolicy, "INVALID_POLICY"), "state", budget), 64, "INVALID_POLICY", budget) !== "enabled") fail("POLICY_NOT_ENABLED");
6256
6256
  policySource = "server-enabled";
6257
6257
  }
6258
- const capabilities = record$4(field(raw, "capabilities", budget), "INVALID_CAPABILITIES");
6259
- const supports = record$4(field(capabilities, "supports", budget), "INVALID_SUPPORTS");
6258
+ const capabilities = record$5(field(raw, "capabilities", budget), "INVALID_CAPABILITIES");
6259
+ const supports = record$5(field(capabilities, "supports", budget), "INVALID_SUPPORTS");
6260
6260
  const streaming = field(supports, "streaming", budget);
6261
6261
  if (streaming === false) fail("STREAMING_UNSUPPORTED");
6262
6262
  if (streaming !== true) fail("INVALID_SUPPORTS");
@@ -6277,7 +6277,7 @@ function normalizeModel(raw, id, options, budget) {
6277
6277
  if (selected === void 0) fail(unsupportedEndpointCount === 0 && endpoints.includes("ws:/responses") ? "WEBSOCKET_ONLY" : "UNSUPPORTED_ENDPOINTS");
6278
6278
  const rawLimits = field(capabilities, "limits", budget);
6279
6279
  if (rawLimits === void 0) fail("MISSING_LIMITS");
6280
- const limits = record$4(rawLimits, "INVALID_LIMITS");
6280
+ const limits = record$5(rawLimits, "INVALID_LIMITS");
6281
6281
  const maxContext = optionalPositive(limits, "max_context_window_tokens", "INVALID_LIMITS", budget);
6282
6282
  const maxInputTokens = optionalPositive(limits, "max_prompt_tokens", "INVALID_LIMITS", budget);
6283
6283
  if (maxContext === void 0 && maxInputTokens === void 0) fail("MISSING_CONTEXT_LIMIT");
@@ -6295,7 +6295,7 @@ function normalizeModel(raw, id, options, budget) {
6295
6295
  if (vision === true) {
6296
6296
  const rawVisionLimits = field(limits, "vision", budget);
6297
6297
  if (rawVisionLimits !== void 0) {
6298
- const rawMediaTypes = field(record$4(rawVisionLimits, "INVALID_VISION_LIMITS"), "supported_media_types", budget);
6298
+ const rawMediaTypes = field(record$5(rawVisionLimits, "INVALID_VISION_LIMITS"), "supported_media_types", budget);
6299
6299
  if (rawMediaTypes !== void 0) {
6300
6300
  const mediaTypes = stringList(rawMediaTypes, ACCOUNT_MODEL_CATALOG_LIMITS.maxMediaTypes, 128, "INVALID_VISION_LIMITS", budget);
6301
6301
  const mime = /^[a-z0-9][a-z0-9!#$%&'*+.^_`|~-]*\/[a-z0-9][a-z0-9!#$%&'*+.^_`|~-]*$/iu;
@@ -6357,7 +6357,7 @@ function normalizeAccountModelCatalog(raw, options = {}) {
6357
6357
  fail("INVALID_JSON", true);
6358
6358
  }
6359
6359
  }
6360
- const data = field(record$4(raw, "INVALID_CATALOG"), "data", budget);
6360
+ const data = field(record$5(raw, "INVALID_CATALOG"), "data", budget);
6361
6361
  if (!Array.isArray(data)) fail("INVALID_CATALOG");
6362
6362
  const count = field(data, "length", budget);
6363
6363
  if (typeof count !== "number" || !Number.isSafeInteger(count) || count < 0) fail("INVALID_CATALOG");
@@ -6380,7 +6380,7 @@ function normalizeAccountModelCatalog(raw, options = {}) {
6380
6380
  for (let index = 0; index < count; index++) {
6381
6381
  let id;
6382
6382
  try {
6383
- const candidate = record$4(field(data, String(index), budget), "INVALID_MODEL");
6383
+ const candidate = record$5(field(data, String(index), budget), "INVALID_MODEL");
6384
6384
  const candidateId = text$1(field(candidate, "id", budget), ACCOUNT_MODEL_CATALOG_LIMITS.maxIdLength, "INVALID_ID", budget);
6385
6385
  if (!identifier.test(candidateId)) fail("INVALID_ID");
6386
6386
  id = candidateId;
@@ -6812,7 +6812,7 @@ function createAccountModelSource(dependencies) {
6812
6812
  }
6813
6813
  //#endregion
6814
6814
  //#region lib/types/agent-compaction.js
6815
- function record$3(value) {
6815
+ function record$4(value) {
6816
6816
  return typeof value === "object" && value !== null;
6817
6817
  }
6818
6818
  /** Resolve the owning preset's service without reaching into Core's service registry. */
@@ -6820,7 +6820,7 @@ function agentCompaction(agent) {
6820
6820
  if (typeof agent.ctx?.get !== "function") throw new LlmError("COPILOT_COMPACTION_AGENT_CONTEXT_UNAVAILABLE", "INVALID_REQUEST");
6821
6821
  const presets = agent.ctx.get("agentPresets");
6822
6822
  if (presets !== void 0) {
6823
- if (!record$3(presets) || typeof presets.composedPreset !== "function" || typeof presets.serviceFor !== "function") throw new LlmError("COPILOT_COMPACTION_PRESET_LOOKUP_UNAVAILABLE", "INVALID_REQUEST");
6823
+ if (!record$4(presets) || typeof presets.composedPreset !== "function" || typeof presets.serviceFor !== "function") throw new LlmError("COPILOT_COMPACTION_PRESET_LOOKUP_UNAVAILABLE", "INVALID_REQUEST");
6824
6824
  const preset = presets.composedPreset(agent.ctx);
6825
6825
  if (preset !== void 0) {
6826
6826
  if (typeof preset !== "string" || preset.trim().length === 0) throw new LlmError("COPILOT_COMPACTION_PRESET_LOOKUP_UNAVAILABLE", "INVALID_REQUEST");
@@ -6942,6 +6942,92 @@ function installCopilotCompactionPressure(ctx, callbacks) {
6942
6942
  }, { prepend: true });
6943
6943
  }
6944
6944
  //#endregion
6945
+ //#region lib/types/pre-step-pressure.js
6946
+ function record$3(value) {
6947
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6948
+ }
6949
+ function positive(value) {
6950
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
6951
+ }
6952
+ function isEngine(value) {
6953
+ return record$3(value) && record$3(value.config) && typeof value.compactIfNeeded === "function";
6954
+ }
6955
+ /**
6956
+ * Prevent a continuing, unchanged route's known pressure from becoming an
6957
+ * unsampled model attempt. Final converted-request admission stays independent.
6958
+ */
6959
+ function installCopilotPreStepPressure(ctx, callbacks) {
6960
+ let warned = false;
6961
+ const unavailable = () => {
6962
+ if (warned) return;
6963
+ warned = true;
6964
+ ctx.logger.warn("COPILOT_PRE_STEP_PRESSURE_UNAVAILABLE: pre-step evidence is unavailable; retaining final request admission.");
6965
+ };
6966
+ return ctx.on("agent/pre-step", async ({ agent, step, signal }, next) => {
6967
+ const decision = await next();
6968
+ if (decision.kind !== "enter" || signal.aborted || step <= 1 || decision.messages.some((message) => message.source?.kind === "model-selection")) return decision;
6969
+ let engine;
6970
+ try {
6971
+ const header = agent.session.requestHeader();
6972
+ if (header?.config.provider !== "github-copilot-preview" || !isPluginPreviewProvider(ctx, header.config.provider)) return decision;
6973
+ const projections = ctx.get("sessionProjections");
6974
+ if (!record$3(projections) || typeof projections.stateOf !== "function") {
6975
+ unavailable();
6976
+ return decision;
6977
+ }
6978
+ const selection = projections.stateOf(agent.session, "modelSelection");
6979
+ if (!record$3(selection) || !Object.hasOwn(selection, "pending")) {
6980
+ unavailable();
6981
+ return decision;
6982
+ }
6983
+ if (selection.pending !== null) return decision;
6984
+ const budget = callbacks.resolve({
6985
+ ...header.config,
6986
+ messages: [],
6987
+ sessionId: agent.session.id
6988
+ });
6989
+ if (budget === void 0 || !positive(budget.inputBudgetTokens)) return decision;
6990
+ const candidate = agentCompaction(agent);
6991
+ if (!isEngine(candidate)) {
6992
+ unavailable();
6993
+ return decision;
6994
+ }
6995
+ const config = candidate.config;
6996
+ if (config.auto === false) return decision;
6997
+ if (config.auto !== true) {
6998
+ unavailable();
6999
+ return decision;
7000
+ }
7001
+ const policy = Array.isArray(config.modelPolicies) ? config.modelPolicies.find((value) => record$3(value) && value.provider === header.config.provider && value.model === header.config.model) : void 0;
7002
+ const retries = record$3(policy) ? policy.maxOverflowRetries ?? config.maxOverflowRetries : config.maxOverflowRetries;
7003
+ if (retries === 0) return decision;
7004
+ if (!positive(retries)) {
7005
+ unavailable();
7006
+ return decision;
7007
+ }
7008
+ const meter = ctx.get("tokenMeter");
7009
+ if (!record$3(meter) || typeof meter.measure !== "function") {
7010
+ unavailable();
7011
+ return decision;
7012
+ }
7013
+ const measured = meter.measure(agent.session);
7014
+ if (!record$3(measured) || typeof measured.totalTokens !== "number" || !Number.isSafeInteger(measured.totalTokens) || measured.totalTokens < 0) {
7015
+ unavailable();
7016
+ return decision;
7017
+ }
7018
+ if (measured.totalTokens <= budget.inputBudgetTokens) return decision;
7019
+ engine = candidate;
7020
+ } catch {
7021
+ unavailable();
7022
+ return decision;
7023
+ }
7024
+ signal.throwIfAborted();
7025
+ await engine.compactIfNeeded(agent, "context-overflow", signal);
7026
+ signal.throwIfAborted();
7027
+ return decision;
7028
+ }, { prepend: true });
7029
+ }
7030
+ //#endregion
6945
7031
  //#region lib/types/auto-assessment-evidence.js
6946
7032
  const milliseconds = z$1.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
6947
7033
  const SemanticAssessmentEvidenceSchema = z$1.object({
@@ -8979,7 +9065,7 @@ function apply$1(ctx, config = {}) {
8979
9065
  publishedDirectory = "";
8980
9066
  registration.replace([GITHUB_COPILOT_PREVIEW_PROVIDER_ID]);
8981
9067
  });
8982
- installCopilotCompactionPressure(ctx, { resolve(request) {
9068
+ const pressureCallbacks = { resolve(request) {
8983
9069
  const snapshot = source.readSnapshot();
8984
9070
  if (snapshot === void 0 || proofFor(snapshot) === void 0) return void 0;
8985
9071
  if (excludedModels().has(request.model)) return void 0;
@@ -8987,7 +9073,9 @@ function apply$1(ctx, config = {}) {
8987
9073
  if (descriptor === void 0) return void 0;
8988
9074
  const result = calculateRequestBudget(descriptor, request.maxTokens, resolveRequestBudgetPolicy(budgetSettings()));
8989
9075
  return result.ok ? { inputBudgetTokens: result.budget.pressureInputLimit } : void 0;
8990
- } });
9076
+ } };
9077
+ installCopilotPreStepPressure(ctx, pressureCallbacks);
9078
+ installCopilotCompactionPressure(ctx, pressureCallbacks);
8991
9079
  notify = () => {
8992
9080
  const view = getView();
8993
9081
  const directory = JSON.stringify({
@@ -0,0 +1,8 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { CopilotCompactionPressureCallbacks } from './compaction-pressure.ts';
3
+ /**
4
+ * Prevent a continuing, unchanged route's known pressure from becoming an
5
+ * unsampled model attempt. Final converted-request admission stays independent.
6
+ */
7
+ export declare function installCopilotPreStepPressure(ctx: Context, callbacks: CopilotCompactionPressureCallbacks): () => void;
8
+ //# sourceMappingURL=pre-step-pressure.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-github-copilot",
3
3
  "description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
4
- "version": "0.4.0-alpha.88",
4
+ "version": "0.4.0-alpha.91",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",