dsh-github-copilot 0.4.0-alpha.99 → 0.4.0
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 +96 -16
- package/CHANGELOG.md +211 -0
- package/CONTRIBUTING.md +9 -0
- package/README.md +106 -18
- package/README.zh.md +97 -18
- package/deployment-baseline.json +227 -8
- package/docs/account-management-experience.md +143 -0
- package/docs/auto-high-cost.md +154 -0
- package/docs/auto-iteration-review.json +22 -0
- package/docs/auto-review-sampling.md +60 -0
- package/docs/auto-task-routing.md +8 -6
- package/docs/automatic-model-routing.md +33 -5
- package/docs/copilot-accounts.md +376 -0
- package/docs/copilot-compaction.md +23 -2
- package/docs/copilot-usage.md +24 -4
- package/docs/evidence-driven-iteration.md +86 -0
- package/docs/images/copilot-accounts-credits.png +0 -0
- package/docs/images/copilot-accounts.png +0 -0
- package/docs/images/copilot-current-provenance.json +39 -0
- package/docs/images/copilot-model-preferences.png +0 -0
- package/docs/images/copilot-search-routing.png +0 -0
- package/docs/images/copilot-session-continuation.png +0 -0
- package/docs/manual-compaction-recovery.md +50 -7
- package/docs/mockups/copilot-account-dropdown.html +71 -0
- package/docs/mockups/copilot-account-management.html +393 -0
- package/docs/model-compatibility-acceptance.md +34 -16
- package/docs/official-first-020-rc2.md +1 -0
- package/docs/plugin-diagnostics.md +452 -0
- package/docs/session-continuation.md +141 -0
- package/docs/session-search-routing.md +1 -1
- package/docs/single-route-migration.md +5 -4
- package/lib/client.js +4415 -846
- package/lib/client.js.map +1 -1
- package/lib/diagnostics-analysis-io.js +78 -0
- package/lib/diagnostics-analysis.js +425 -0
- package/lib/diagnostics-types-FVf6zjob.js +182 -0
- package/lib/index.js +10356 -6020
- package/lib/manual-compaction-recovery.js +163 -38
- package/lib/remote.js +593 -34
- package/lib/routed-web.js +1 -1
- package/lib/{search-routing-jzNYveyK.js → search-routing-CV2hs8as.js} +139 -139
- package/lib/types/account-dropdown.d.ts +22 -0
- package/lib/types/account-model-auth.d.ts +1 -1
- package/lib/types/authorization-code-clipboard.d.ts +4 -0
- package/lib/types/authorization-controller.d.ts +2 -0
- package/lib/types/auto-allocation-card.d.ts +9 -0
- package/lib/types/auto-allocation-evidence.d.ts +38 -0
- package/lib/types/auto-allocation.d.ts +24 -0
- package/lib/types/auto-model-host.d.ts +2 -0
- package/lib/types/auto-model-routing.d.ts +6 -2
- package/lib/types/auto-review-sampling.d.ts +6 -0
- package/lib/types/auto-task-classifier.d.ts +1 -1
- package/lib/types/background-compaction.d.ts +2 -2
- package/lib/types/client.d.ts +19 -3
- package/lib/types/compaction-continuation-ui.d.ts +29 -0
- package/lib/types/compaction-continuation.d.ts +48 -0
- package/lib/types/compaction-input-estimate.d.ts +24 -0
- package/lib/types/compaction-replay.d.ts +18 -0
- package/lib/types/composer-notice-style.d.ts +7 -0
- package/lib/types/config.d.ts +42 -2
- package/lib/types/context-evidence-ui.d.ts +18 -1
- package/lib/types/context-evidence.d.ts +152 -4
- package/lib/types/copilot-account-presentation.d.ts +7 -0
- package/lib/types/copilot-accounts-card.d.ts +43 -0
- package/lib/types/copilot-accounts-host.d.ts +93 -0
- package/lib/types/copilot-accounts-remote.d.ts +85 -0
- package/lib/types/copilot-accounts-types.d.ts +43 -0
- package/lib/types/copilot-auth.d.ts +3 -1
- package/lib/types/copilot-usage-card.d.ts +23 -0
- package/lib/types/copilot-usage-host.d.ts +9 -1
- package/lib/types/copilot-usage-remote.d.ts +2 -1
- package/lib/types/copilot-usage-types.d.ts +1 -0
- package/lib/types/diagnostics-analysis-io.d.ts +23 -0
- package/lib/types/diagnostics-analysis.d.ts +295 -0
- package/lib/types/diagnostics-card.d.ts +11 -0
- package/lib/types/diagnostics-client.d.ts +13 -0
- package/lib/types/diagnostics-collector.d.ts +36 -0
- package/lib/types/diagnostics-host.d.ts +72 -0
- package/lib/types/diagnostics-remote.d.ts +109 -0
- package/lib/types/diagnostics-types.d.ts +431 -0
- package/lib/types/manual-compaction-recovery.d.ts +18 -3
- package/lib/types/model-preferences-card.d.ts +1 -1
- package/lib/types/native-settings-style.d.ts +10 -0
- package/lib/types/parent-model-follow-card.d.ts +2 -11
- package/lib/types/preview-provider.d.ts +4 -0
- package/lib/types/preview-route.d.ts +7 -5
- package/lib/types/remote.d.ts +9 -6
- package/lib/types/replay-recovery-host.d.ts +2 -2
- package/lib/types/replay-recovery-ui.d.ts +3 -1
- package/lib/types/request-body-evidence.d.ts +3 -1
- package/lib/types/responses-replay-compat.d.ts +2 -1
- package/lib/types/responses-request-compression.d.ts +33 -0
- package/lib/types/session-accounts-controller.d.ts +20 -0
- package/lib/types/session-accounts-host.d.ts +33 -0
- package/lib/types/session-accounts-remote.d.ts +114 -0
- package/lib/types/session-accounts.d.ts +38 -0
- package/lib/types/session-continuation-host.d.ts +45 -0
- package/lib/types/session-continuation-remote.d.ts +22 -0
- package/lib/types/session-continuation-types.d.ts +62 -0
- package/lib/types/session-continuation-ui.d.ts +49 -0
- package/lib/types/session-continuation.d.ts +14 -0
- package/lib/types/turn-request-models.d.ts +55 -0
- package/lib/types/turn-selection-card.d.ts +15 -1
- package/lib/types/turn-selection-host.d.ts +23 -0
- package/lib/types/turn-selection-remote.d.ts +4 -0
- package/lib/types/turn-selection.d.ts +19 -4
- package/package.json +19 -3
- package/scripts/analyze-diagnostics.mjs +91 -0
- package/scripts/iteration-review.mjs +53 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"clientVersion": "0.4.0",
|
|
3
|
+
"sourceCommit": "2184b01947967d26a506152ddb48e22b14f6091f",
|
|
4
|
+
"source": "Local pnpm build from this 0.4.0 release-candidate commit; not extracted from published archive bytes. Provenance accompanies packaged image assets.",
|
|
5
|
+
"builtClientSha256": "07d531ba05df433fd287b251f396c72ed38588f32e91a4d3aab1697a077c06fc",
|
|
6
|
+
"continuationComponentBundleSha256": "36c9588371965324fb4e66e044a011cd12a5ba78ee706b8662dad902ded39e48",
|
|
7
|
+
"synthetic": true,
|
|
8
|
+
"fixture": "tests/browser/readme.html",
|
|
9
|
+
"reproduce": "pnpm build; pnpm exec tsdown --config tests/browser/capture-continuation.config.ts; node tests/browser/serve-search-routing.mjs; set PLAYWRIGHT_MODULE to an existing Playwright index.mjs; node tests/browser/capture-readme.mjs <printed-loopback-URL>",
|
|
10
|
+
"components": {
|
|
11
|
+
"copilot-model-preferences.png": "GitHubCopilotCompactAccount",
|
|
12
|
+
"copilot-accounts.png": "GitHubCopilotCompactAccount",
|
|
13
|
+
"copilot-accounts-credits.png": "CopilotUsageCard",
|
|
14
|
+
"copilot-session-continuation.png": "CopilotUsageCard + SessionContinuationCard",
|
|
15
|
+
"copilot-search-routing.png": "CopilotPluginSettingsPage"
|
|
16
|
+
},
|
|
17
|
+
"imageSha256": {
|
|
18
|
+
"copilot-model-preferences.png": "493638f95a9780bf3be4bf706e8f6f8d90b1fa4620e0e9ad5890f88da956e0a1",
|
|
19
|
+
"copilot-accounts.png": "8c19b3b5388c368908b99234aeeb8c077400ddd8dc444c742b25ad83e9b3f028",
|
|
20
|
+
"copilot-accounts-credits.png": "d6255533948cb5cdf664453d7bca4779aa648d7e7634493c2bffc2c01202f336",
|
|
21
|
+
"copilot-session-continuation.png": "0c09c879d750c5b10c11fb59d95017b8baf28819a96d78db7f2c996ad829d21e",
|
|
22
|
+
"copilot-search-routing.png": "993640f3794423a74f9e1a2b78dbc838ac6afeee065c348aff386afb101075f7"
|
|
23
|
+
},
|
|
24
|
+
"capture": {
|
|
25
|
+
"browser": "Microsoft Edge 154.0.4258.62",
|
|
26
|
+
"viewports": [
|
|
27
|
+
920,
|
|
28
|
+
375
|
|
29
|
+
],
|
|
30
|
+
"themes": [
|
|
31
|
+
"dark",
|
|
32
|
+
"light"
|
|
33
|
+
],
|
|
34
|
+
"horizontalOverflow": false,
|
|
35
|
+
"pageErrors": [],
|
|
36
|
+
"externalRequests": false
|
|
37
|
+
},
|
|
38
|
+
"limits": "Actual current built Client components with synthetic settings, identities, models and quota. SessionContinuationCard is an isolated test-only bundle of the same source component, composed through the real CopilotUsageCard prop; it is not a new package export. No live OAuth, model availability, search, billing, collection, persistence or loaded Desktop proof. Desktop images are committed; narrow/light states were checked for overflow and menu dismissal, not native Desktop integration."
|
|
39
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Oversized
|
|
1
|
+
# Oversized compaction recovery
|
|
2
2
|
|
|
3
|
-
Tracking: [#228](https://github.com/cloga/dsh-github-copilot/issues/228). Target: unchanged official DSH `0.2.0-rc.2` (`639ed015397290b3745d163aafe02ffee4aa3f84`). This document specifies a **separately selected** Host compaction engine; installing this plugin by itself does not replace a running Core engine.
|
|
3
|
+
Tracking: [#228](https://github.com/cloga/dsh-github-copilot/issues/228), [#330](https://github.com/cloga/dsh-github-copilot/issues/330). Target: unchanged official DSH `0.2.0-rc.2` (`639ed015397290b3745d163aafe02ffee4aa3f84`). This document specifies a **separately selected** Host compaction engine; installing this plugin by itself does not replace a running Core engine. Once selected, automatic segmented recovery defaults on. The historical package export and class name remain compatible.
|
|
4
4
|
|
|
5
5
|
## Requirements and failure boundary
|
|
6
6
|
|
|
@@ -10,11 +10,17 @@ Recovery must leave the original Session surface intact until a smaller *complet
|
|
|
10
10
|
|
|
11
11
|
## Composition and algorithm
|
|
12
12
|
|
|
13
|
-
`CopilotManualRecoveryCompactionEngine` is an opt-in alternative to **one** official `BasicCompactionEngine` registration. Operators selecting it must replace (not mount alongside) their existing basic compaction service in the same Host scope; the default plugin registration never changes the service. It subclasses the published engine
|
|
13
|
+
`CopilotManualRecoveryCompactionEngine` is an opt-in alternative to **one** official `BasicCompactionEngine` registration. Operators selecting it must replace (not mount alongside) their existing basic compaction service in the same Host scope; the default plugin registration never changes the service. It subclasses the published engine: Core still owns automatic triggering/retries, manual idle maintenance, a single bracketed durable transaction, balanced range selection, checkpoint framing, source-stability/shrink checks, cancellation, failure classification, flush, and optional native pruning. With an authenticated, current managed Copilot summary model, the same hook handles manual and automatic summaries. All other providers delegate unchanged. A pending model picker is not summary-route evidence: an explicit native summary target wins, then the latest committed header, then Agent options.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
`automaticRecovery` defaults to `true` in this engine's config. Set it to `false` to retain stock automatic single-summary behavior while keeping manual segmented recovery. Native `auto: false`, `maxOverflowRetries`, thresholds and model policies retain their meaning; no background command or second transaction is launched by automatic recovery. A fitting summary first uses the unchanged native single call. A known oversized input directly enters segmented recovery. Only an actual native `LlmError` with `CONTEXT_WINDOW_EXCEEDED` from that first single summary permits one fallback. Its planning bound halves the partitionable history while retaining the fixed system head/tools and enough space for the largest balanced unit, never exceeding the original bound. If that requires the entire rejected input, fail as indivisible instead of resubmitting it unchanged. A segment failure is never recursively retried. HTTP 408, timeout, auth, quota, network, cancellation, empty or truncated output do not authorize fallback.
|
|
16
16
|
|
|
17
|
-
The
|
|
17
|
+
The plugin's account service supplies a current descriptor and a revocable proof for the explicit initiating Agent, not another Session or today's global account. Each physical summary uses public initiator scoping; no credential discovery or Client credential reads are added. Account/selection changes revoke the proof. The summary budget uses `min(maxInputTokens, contextWindow - configuredOutputCap) - safetyTokens`; an additional 4096-token allowance covers Core's appended directive and estimation variance, and actual tool-history bytes are reserved separately. Each candidate is planned using conservative serialized UTF-8 **model-content bytes**: role/content, tool-result call ID/error state, tool schemas, the system head and prior intermediate checkpoint. Native message IDs, source/provenance and opaque replay envelopes are not serialized or charged by this planner. They previously inflated segment counts despite not being ordinary prompt content, causing otherwise compressible histories to exhaust 16 calls.
|
|
18
|
+
|
|
19
|
+
This is not provider-exact token accounting or a complete wire-size bound. The original messages, sources and replay are still passed unchanged to the published adapter; existing consent alone controls outgoing replay filtering. The final native managed-route guard prices converted replay, images and the complete request and remains authoritative. A segment that still exceeds that guard fails; it is never recursively retried or rewritten. Excluding metadata from planning neither bypasses admission nor authorizes additional loss.
|
|
20
|
+
|
|
21
|
+
The hook partitions the *original* span only at balanced boundaries, summarizes each part through `super.summarize`, and supplies the previous completed intermediate checkpoint as context for the next call. Thus the last completed summary contains all processed parts in chronological order. The engine allows at most 16 physical summary calls per hook invocation, including any initial capacity failure (the exported helper's hard maximum remains 32). Each carries the native cancellation signal and checks account proof before and after dispatch. The original surface is not modified between calls. Core checks for a smaller replacement and current source after the final result; any failure closes the native marker without a partial summary replacement. Native pruning that already committed remains Core-owned. Native automatic retry/rebuild resumes the task only after a valid durable reduction.
|
|
22
|
+
|
|
23
|
+
Segmented recovery can take longer and incur additional provider charges. A sanitized Host log announces entry and its call bound; the Client keeps native compaction progress and cancellation, not a fabricated per-segment progress bar. The native transaction result remains the success evidence.
|
|
18
24
|
|
|
19
25
|
## Background command for Desktop
|
|
20
26
|
|
|
@@ -24,6 +30,7 @@ With this engine selected and the public `commands` and `jobs` services availabl
|
|
|
24
30
|
/copilot-compact
|
|
25
31
|
/copilot-compact status
|
|
26
32
|
/copilot-compact cancel
|
|
33
|
+
/copilot-compact visible-history
|
|
27
34
|
```
|
|
28
35
|
|
|
29
36
|
The jobs package is a development-only type dependency: the plugin imports no jobs runtime implementation, and the engine's public declaration does not expose its types. Runtime access is through the optionally injected Host service; no jobs package is bundled, installed as a new peer, or registered by this plugin.
|
|
@@ -32,9 +39,35 @@ The first command acknowledges **job admission**, not a completed summary. The e
|
|
|
32
39
|
|
|
33
40
|
Status and cancellation apply only to the invoking Agent's latest job. Duplicate starts return the current running job rather than starting another transaction. The selected engine still acquires Core's maintenance lock and owns the only native transaction; another active turn or compaction can cause the admitted job to fail. Job status distinguishes running, completed, failed and cancelled work. Failure details are sanitized; consult the native compaction/end record for the underlying summary/transaction diagnostic. Provider timeout, truncation, capacity and account-proof failures remain failures.
|
|
34
41
|
|
|
42
|
+
### Explicit visible-history summary recovery
|
|
43
|
+
|
|
44
|
+
For a verified `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH`, repeating the same summary cannot repair supplier-scoped encrypted replay. The existing **Visible-history continuation** Session policy now authorizes managed Responses summaries as well as chat: ordinary `/compact`, `/copilot-compact` and automatic compaction apply it before dispatch, without a failure-first retry or extra command. The active turn retains its captured persistent policy; idle summaries capture the Session policy. Disabled/unknown policy never silently enables loss, and legacy next-turn-only consent does not authorize summaries. Stock and selected recovery engines remain independently owned. An additive composer notice reports filtering and distinguishes native commit, failure and cancellation; exact scope rejection when off offers the same persistent enable control. This is not a capacity/timeout/quota cure or permission to enable an absent engine.
|
|
45
|
+
|
|
46
|
+
For an existing open Session on the managed account-discovered Copilot route,
|
|
47
|
+
the persistent control is in the composer **Credits/usage** popover: expand
|
|
48
|
+
**Visible-history continuation**, review the loss disclosure, then choose
|
|
49
|
+
**On** under **Session policy**. The control is not shown for the
|
|
50
|
+
canonical/native route. Enabling applies to subsequent turns and summaries in
|
|
51
|
+
that Session even when the account does not change; an already admitted turn
|
|
52
|
+
keeps its captured policy. The **New Session continuation default** in Models
|
|
53
|
+
is separate and only determines inheritance for eligible new Sessions. See
|
|
54
|
+
[the synthetic composer capture](./images/copilot-session-continuation.png) and
|
|
55
|
+
[Session continuation](./session-continuation.md) for the complete admission,
|
|
56
|
+
scope and persistence contract.
|
|
57
|
+
|
|
58
|
+
`/copilot-compact visible-history` remains explicit consent for **one lossy manual compaction operation** through the selected engine, without changing the persistent checkbox. Managed Responses summary requests omit historical encrypted reasoning items **and their embedded summaries**, while retaining visible messages, tool calls/results, the system head and native final directive. Hidden reasoning may contain details absent from visible messages. Review this loss before enabling the policy or issuing the one-time command.
|
|
59
|
+
|
|
60
|
+
Consent is local to the native summarizer's exact cancellation signal, Session and summary model, including its bounded segments. It is revoked on completion, failure, cancellation or teardown. No unrelated request, subsequent command or automatic retry inherits it. Unknown or incomplete reasoning fails closed. No replay is decrypted, fabricated or written back; original source events remain unchanged and only Core can commit the final smaller checkpoint. The command adds no retry or model/account switch, and does not repair supplier scope. Missing managed integration or an unsupported summary route fails explicitly.
|
|
61
|
+
|
|
62
|
+
The conservative content estimate still includes visible native history before outgoing filtering, but not source/replay metadata. Giant indivisible units, fixed prefixes, native admission, bounded-work/call limits, truncation and failure to shrink can still prevent recovery. This command is not guaranteed to rescue every history, and summary calls may incur charges. Installation alone neither selects the engine nor runs this command.
|
|
63
|
+
|
|
64
|
+
The visible-history composer notice keeps running loss disclosure visible. A confirmed native completion is shown for a fixed eight seconds from the first current Client read, not from a rerender or later read. Success may also be closed early; failed/cancelled/unavailable and blocked enable prompts never auto-expire and have a localized, keyboard-accessible **Close**. The existing blocked prompt **Cancel** also hides only the notice. Neither action changes persistent consent, invokes recovery, sends/retries, or changes native outcome evidence/history. A dismissal applies only to the exact Session, operation and status, never a later running/failed state. Expiry/dismissal survives incidental remounts and Session switches in a Client registration-owned FIFO of at most 128 records; teardown clears it, and an evicted record may be shown again. No disk or module-global cache is used. Component timers stop on unmount/Session changes; departed reads cannot start a lifetime or publish stale status. This transient presentation is not proof of the subsequent chat request succeeding.
|
|
65
|
+
|
|
66
|
+
Background status now exposes only allowlisted fixed failure codes through bounded native Error cause chains, including replay-scope rejection; raw exception text, response bodies and history remain excluded. Unknown failures retain `COPILOT_BACKGROUND_COMPACTION_FAILED` with guidance to the native `compaction/end` record. An admission receipt is not success; check status and the native transaction.
|
|
67
|
+
|
|
35
68
|
The plugin collects the job's native settlement with `jobs.wait`, so the ordinary job reporter does not wake the model or resume its Goal. It never calls followup or inject. Explicit cancellation, owner disposal and plugin/Host teardown cancel and drain the producer. Owner teardown can fail native maintenance before the job receives cancellation; that outcome remains failed rather than being relabeled successful or cancelled. Jobs are process-local: status does not survive a Host restart, and the plugin does not silently restart interrupted work. Durable Core compaction events remain the outcome evidence. Merely installing the main plugin does not select this engine or make this command available; missing commands/jobs services leave the background entry unavailable without changing ordinary compaction.
|
|
36
69
|
|
|
37
|
-
**Audit:** each physical call goes through Core's public `llm.stream` seam with its actual route/cap. The final native summary event is intentionally *unmarked* (`llmStreamCall` absent), not a fabricated claim of one call. It records summed provider-reported usage only when **every** underlying call supplied usage; optional counters are included only if present on every call. The native event format has no per-call array or durable per-call transcript in a single summary event; do not infer individual request accounting from that aggregate. This is a real observability limit of the unchanged public contract.
|
|
70
|
+
**Audit:** each physical call goes through Core's public `llm.stream` seam with its actual route/cap. The final native summary event is intentionally *unmarked* (`llmStreamCall` absent), not a fabricated claim of one call. It records summed provider-reported usage only when **every** underlying call supplied usage; optional counters are included only if present on every call. After a failed initial single call, aggregate usage is omitted because this hook cannot recover that call's complete accounting. The native event format has no per-call array or durable per-call transcript in a single summary event; do not infer individual request accounting from that aggregate. This is a real observability limit of the unchanged public contract.
|
|
38
71
|
|
|
39
72
|
This aggregate is not per-call attribution: it cannot reconstruct which intermediate request used which tokens, identify each physical response, or prove that native call-attribution consumers count every intermediate request. The plugin does not manufacture `llmStreamCall`, response IDs, or individual durable usage records to fill that gap. Reported aggregate provider usage and Core's native call-attribution/accounting are separate evidence layers.
|
|
40
73
|
|
|
@@ -42,7 +75,7 @@ This aggregate is not per-call attribution: it cannot reconstruct which intermed
|
|
|
42
75
|
|
|
43
76
|
The exact rc.2 `llm-pi-ai` public adapter converts both plain and replay-backed historical assistant messages with `emptyPiUsage()` and `timestamp: 0` (`replay.ts`); converted user messages, including new intermediate checkpoints, also have timestamp zero (`context.ts`). Therefore creating a checkpoint **does not** invalidate an old SDK usage anchor through a newer timestamp. On this pin, Core does not carry the historical assistant usage into the SDK context in the first place. Recovery neither clears that usage itself nor changes message timestamps, replay state, native conversion, the SDK estimator or the final managed guard. This behavior must be requalified when the Core/pi-ai pin changes.
|
|
44
77
|
|
|
45
|
-
The unchanged-Core fixture exercises the real managed adapter and its `inspectRequest` guard with a synthetic 27-turn history whose latest provider-reported input is 508,198 tokens.
|
|
78
|
+
The unchanged-Core fixture exercises the real managed adapter and its `inspectRequest` guard with a synthetic 27-turn history whose latest provider-reported input is 508,198 tokens, plus 3.5 KB of synthetic native provenance/replay padding per assistant. The old whole-message planner exhausted exactly 16 calls on this metadata-heavy fixture without replacement. The content planner first proves stock manual compaction fails the 12,000-token input bound without reaching the synthetic wire, then proves the opt-in engine commits one replacement through bounded calls. The captured SDK estimates include the complete native compaction directive, system policy and tool schemas, not a prompt with its final directive removed. Every dispatched estimate fits the hard limit; the 8,192 output cap is preserved, source events remain byte-identical, and every intermediate wire call observes the original surface generation. Estimator instrumentation calls the original SDK utility without altering its result. The fixture verifies zero carried usage anchors, aggregate usage and the deliberately absent single-call marker. Synthetic scaled-down input limits and transport establish native admission/transaction behavior, not provider-exact capacity or live Copilot success.
|
|
46
79
|
|
|
47
80
|
## Limitations and operational use
|
|
48
81
|
|
|
@@ -59,6 +92,16 @@ Select the exported `dsh-github-copilot/manual-compaction-recovery` Host class *
|
|
|
59
92
|
|
|
60
93
|
Keep the existing BasicCompactionConfig, including any modelPolicies and actual maxTokens; configure a summary route deliberately if the last committed model cannot serve the summary. Do not enable two compaction services or modify a live profile without explicit approval. The normal plugin and all ordinary sessions remain usable without this replacement; the package export alone neither installs it nor changes an existing Session.
|
|
61
94
|
|
|
95
|
+
### Explicit configuration migration
|
|
96
|
+
|
|
97
|
+
1. With separately approved profile maintenance, inspect the effective Host composition and the initiating Agent's bound preset. Identify exactly one stock basic engine in the intended scope; an absent or custom engine is not a migration target.
|
|
98
|
+
2. In the owning configuration, replace only that row's `name` with `dsh-github-copilot/manual-compaction-recovery`. Preserve its id, group, isolation, disabled state and full config, including `auto: false`, retention, caps, retry limits and exact model policies. Keep the native compact command and tool-result pruner. Do not add a second row.
|
|
99
|
+
3. For a native preset, edit its owned `config.plugins` entry in the native preset editor, preserving the surrounding plugins. Do not replace the whole preset with a stock template. A global engine replacement does not change engines isolated in presets.
|
|
100
|
+
4. Review the resulting diff and reload only through approved normal Host/preset maintenance. Existing Agents may retain the older preset generation; verify their actual bound service rather than assuming a setting change moved them. Set `automaticRecovery: false` on the replacement to disable only automatic segmentation.
|
|
101
|
+
5. To roll back, restore that row's stock name and remove only the plugin-owned `automaticRecovery` key. Keep the original native config. Already committed native summaries are not reversed.
|
|
102
|
+
|
|
103
|
+
Do not try to change an existing plugin name with the bundle include patch's `name` field: on rc.2 it is a matching guard, not a replacement. Include patches also do not traverse arbitrary preset `config.plugins`. This release intentionally supplies no automatic live migration, full-preset overwrite, service interception or Core patch. Native isolated-preset fixtures verify the selected replacement, unchanged native config and the disabled/absent/no-retry cases; they are not live deployment receipts.
|
|
104
|
+
|
|
62
105
|
## Acceptance and retirement
|
|
63
106
|
|
|
64
107
|
Focused tests must exercise oversized balanced histories, native durable replacement and no replacement on cancellation, truncation, stale source or proof, irreducible units and bounded-call exhaustion. Verify the exact published Core source fixture, frozen install, full plugin gate and immutable package smoke before describing a deployable release. CI with synthetic transport proves no live Copilot availability. Retire this companion path only when official compaction safely handles independent prompt ceilings and multi-call/manual recovery with equivalent durable audit, lifecycle and transaction guarantees.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
5
|
+
<title>账号切换 · Approved Dropdown Mock</title>
|
|
6
|
+
<style>
|
|
7
|
+
:root{color-scheme:dark;--bg:#202020;--panel:#2b2b2b;--popup:#333;--line:#505050;--text:#f2f2f2;--muted:#c0c0c0;--hover:#414141}
|
|
8
|
+
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.55 system-ui,"Segoe UI",sans-serif;padding:28px}
|
|
9
|
+
button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;background:transparent;border:1px solid var(--line);border-radius:8px;padding:8px 14px}button:hover{background:var(--hover)}button:focus-visible,summary:focus-visible,textarea:focus-visible{outline:2px solid #aacfff;outline-offset:3px}
|
|
10
|
+
button:disabled{opacity:.5;cursor:default}[hidden]{display:none!important}h1{font-size:18px;margin:0}h2{font-size:16px;margin:0 0 12px}p{color:var(--muted);margin:8px 0}small{color:var(--muted);font-size:12px}
|
|
11
|
+
.preview{max-width:840px;margin:auto}.preview-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:22px}.tabs{display:flex;gap:6px}.tabs button[aria-pressed=true]{background:var(--hover)}
|
|
12
|
+
.provider{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:22px}.provider-head,.account-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.provider-head strong{font-size:19px}.provider-head small{margin-left:10px}.manage{border-top:1px solid var(--line);margin-top:20px;padding-top:22px}
|
|
13
|
+
.account-row{position:relative;margin:16px 0}.identity strong{font-size:17px;display:block}.identity small{display:block;margin-top:2px}.switch{white-space:nowrap}.caret{font-size:11px;margin-left:9px}.account-menu{position:absolute;right:0;top:calc(100% + 8px);width:min(300px,100%);z-index:5;background:var(--popup);border:1px solid #666;border-radius:10px;box-shadow:0 10px 28px #0006;padding:5px}
|
|
14
|
+
.options{max-height:228px;overflow:auto;overscroll-behavior:contain}.option{width:100%;display:flex;align-items:center;gap:10px;text-align:left;border:0;padding:10px;border-radius:5px;min-height:46px}.check{width:18px;flex-shrink:0;color:#c7ddff}.option .name{flex:1;min-width:0;overflow-wrap:anywhere}.option small{display:block}.add{border-top:1px solid var(--line);margin-top:5px;padding-top:5px}.add button{width:100%;text-align:left;border:0}.account-actions{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.quiet{border:0;color:var(--muted);padding-left:0;padding-right:8px}.danger{color:#ffb8b8}
|
|
15
|
+
details{margin-top:18px}summary{cursor:pointer}label{display:flex;align-items:center;gap:9px;margin:12px 0}input{accent-color:#c7ddff}.preferences{border-top:1px solid var(--line);margin-top:24px;padding-top:22px}.model{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}.model button{font-size:12px;padding:5px 10px}.caption{margin-top:20px;font-size:12px}.status{min-height:22px;font-size:12px;color:#c7ddff;margin-top:12px}
|
|
16
|
+
.chat{min-height:490px;display:flex;flex-direction:column}.messages{flex:1;padding:20px 0}.message{max-width:75%;padding:12px 16px;background:var(--panel);border-radius:12px;margin-bottom:20px}.message.user{margin-left:auto;background:#373737}.composer{border:1px solid var(--line);border-radius:12px;padding:14px}.composer textarea{width:100%;min-height:60px;resize:vertical;border:0;background:none;outline-offset:0}.toolbar{display:flex;justify-content:space-between;color:var(--muted)}.credits{display:flex;justify-content:flex-end;margin-top:8px}.chat-panel{width:min(410px,100%);margin:10px 0 0 auto;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:18px}.chat-panel .account-row{margin-top:0}.chat-panel .account-menu{top:auto;bottom:calc(100% + 8px)}
|
|
17
|
+
dialog{width:min(420px,calc(100% - 32px));background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:12px;padding:24px}dialog::backdrop{background:#0008}.dialog-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}
|
|
18
|
+
@media(max-width:520px){body{padding:16px}.preview-head{align-items:flex-start;flex-direction:column}.provider{padding:16px}.provider-head{align-items:flex-start}.provider-head small{display:block;margin:4px 0 0}.message{max-width:90%}.account-actions{gap:4px}.chat{min-height:450px}}
|
|
19
|
+
</style>
|
|
20
|
+
<div class="preview">
|
|
21
|
+
<header class="preview-head"><div><h1>账号切换 · 简化版</h1><small>交互 Mock · 全部为虚构数据,不操作真实账号</small></div><nav class="tabs" aria-label="预览页面"><button id="models-tab" aria-pressed="true">Models</button><button id="chat-tab" aria-pressed="false">Chat</button></nav></header>
|
|
22
|
+
<section id="models" class="provider">
|
|
23
|
+
<div class="provider-head"><div><strong>GitHub Copilot</strong><small>Signed in · 19 models</small></div><button id="manage-button" aria-expanded="true">Manage</button></div>
|
|
24
|
+
<div class="manage" id="manage">
|
|
25
|
+
<h2>账号管理</h2><p>选择全局默认账号。已有 Session 的显式选择不变。</p>
|
|
26
|
+
<div class="account-row"><div class="identity"><strong id="global-name">@demo-personal</strong><small>全局默认账号</small></div><button class="switch" id="models-switch" aria-expanded="false" aria-controls="models-menu">切换<span class="caret">▾</span></button>
|
|
27
|
+
<div id="models-menu" class="account-menu" hidden><div class="options" aria-label="全局默认账号"></div><div class="add"><button data-add>+ 添加账号</button></div></div></div>
|
|
28
|
+
<div class="account-actions"><button data-action="刷新账号信息">刷新账号信息</button><button data-action="重新授权">重新授权</button><button class="quiet danger" id="remove">删除账号</button></div>
|
|
29
|
+
<details><summary>新 Session 续聊默认</summary><label><input type="checkbox" checked>默认开启有损续聊</label><p><small>新轮次省略旧加密推理及其内嵌摘要;可见消息、工具记录和磁盘历史不变。仅影响新 Session,不自动发送或重试。</small></p></details>
|
|
30
|
+
<section class="preferences"><h2>模型偏好</h2><p><small>偏好跨账号共享;可用性按当前账号验证。</small></p><div class="model"><span>GPT-6.1 Sol <small>· 可用</small></span><button data-model>排除</button></div><div class="model"><span>Claude Sonnet <small>· 可用</small></span><button data-model>排除</button></div><div class="model"><span>Gemini Pro <small>· 当前账号不可用</small></span><button data-model>排除</button></div></section>
|
|
31
|
+
</div>
|
|
32
|
+
</section>
|
|
33
|
+
<section id="chat" class="chat" hidden>
|
|
34
|
+
<div class="messages"><div class="message user">继续完善账号切换的交互。</div><div class="message">保留当前账号,点击「切换」后用一个紧凑下拉菜单选择,不再展开搜索表单。</div></div>
|
|
35
|
+
<div class="composer"><textarea aria-label="模拟消息" placeholder="输入消息…(仅模拟)"></textarea><div class="toolbar"><span>+ Full access ▾</span><span>Auto ▾ ↑</span></div></div>
|
|
36
|
+
<div class="credits"><button id="credits">Credits · <span id="credits-name">@demo-personal</span> ▾</button></div>
|
|
37
|
+
<div class="chat-panel" id="chat-panel">
|
|
38
|
+
<div class="account-row"><div class="identity"><strong id="session-name">@demo-personal</strong><small>本 Session 账号</small></div><button class="switch" id="chat-switch" aria-expanded="false" aria-controls="chat-menu">切换<span class="caret">▾</span></button>
|
|
39
|
+
<div id="chat-menu" class="account-menu" hidden><div class="options" aria-label="本 Session 账号"></div><div class="add"><button data-add>+ 添加账号</button></div></div></div>
|
|
40
|
+
<details><summary>本 Session 有损续聊 · 开启</summary><label><input id="session-policy" type="checkbox" checked>持续开启</label><p><small>每轮省略旧加密推理及内嵌摘要;可见历史不变。不自动发送或重试。</small></p></details>
|
|
41
|
+
<button class="quiet" id="simulate-rejection">模拟旧推理被拒绝</button>
|
|
42
|
+
</div>
|
|
43
|
+
</section>
|
|
44
|
+
<p id="status" class="status" role="status" aria-live="polite"></p>
|
|
45
|
+
<footer class="caption">点击「切换」查看菜单。无搜索框,无逐账号 Switch 按钮;当前账号打勾,长列表内部滚动。<button class="quiet" id="many">模拟 24 个账号</button></footer>
|
|
46
|
+
</div>
|
|
47
|
+
<dialog id="dialog"><h2 id="dialog-title"></h2><p id="dialog-copy"></p><div id="dialog-actions" class="dialog-actions"></div></dialog>
|
|
48
|
+
<script>
|
|
49
|
+
const $=id=>document.getElementById(id);
|
|
50
|
+
let accounts=['@demo-personal','@demo-work','@demo-backup'],globalAccount=accounts[0],sessionAccount=accounts[0],lastTrigger;
|
|
51
|
+
function notice(text){$('status').textContent=text}
|
|
52
|
+
function closeMenus(){for(const scope of ['models','chat']){$(scope+'-menu').hidden=true;$(scope+'-switch').setAttribute('aria-expanded','false')}}
|
|
53
|
+
function dialog(title,copy,actions){closeMenus();$('dialog-title').textContent=title;$('dialog-copy').textContent=copy;$('dialog-actions').replaceChildren();for(const [label,action] of actions){const b=document.createElement('button');b.textContent=label;b.onclick=()=>{$('dialog').close();action?.()};$('dialog-actions').append(b)}$('dialog').showModal()}
|
|
54
|
+
$('simulate-rejection').onclick=()=>dialog('旧推理回放被拒绝',$('session-policy').checked?'本 Session 已开启降级续聊,请另行使用原生重试。如果仍被拒绝,请查看技术诊断或新建会话;不重复授权或自动重试。':'降级续聊省略旧加密推理及内嵌摘要,保留可见消息、工具记录和磁盘历史;可能损失隐含细节。开启后在本 Session 持续生效,跨账号和重启保留,直到关闭。不会自动重试。',$('session-policy').checked?[['关闭提示']]:[['开启降级续聊',()=>{$('session-policy').checked=true;render();notice('模拟:持久策略已开启,请另行点击原生重试。没有发送消息。')}],['取消']]);
|
|
55
|
+
function render(){for(const scope of ['models','chat']){const list=$(scope+'-menu').querySelector('.options'),current=scope==='models'?globalAccount:sessionAccount;list.replaceChildren();for(const account of accounts){const b=document.createElement('button');b.className='option';b.setAttribute('aria-pressed',String(account===current));const check=document.createElement('span');check.className='check';check.textContent=account===current?'✓':'';check.setAttribute('aria-hidden','true');const name=document.createElement('span');name.className='name';name.textContent=account;b.append(check,name);if(account===current){const tag=document.createElement('small');tag.textContent='当前';b.append(tag)}b.onclick=()=>{if(scope==='chat'&&!$('session-policy').checked&&account!==current){dialog('切换账号前确认','有损续聊会省略旧加密推理及其内嵌摘要。可见消息、工具记录和磁盘历史不变。授权不会自动发送或重试。',[['开启并切换',()=>{$('session-policy').checked=true;choose(scope,account)}],['保持关闭并切换',()=>choose(scope,account)],['取消']])}else choose(scope,account)};list.append(b)}}$('global-name').textContent=globalAccount;$('session-name').textContent=sessionAccount;$('credits-name').textContent=sessionAccount;$('session-policy').closest('details').querySelector('summary').textContent='本 Session 有损续聊 · '+($('session-policy').checked?'开启':'关闭')}
|
|
56
|
+
function choose(scope,account){if(scope==='models')globalAccount=account;else sessionAccount=account;closeMenus();render();notice('模拟:'+(scope==='models'?'全局默认':'本 Session')+'已切换至 '+account+';没有发送消息。');lastTrigger?.focus()}
|
|
57
|
+
for(const scope of ['models','chat'])$(scope+'-switch').onclick=()=>{const open=$(scope+'-menu').hidden;closeMenus();lastTrigger=$(scope+'-switch');$(scope+'-menu').hidden=!open;lastTrigger.setAttribute('aria-expanded',String(open));if(open)$(scope+'-menu').querySelector('.option').focus()};
|
|
58
|
+
document.addEventListener('click',e=>{if(!e.target.closest('.account-row'))closeMenus()});
|
|
59
|
+
document.addEventListener('keydown',e=>{const menu=e.target.closest('.account-menu');if(e.key==='Escape'){closeMenus();lastTrigger?.focus()}if(menu&&['ArrowDown','ArrowUp','Home','End'].includes(e.key)){const buttons=Array.from(menu.querySelectorAll('button'));let index=buttons.indexOf(document.activeElement);index=e.key==='Home'?0:e.key==='End'?buttons.length-1:(index+(e.key==='ArrowDown'?1:-1)+buttons.length)%buttons.length;buttons[index].focus();e.preventDefault()}});
|
|
60
|
+
for(const page of ['models','chat'])$(page+'-tab').onclick=()=>{closeMenus();for(const p of ['models','chat']){$(p).hidden=p!==page;$(p+'-tab').setAttribute('aria-pressed',String(p===page))}notice('')};
|
|
61
|
+
$('manage-button').onclick=()=>{$('manage').hidden=!$('manage').hidden;$('manage-button').setAttribute('aria-expanded',String(!$('manage').hidden))};
|
|
62
|
+
$('credits').onclick=()=>{$('chat-panel').hidden=!$('chat-panel').hidden;closeMenus()};
|
|
63
|
+
$('session-policy').onchange=render;
|
|
64
|
+
$('many').onclick=()=>{accounts=accounts.slice(0,3);for(let n=4;n<=24;n++)accounts.push('@demo-account-'+n);render();notice('已模拟 24 个账号。打开菜单后在内部滚动。')};
|
|
65
|
+
document.querySelectorAll('[data-add]').forEach(b=>b.onclick=()=>dialog('添加账号','正式功能将进入 GitHub 授权。这里仅模拟添加,不访问网络,也不会自动切换账号。',[['模拟授权完成',()=>{accounts.push('@demo-new-'+accounts.length);render();notice('已添加模拟账号,当前账号不变。')}],['取消']]));
|
|
66
|
+
document.querySelectorAll('[data-action]').forEach(b=>b.onclick=()=>notice('模拟:'+b.dataset.action+',未执行网络请求。'));
|
|
67
|
+
document.querySelectorAll('[data-model]').forEach(b=>b.onclick=()=>{b.textContent=b.textContent==='排除'?'恢复':'排除';notice('仅修改模拟偏好。')});
|
|
68
|
+
$('remove').onclick=()=>dialog('删除 '+globalAccount+'?','当前全局默认账号不能直接删除。请先切换至其他账号;这里不会删除真实账号或凭据。',[['知道了']]);
|
|
69
|
+
render();
|
|
70
|
+
</script>
|
|
71
|
+
</html>
|