dsh-github-copilot 0.4.0-alpha.76 → 0.4.0-alpha.77

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
@@ -238,6 +238,8 @@ Never say GPT-6/search works merely because settings, typecheck or a package imp
238
238
 
239
239
  ## Changing capabilities
240
240
 
241
+ Automatic pressure and Auto recovery availability resolve the initiating Agent's bound preset through public `agentPresets.composedPreset()` / `serviceFor(agent, 'compaction')`. A bound preset without an engine must not borrow global recovery. Only non-preset Agents use their own `agent.ctx.get('compaction')`; never scan Core's private registry or cache an engine across preset replacement. Native transactions, cancellation, retry policy and manual-only segmented recovery remain unchanged.
242
+
241
243
  Selection footer Remote calls carry an explicit viewed Session ID and turn.
242
244
  Do not add an automatic Client `scope` projection: rc.2 prefers the scoped
243
245
  variant and removes the ID argument, breaking the footer's two-argument call.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.77 (prepared)
4
+
5
+ - Resolve automatic compaction pressure and Auto recovery availability from the initiating Agent's preset through the existing public service lookup (#248), including Desktop's isolated compaction groups.
6
+ - Never borrow global recovery when a bound preset has no engine; preserve disabled/zero-retry policy, native transactions, cancellation, and manual-only segmented recovery. No new command, timeout reclassification, Core change, or automatic model switch.
7
+ - Cover concurrent enabled/disabled/absent preset engines with unchanged official rc.2 AgentLoop, durable summary/rebuilt-request and cancellation evidence; add the frozen preset dependency closure to both required CI and release gates.
8
+
3
9
  ## 0.4.0-alpha.76 (prepared)
4
10
 
5
11
  - Fix fresh master/lead Auto footer reads rejected by the native Client gateway when an ambient agent context reduced the explicit two-argument call to one (#249). Preserve native Host lookup and strict codecs; do not substitute the ambient Session.
package/README.md CHANGED
@@ -106,7 +106,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
106
106
 
107
107
  ## Install and sign in
108
108
 
109
- The commands below target the package version `0.4.0-alpha.76`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
109
+ The commands below target the package version `0.4.0-alpha.77`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
110
110
 
111
111
  Before installing/updating, unpack the **checksum-verified** archive into a temporary directory and run its read-only composition preflight (replace all paths with absolute paths for the intended profile):
112
112
 
@@ -119,10 +119,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
119
119
  For a standalone named profile only, the supported CLI command is:
120
120
 
121
121
  ```sh
122
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.76/dsh-github-copilot-0.4.0-alpha.76.tgz
122
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.77/dsh-github-copilot-0.4.0-alpha.77.tgz
123
123
  ```
124
124
 
125
- For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.76` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
125
+ For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.77` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
126
126
 
127
127
  Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in**, and complete the GitHub device-code flow. Plugin installation changes the selected profile; activation follows that profile's normal reload/restart policy.
128
128
 
@@ -175,7 +175,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
175
175
  5. Confirm **Signed in** and inspect the automatic discovery result before asking the user to choose a model. Already-signed-in Models opening ensures missing/stale metadata automatically; fresh ready cache makes no request. Use visible **Retry** for errors or **Manage → Refresh models** for an intentional forced update, not routine setup. Status alone does not discover, and login, metadata and successful model calls remain separate evidence.
176
176
  6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
177
177
 
178
- GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.76`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
178
+ GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.77`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
179
179
 
180
180
  **Desktop package-update and Web-lifecycle boundaries:** the native manager's `restart-required` result for an in-place installed-package upgrade is authoritative and distinct from plugin-bundle removal/re-add behavior. Any disable, removal, or upgrade involving service recomposition (`cordis.patch.yml`, such as the isolated routed web search layer) may leave dependent entries pending until Desktop is fully exited and cold-restarted. If the native manager reports only entries such as `pending (waiting for service: web)` while this plugin already shows **Off**, the requested disabled state has been persisted; cold-restart Desktop instead of repeatedly toggling or reinstalling the plugin. Other errors are not covered by this guidance and must still be investigated.
181
181
 
@@ -326,6 +326,8 @@ This optional integration uses the public `conversation.chat.node` keyed slot an
326
326
 
327
327
  ## Managed request budgets and compaction
328
328
 
329
+ On Desktop, automatic recovery and Auto diagnostics use the initiating Agent's current preset engine, including isolated groups, through Core's public preset lookup. A bound preset without an engine never borrows global recovery. Automatic compaction remains the native pressure/error-recovery path, not `/compact` or `/copilot-compact`; segmented recovery remains manual-only. Timeout/transport errors are not reclassified as context overflow.
330
+
329
331
  The managed `github-copilot-preview` route estimates the complete native request, including current system/tool prefixes, and checks both the independent prompt limit and combined input/output capacity before model transport. Its operational input budget is `min(prompt limit when advertised, context capacity - requested/default output reservation) - safety allowance`. Supplier capacities are not rewritten. Invalid output policy or exhausted headroom fails explicitly; no history is silently truncated and no model is substituted.
330
332
 
331
333
  For a marked ordinary agent-loop request with a matching initiating Session and committed request configuration, optional token-meter and enabled stock automatic compaction, the plugin signals local estimated pressure at 90% of that budget. Core owns the existing bounded compaction/rebuild path and commits only a valid smaller checkpoint. It does not compact concurrently inside a frozen request. Missing optional seams disable this early signal, not the final native budget guard; `auto: false` or zero stock overflow retries remain respected. Canonical/user-owned routes and other providers are unchanged.
@@ -452,8 +454,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
452
454
  `package.json` declares public npm distribution. A release tag must equal `v${package.json.version}`. Versions use standard SemVer prerelease labels (`alpha`, `beta`, or `rc`), each with its matching npm dist-tag; only stable versions use `latest`. The Release workflow performs the frozen install and complete verification gate, packs once (or recovers the original archive on retry), verifies `SHA256SUMS`, publishes the immutable GitHub Release and then publishes those same bytes to npm through OIDC. Either channel failing means delivery is incomplete. First package creation needs an authorized maintainer; staging requires an existing package and is not a first-package bootstrap. Historical releases are not republished.
453
455
 
454
456
  ```sh
455
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.76/dsh-github-copilot-0.4.0-alpha.76.tgz
456
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.76/SHA256SUMS
457
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.77/dsh-github-copilot-0.4.0-alpha.77.tgz
458
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.77/SHA256SUMS
457
459
  sha256sum --check SHA256SUMS
458
460
  ```
459
461
 
@@ -461,7 +463,7 @@ PowerShell can verify the same two downloaded files with:
461
463
 
462
464
  ```powershell
463
465
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
464
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.76.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
466
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.77.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
465
467
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
466
468
  ```
467
469
 
package/README.zh.md CHANGED
@@ -26,7 +26,7 @@ Core 管理。详见[图片兼容性与限制](./docs/image-input-compatibility.
26
26
 
27
27
  截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
28
28
 
29
- > 当前文档与安装命令对应版本 `0.4.0-alpha.76`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
29
+ > 当前文档与安装命令对应版本 `0.4.0-alpha.77`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
30
30
 
31
31
  Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
32
32
 
@@ -121,10 +121,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
121
121
  仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
122
122
 
123
123
  ```sh
124
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.76/dsh-github-copilot-0.4.0-alpha.76.tgz
124
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.77/dsh-github-copilot-0.4.0-alpha.77.tgz
125
125
  ```
126
126
 
127
- Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.76`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
127
+ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.77`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
128
128
 
129
129
  随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
130
130
 
@@ -177,7 +177,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
177
177
  5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
178
178
  6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
179
179
 
180
- 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.76`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
180
+ 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.77`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
181
181
 
182
182
  **Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
183
183
 
@@ -333,6 +333,8 @@ Responses 解析器会保留公开的 `reasoning_summary_text`、`reasoning_text
333
333
 
334
334
  对于有原生 agent-loop 标记、发起 Session 与已记录请求配置一致、具备 token meter 且官方自动压缩已启用的普通请求,插件在预算的默认 90% 处发出本地估算压力信号。由 Core 执行原有的有界压缩、校验及请求重建,不在已冻结的请求中并发压缩。缺少可选接口时只关闭提前信号,最终原生预算检查仍保留;尊重 `auto: false` 和官方 overflow 重试次数为零的设置。不影响用户自有 canonical 路由或其他供应方。
335
335
 
336
+ Desktop 中的自动恢复与 Auto 诊断通过 Core 公开的 preset 查询接口读取发起 Agent 当前所属的压缩器,包括隔离分组。已绑定的 preset 没有压缩器时,不借用全局引擎。自动压缩仍走原生压力/错误恢复链路,不调用 `/compact` 或 `/copilot-compact`;分段恢复仍仅用于手动压缩。普通超时和传输错误不会被改判为上下文超限。
337
+
336
338
  `purpose: 'compaction'` 的摘要调用绕过提前压力阈值,只检查完整硬预算。没有调用方或适配器已解析的思考等级时,`prefer-low` 从已支持的能力中选择 `minimal` 或 `low`;没有此能力则保持供应方默认。显式或已解析的等级优先。摘要请求的输出上限不被偷偷改写,保持 Core 辅助摘要记录一致;也不会将截断输出当成成功 checkpoint。`enabled` 仍仅控制 hosted search。
337
339
 
338
340
  **仍不保证救回所有已经超限的旧历史。** 默认手动 compact 仍会在模型发送前拒绝超限摘要。另有可单独选择的[手动恢复引擎](./docs/manual-compaction-recovery.md):仅对可分割且工具调用配对完整的托管 Copilot 历史进行有界中间摘要,最终持久事务仍由 Core 负责。它必须**替换**原有压缩服务而非并列安装;仅安装插件不会启用。不可分割的输入、过大的固定前缀或被截断的输出都不会替换历史;不会自动切换模型或偷偷删除历史。
@@ -463,8 +465,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
463
465
  `package.json` 声明公开 npm 分发。Release tag 必须严格等于 `v${package.json.version}`。预发布使用 `alpha`、`beta` 或 `rc` 及对应 npm dist-tag,只有稳定版使用 `latest`。Release workflow 执行 frozen install 和完整门禁,只打包一次(重试恢复原始归档),验证 `SHA256SUMS`,发布不可变 GitHub Release,再通过 OIDC 将同一份字节发布到 npm。任一渠道失败都表示交付未完成。首次建包须由获准环境中的维护者完成;staging 要求包已存在,不能代替首次建包。不会批量补发历史版本。
464
466
 
465
467
  ```sh
466
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.76/dsh-github-copilot-0.4.0-alpha.76.tgz
467
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.76/SHA256SUMS
468
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.77/dsh-github-copilot-0.4.0-alpha.77.tgz
469
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.77/SHA256SUMS
468
470
  sha256sum --check SHA256SUMS
469
471
  ```
470
472
 
@@ -472,7 +474,7 @@ PowerShell 可以对已下载的同一组文件执行:
472
474
 
473
475
  ```powershell
474
476
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
475
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.76.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
477
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.77.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
476
478
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
477
479
  ```
478
480
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.76"
11
+ "version": "0.4.0-alpha.77"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -223,7 +223,7 @@
223
223
  "desktopPackageSet": "installed-descriptor-audited",
224
224
  "managedProviderValidation": "synthetic-tagged-source-runtime",
225
225
  "resolvedProfileDiagnostics": "plugin-owned-empty-modelErrors",
226
- "runtimeTests": ["tests/preview-route.spec.ts", "tests/published-core.spec.ts", "tests/single-route.spec.ts", "tests/search-routing.spec.ts", "tests/routed-web.spec.ts", "tests/deepseek-search-fallback.spec.ts", "tests/tool-schema-compat.spec.ts", "tests/fixtures/alpha2-contracts-core.fixture.ts", "tests/fixtures/compaction-pressure-core.fixture.ts", "tests/remote-codec.spec.ts", "tests/dual-model-projection.spec.ts", "tests/fixtures/session-context-core.fixture.ts", "tests/fixtures/remote-core.fixture.ts"]
226
+ "runtimeTests": ["tests/preview-route.spec.ts", "tests/published-core.spec.ts", "tests/single-route.spec.ts", "tests/search-routing.spec.ts", "tests/routed-web.spec.ts", "tests/deepseek-search-fallback.spec.ts", "tests/tool-schema-compat.spec.ts", "tests/fixtures/alpha2-contracts-core.fixture.ts", "tests/fixtures/compaction-pressure-core.fixture.ts", "tests/remote-codec.spec.ts", "tests/dual-model-projection.spec.ts", "tests/fixtures/scoped-compaction-core.fixture.ts", "tests/fixtures/session-context-core.fixture.ts", "tests/fixtures/remote-core.fixture.ts"]
227
227
  }
228
228
  ],
229
229
  "packages": [
@@ -452,11 +452,15 @@
452
452
  "sourceMarkers": [
453
453
  {"file": "src/request-budget.ts", "marker": "calculateRequestBudget"},
454
454
  {"file": "src/compaction-pressure.ts", "marker": "installCopilotCompactionPressure"},
455
+ {"file": "src/agent-compaction.ts", "marker": "presets.serviceFor(agent, 'compaction')"},
455
456
  {"file": "src/preview-route.ts", "marker": "COPILOT_CONTEXT_BUDGET_EXCEEDED"},
456
457
  {"file": "src/preview-provider.ts", "marker": "inspectRequest"}
457
458
  ],
458
459
  "tests": [
459
460
  {"file": "tests/preview-route.spec.ts", "name": "rejects independent input overflow before model wire, prepared=%s"},
461
+ {"file": "tests/compaction-pressure.spec.ts", "name": "does not substitute a global engine when the bound preset has none"},
462
+ {"file": "tests/auto-model-host.spec.ts", "name": "uses owning preset recovery availability (%s) for Auto diagnostics"},
463
+ {"file": "tests/fixtures/scoped-compaction-core.fixture.ts", "name": "global pressure finds isolated preset recovery: %j"},
460
464
  {"file": "tests/preview-route.spec.ts", "name": "reserves the requested output separately from the independent prompt ceiling"},
461
465
  {"file": "tests/preview-route.spec.ts", "name": "uses supported low effort for compaction only without rewriting its output cap"},
462
466
  {"file": "tests/preview-route.spec.ts", "name": "refuses an already oversized manual summary without sending or truncating its history"},
@@ -39,6 +39,10 @@ Only then does it emit one terminal local pressure error before dispatch. Offici
39
39
 
40
40
  Disabled auto recovery or zero retries are respected. Missing/mismatching optional capabilities delegate unchanged and can produce one bounded unavailability diagnostic; the hard native guard remains. Cancellation before iteration wins over pressure. There is no polling, automatic metadata refresh from the pressure listener, or whole-Session dump.
41
41
 
42
+ On official `0.2.0-rc.2`, Desktop presets may isolate `compaction` inside a child group, invisible to both the global plugin context and a plain `agent.ctx.get('compaction')`. The plugin uses the public `agentPresets.composedPreset()` and `serviceFor(agent, 'compaction')` methods to resolve the initiating Agent's current preset engine. A bound preset with no engine remains unavailable; it never borrows another scope's policy. Only an Agent without a bound preset uses its own context lookup. The lookup is repeated rather than caching a replaced engine. Auto's recovery-availability diagnostic uses the same helper.
43
+
44
+ This fixes scope wiring, not a new automatic command: native pressure and `agent/request-error` still invoke the selected engine. Neither `/compact` nor `/copilot-compact` is called by this listener. If the optional manual recovery engine is selected, its automatic path remains the native single-summary path; segmented recovery stays manual-only. Ordinary timeout/transport failures do not become context overflow.
45
+
42
46
  ## Summary purpose policy
43
47
 
44
48
  Official `GenerateOptions.purpose` permits adapter-specific generation policy. For `purpose: 'compaction'`, `prefer-low` selects supported `minimal`, otherwise supported `low`, only when no effort was supplied or materialized by Core/the configured native profile. Explicit and resolved defaults win; unsupported low controls preserve the provider default. `preserve` disables this purpose default. Normal conversations and other purposes keep their existing reasoning behavior.
@@ -83,6 +87,8 @@ Exact target: official `ddefc45fbc7f8e46dd73185e68295696d1297887` (`0.1.6-alpha.
83
87
 
84
88
  Support is partial: official transactional compaction is reused, while independent Copilot input admission and summary-purpose default policy remain companion-owned. Retire the corresponding companion component only after official behavior covers both input/output constraints, correct request identity, cancellation, purpose handling and equivalent regression/unchanged-runtime acceptance. Do not remove official recovery or falsify contextWindow to reduce the diff.
85
89
 
90
+ Current scoped-recovery evidence additionally targets unchanged official `639ed015397290b3745d163aafe02ffee4aa3f84` (`0.2.0-rc.2`): [public Agent preset service lookup](https://github.com/deepseek-ai/deepseek-harness/blob/639ed015397290b3745d163aafe02ffee4aa3f84/packages/preset/agent-preset-registry/src/index.ts). Native service lookup is complete and reused; plugin pressure still needs the account input budget. Retire this helper when the official request-budget path supplies equivalent preset-owned admission and recovery evidence.
91
+
86
92
  ## Verification boundary
87
93
 
88
94
  Pure arithmetic and policy tests, public-middleware fixtures, and the real published native adapter/SDK with synthetic transport cover separate layers. Required cases include independent/combined bounds, changed prefixes, explicit/default output and effort, metadata/credential invalidation, direct/prepared parity, concurrent calls, cancellation, output truncation and oversized manual input. Existing full plugin gates and exact-Core compatibility fixtures remain required; source inventory is not their execution result.
package/lib/index.js CHANGED
@@ -1700,7 +1700,7 @@ const usageSchema = z$1.object({
1700
1700
  totalTokens: count.optional(),
1701
1701
  reasoningTokens: count.optional()
1702
1702
  });
1703
- function record$5(value) {
1703
+ function record$6(value) {
1704
1704
  return typeof value === "object" && value !== null && !Array.isArray(value);
1705
1705
  }
1706
1706
  function sameRoute$1(left, right) {
@@ -1719,10 +1719,10 @@ function initialContextEvidence() {
1719
1719
  }
1720
1720
  /** Read only counts and routing leaves; never message content or opaque replay. */
1721
1721
  function foldContextEvidence(state, event) {
1722
- if (!record$5(event) || typeof event.type !== "string" || !record$5(event.data)) return state;
1722
+ if (!record$6(event) || typeof event.type !== "string" || !record$6(event.data)) return state;
1723
1723
  if (event.type === "request/header" || event.type === "model/selection") {
1724
- const raw = event.type === "request/header" ? record$5(event.data.header) ? event.data.header.config : void 0 : event.data;
1725
- if (!record$5(raw)) return {
1724
+ const raw = event.type === "request/header" ? record$6(event.data.header) ? event.data.header.config : void 0 : event.data;
1725
+ if (!record$6(raw)) return {
1726
1726
  ...state,
1727
1727
  route: null,
1728
1728
  sample: null,
@@ -1761,7 +1761,7 @@ function foldContextEvidence(state, event) {
1761
1761
  if (!copilot(state.route)) return state;
1762
1762
  if (event.type === "assistant/message" && event.data.source !== void 0) {
1763
1763
  const source = event.data.source;
1764
- const parsed = routeSchema.safeParse(record$5(source) ? {
1764
+ const parsed = routeSchema.safeParse(record$6(source) ? {
1765
1765
  provider: source.provider,
1766
1766
  model: source.model
1767
1767
  } : source);
@@ -1777,7 +1777,7 @@ function foldContextEvidence(state, event) {
1777
1777
  const settledUsage = usage !== void 0;
1778
1778
  let terminal;
1779
1779
  for (const entry of stream) {
1780
- if (!record$5(entry) || entry.type !== "chunk" || !record$5(entry.chunk)) continue;
1780
+ if (!record$6(entry) || entry.type !== "chunk" || !record$6(entry.chunk)) continue;
1781
1781
  if (!settledUsage && entry.chunk.type === "usage") usage = entry.chunk.usage;
1782
1782
  if (entry.chunk.type === "finish") terminal = entry.chunk.reason;
1783
1783
  }
@@ -1791,7 +1791,7 @@ function foldContextEvidence(state, event) {
1791
1791
  };
1792
1792
  const value = parsed.data;
1793
1793
  const zero = isZeroContextUsage(value);
1794
- const successful = record$5(terminal) && (terminal.kind === "stop" || terminal.kind === "max-tokens" || terminal.kind === "tool-calls");
1794
+ const successful = record$6(terminal) && (terminal.kind === "stop" || terminal.kind === "max-tokens" || terminal.kind === "tool-calls");
1795
1795
  if (zero && !successful) {
1796
1796
  const reason = state.sample !== null || state.reason === "none" ? "failed-zero" : state.reason;
1797
1797
  return {
@@ -1833,7 +1833,7 @@ const contextEvidenceDefinition = {
1833
1833
  function installContextEvidence(ctx) {
1834
1834
  ctx.inject(["sessionProjections"], (scope) => {
1835
1835
  const registry = scope.get("sessionProjections");
1836
- if (!record$5(registry) || typeof registry.register !== "function") {
1836
+ if (!record$6(registry) || typeof registry.register !== "function") {
1837
1837
  scope.logger.warn("[github-copilot] COPILOT_CONTEXT_PROJECTION_UNAVAILABLE");
1838
1838
  return;
1839
1839
  }
@@ -1847,7 +1847,7 @@ function installContextEvidence(ctx) {
1847
1847
  //#endregion
1848
1848
  //#region package.json
1849
1849
  var name$1 = "dsh-github-copilot";
1850
- var version = "0.4.0-alpha.76";
1850
+ var version = "0.4.0-alpha.77";
1851
1851
  //#endregion
1852
1852
  //#region lib/types/probe.js
1853
1853
  /**
@@ -2856,7 +2856,7 @@ function buildAnthropicWireBody(request, cfg, model) {
2856
2856
  }
2857
2857
  //#endregion
2858
2858
  //#region lib/types/responses-reasoning-text.js
2859
- function record$4(value) {
2859
+ function record$5(value) {
2860
2860
  return typeof value === "object" && value !== null;
2861
2861
  }
2862
2862
  function responseIndex(value) {
@@ -2914,13 +2914,13 @@ var ResponsesReasoningText = class {
2914
2914
  }
2915
2915
  /** Only recognized public text fields are examined; no copying of the item. */
2916
2916
  snapshot(item) {
2917
- if (!record$4(item) || item.type !== "reasoning") return "";
2917
+ if (!record$5(item) || item.type !== "reasoning") return "";
2918
2918
  let delta = "";
2919
2919
  for (const family of ["summary", "raw"]) {
2920
2920
  const value = family === "summary" ? item.summary : item.content;
2921
2921
  if (!Array.isArray(value)) continue;
2922
2922
  for (const [index, part] of value.entries()) {
2923
- if (!record$4(part) || part.type !== (family === "summary" ? "summary_text" : "reasoning_text")) continue;
2923
+ if (!record$5(part) || part.type !== (family === "summary" ? "summary_text" : "reasoning_text")) continue;
2924
2924
  delta += this.update(family, index, part.text, true);
2925
2925
  }
2926
2926
  }
@@ -5542,16 +5542,16 @@ async function isCopilotInputItemScopeError(response, signal) {
5542
5542
  //#endregion
5543
5543
  //#region lib/types/request-body-timeout.js
5544
5544
  const observedMessage = "Timed out reading request body. Try again, or use a smaller request size.";
5545
- function record$3(value) {
5545
+ function record$4(value) {
5546
5546
  return typeof value === "object" && value !== null && !Array.isArray(value);
5547
5547
  }
5548
5548
  /** Verified provider evidence, not guessed capabilities, token limits or network cause. */
5549
5549
  async function requestBodyTimeoutDiagnostic(response, body, signal) {
5550
5550
  if (response.status !== 408 || signal?.aborted) return void 0;
5551
5551
  const value = await readResponseErrorJson(response, signal);
5552
- if (!record$3(value)) return void 0;
5552
+ if (!record$4(value)) return void 0;
5553
5553
  const error = Object.hasOwn(value, "error") ? value.error : value;
5554
- if (!record$3(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;
5554
+ if (!record$4(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;
5555
5555
  return `COPILOT_REQUEST_BODY_TIMEOUT: Copilot returned HTTP 408 / user_request_timeout while reading the request body; this is not context-window overflow. ${body === void 0 ? "Request body size unavailable." : `Request body: ${Buffer.byteLength(body, "utf8")} UTF-8 bytes (not context tokens).`} Native retry policy is unchanged. If retries exhaust, explicitly compact the conversation or reduce attachments/tool output before retrying; also check network/proxy health and GitHub service status. A larger client timeout does not change this server timeout. No history was trimmed or model switched.`;
5556
5556
  }
5557
5557
  //#endregion
@@ -5888,7 +5888,7 @@ var Budget = class {
5888
5888
  if (this.consumed > ACCOUNT_MODEL_CATALOG_LIMITS.maxBytes) fail("CATALOG_TOO_LARGE", true);
5889
5889
  }
5890
5890
  };
5891
- function record$2(value, code) {
5891
+ function record$3(value, code) {
5892
5892
  if (typeof value !== "object" || value === null || Array.isArray(value)) fail(code);
5893
5893
  return value;
5894
5894
  }
@@ -5938,11 +5938,11 @@ function normalizeModel(raw, id, options, budget) {
5938
5938
  if (options.availableModelIds?.has(id) !== true) fail("MISSING_POLICY");
5939
5939
  policySource = "account-available-id";
5940
5940
  } else {
5941
- if (text(field(record$2(rawPolicy, "INVALID_POLICY"), "state", budget), 64, "INVALID_POLICY", budget) !== "enabled") fail("POLICY_NOT_ENABLED");
5941
+ if (text(field(record$3(rawPolicy, "INVALID_POLICY"), "state", budget), 64, "INVALID_POLICY", budget) !== "enabled") fail("POLICY_NOT_ENABLED");
5942
5942
  policySource = "server-enabled";
5943
5943
  }
5944
- const capabilities = record$2(field(raw, "capabilities", budget), "INVALID_CAPABILITIES");
5945
- const supports = record$2(field(capabilities, "supports", budget), "INVALID_SUPPORTS");
5944
+ const capabilities = record$3(field(raw, "capabilities", budget), "INVALID_CAPABILITIES");
5945
+ const supports = record$3(field(capabilities, "supports", budget), "INVALID_SUPPORTS");
5946
5946
  const streaming = field(supports, "streaming", budget);
5947
5947
  if (streaming === false) fail("STREAMING_UNSUPPORTED");
5948
5948
  if (streaming !== true) fail("INVALID_SUPPORTS");
@@ -5963,7 +5963,7 @@ function normalizeModel(raw, id, options, budget) {
5963
5963
  if (selected === void 0) fail(unsupportedEndpointCount === 0 && endpoints.includes("ws:/responses") ? "WEBSOCKET_ONLY" : "UNSUPPORTED_ENDPOINTS");
5964
5964
  const rawLimits = field(capabilities, "limits", budget);
5965
5965
  if (rawLimits === void 0) fail("MISSING_LIMITS");
5966
- const limits = record$2(rawLimits, "INVALID_LIMITS");
5966
+ const limits = record$3(rawLimits, "INVALID_LIMITS");
5967
5967
  const maxContext = optionalPositive(limits, "max_context_window_tokens", "INVALID_LIMITS", budget);
5968
5968
  const maxInputTokens = optionalPositive(limits, "max_prompt_tokens", "INVALID_LIMITS", budget);
5969
5969
  if (maxContext === void 0 && maxInputTokens === void 0) fail("MISSING_CONTEXT_LIMIT");
@@ -5981,7 +5981,7 @@ function normalizeModel(raw, id, options, budget) {
5981
5981
  if (vision === true) {
5982
5982
  const rawVisionLimits = field(limits, "vision", budget);
5983
5983
  if (rawVisionLimits !== void 0) {
5984
- const rawMediaTypes = field(record$2(rawVisionLimits, "INVALID_VISION_LIMITS"), "supported_media_types", budget);
5984
+ const rawMediaTypes = field(record$3(rawVisionLimits, "INVALID_VISION_LIMITS"), "supported_media_types", budget);
5985
5985
  if (rawMediaTypes !== void 0) {
5986
5986
  const mediaTypes = stringList(rawMediaTypes, ACCOUNT_MODEL_CATALOG_LIMITS.maxMediaTypes, 128, "INVALID_VISION_LIMITS", budget);
5987
5987
  const mime = /^[a-z0-9][a-z0-9!#$%&'*+.^_`|~-]*\/[a-z0-9][a-z0-9!#$%&'*+.^_`|~-]*$/iu;
@@ -6041,7 +6041,7 @@ function normalizeAccountModelCatalog(raw, options = {}) {
6041
6041
  fail("INVALID_JSON", true);
6042
6042
  }
6043
6043
  }
6044
- const data = field(record$2(raw, "INVALID_CATALOG"), "data", budget);
6044
+ const data = field(record$3(raw, "INVALID_CATALOG"), "data", budget);
6045
6045
  if (!Array.isArray(data)) fail("INVALID_CATALOG");
6046
6046
  const count = field(data, "length", budget);
6047
6047
  if (typeof count !== "number" || !Number.isSafeInteger(count) || count < 0) fail("INVALID_CATALOG");
@@ -6064,7 +6064,7 @@ function normalizeAccountModelCatalog(raw, options = {}) {
6064
6064
  for (let index = 0; index < count; index++) {
6065
6065
  let id;
6066
6066
  try {
6067
- const candidate = record$2(field(data, String(index), budget), "INVALID_MODEL");
6067
+ const candidate = record$3(field(data, String(index), budget), "INVALID_MODEL");
6068
6068
  const candidateId = text(field(candidate, "id", budget), ACCOUNT_MODEL_CATALOG_LIMITS.maxIdLength, "INVALID_ID", budget);
6069
6069
  if (!identifier.test(candidateId)) fail("INVALID_ID");
6070
6070
  id = candidateId;
@@ -6495,6 +6495,25 @@ function createAccountModelSource(dependencies) {
6495
6495
  return new AccountModelSource(dependencies);
6496
6496
  }
6497
6497
  //#endregion
6498
+ //#region lib/types/agent-compaction.js
6499
+ function record$2(value) {
6500
+ return typeof value === "object" && value !== null;
6501
+ }
6502
+ /** Resolve the owning preset's service without reaching into Core's service registry. */
6503
+ function agentCompaction(agent) {
6504
+ if (typeof agent.ctx?.get !== "function") throw new LlmError("COPILOT_COMPACTION_AGENT_CONTEXT_UNAVAILABLE", "INVALID_REQUEST");
6505
+ const presets = agent.ctx.get("agentPresets");
6506
+ if (presets !== void 0) {
6507
+ if (!record$2(presets) || typeof presets.composedPreset !== "function" || typeof presets.serviceFor !== "function") throw new LlmError("COPILOT_COMPACTION_PRESET_LOOKUP_UNAVAILABLE", "INVALID_REQUEST");
6508
+ const preset = presets.composedPreset(agent.ctx);
6509
+ if (preset !== void 0) {
6510
+ if (typeof preset !== "string" || preset.trim().length === 0) throw new LlmError("COPILOT_COMPACTION_PRESET_LOOKUP_UNAVAILABLE", "INVALID_REQUEST");
6511
+ return presets.serviceFor(agent, "compaction");
6512
+ }
6513
+ }
6514
+ return agent.ctx.get("compaction");
6515
+ }
6516
+ //#endregion
6498
6517
  //#region lib/types/compaction-pressure.js
6499
6518
  function object$1(value) {
6500
6519
  return typeof value === "object" && value !== null ? value : void 0;
@@ -6541,7 +6560,7 @@ function installCopilotCompactionPressure(ctx, callbacks) {
6541
6560
  if (header === void 0 || !callConfigEquals(header.config, request)) return void 0;
6542
6561
  const budget = callbacks.resolve(request);
6543
6562
  if (budget === void 0 || !positiveInteger(budget.inputBudgetTokens)) return void 0;
6544
- const compaction = object$1(optionalService(ctx, "compaction"));
6563
+ const compaction = object$1(agentCompaction(owner));
6545
6564
  const config = object$1(compaction?.config);
6546
6565
  if (config?.auto === false) return void 0;
6547
6566
  if (config?.auto !== true || typeof compaction?.compactIfNeeded !== "function") {
@@ -7022,7 +7041,7 @@ function buildRoutingContext(ctx, agent, turn, messages, budgetPolicyConfig) {
7022
7041
  return value;
7023
7042
  };
7024
7043
  const sessionId = typeof agent.session?.id === "string" ? agent.session.id : void 0;
7025
- const compaction = ctx.get("compaction");
7044
+ const compaction = agentCompaction(agent);
7026
7045
  const compactionConfig = record(compaction) && record(compaction.config) ? compaction.config : void 0;
7027
7046
  const compactionAvailable = compaction !== void 0 && compactionConfig?.auto !== false && (typeof compactionConfig?.maxOverflowRetries !== "number" || compactionConfig.maxOverflowRetries > 0);
7028
7047
  const hasCompactionSummary = messages.some((m) => record(m) && (record(m.source) && (m.source.kind === "compaction" || m.source.kind === "compact-checkpoint") || typeof m.surfaceOp === "object"));
@@ -0,0 +1,4 @@
1
+ import type { Agent } from '@deepseek-ai/dsh-agent';
2
+ /** Resolve the owning preset's service without reaching into Core's service registry. */
3
+ export declare function agentCompaction(agent: Agent): unknown;
4
+ //# sourceMappingURL=agent-compaction.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.76",
4
+ "version": "0.4.0-alpha.77",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",