zcode-acp-server 0.85.2 → 0.86.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/README.md +3 -1
- package/dist/bin/quota.d.ts +1 -1
- package/dist/bin/quota.d.ts.map +1 -1
- package/dist/bin/quota.js +5 -20
- package/dist/bin/quota.js.map +1 -1
- package/dist/code-fingerprint.json +2 -2
- package/dist/config/options.d.ts.map +1 -1
- package/dist/config/options.js +33 -7
- package/dist/config/options.js.map +1 -1
- package/dist/config/settings.d.ts +7 -0
- package/dist/config/settings.d.ts.map +1 -1
- package/dist/config/settings.js +15 -0
- package/dist/config/settings.js.map +1 -1
- package/dist/config/user-config.d.ts +9 -8
- package/dist/config/user-config.d.ts.map +1 -1
- package/dist/config/user-config.js +7 -2
- package/dist/config/user-config.js.map +1 -1
- package/dist/handlers/account.d.ts +3 -34
- package/dist/handlers/account.d.ts.map +1 -1
- package/dist/handlers/account.js +5 -38
- package/dist/handlers/account.js.map +1 -1
- package/dist/handlers/session.d.ts.map +1 -1
- package/dist/handlers/session.js +66 -4
- package/dist/handlers/session.js.map +1 -1
- package/dist/lazy-sessions.d.ts +9 -0
- package/dist/lazy-sessions.d.ts.map +1 -1
- package/dist/lazy-sessions.js +8 -0
- package/dist/lazy-sessions.js.map +1 -1
- package/dist/quota/combined.d.ts +1 -5
- package/dist/quota/combined.d.ts.map +1 -1
- package/dist/quota/combined.js +6 -24
- package/dist/quota/combined.js.map +1 -1
- package/dist/quota/format.d.ts +0 -9
- package/dist/quota/format.d.ts.map +1 -1
- package/dist/quota/format.js +0 -19
- package/dist/quota/format.js.map +1 -1
- package/dist/quota/live.d.ts.map +1 -1
- package/dist/quota/live.js +5 -12
- package/dist/quota/live.js.map +1 -1
- package/dist/remote/hub-server.d.ts.map +1 -1
- package/dist/remote/hub-server.js +3 -7
- package/dist/remote/hub-server.js.map +1 -1
- package/dist/server.d.ts +11 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/quota/cliproxy/aggregate.d.ts +0 -48
- package/dist/quota/cliproxy/aggregate.d.ts.map +0 -1
- package/dist/quota/cliproxy/aggregate.js +0 -118
- package/dist/quota/cliproxy/aggregate.js.map +0 -1
- package/dist/quota/cliproxy/client.d.ts +0 -45
- package/dist/quota/cliproxy/client.d.ts.map +0 -1
- package/dist/quota/cliproxy/client.js +0 -140
- package/dist/quota/cliproxy/client.js.map +0 -1
- package/dist/quota/cliproxy/config.d.ts +0 -24
- package/dist/quota/cliproxy/config.d.ts.map +0 -1
- package/dist/quota/cliproxy/config.js +0 -27
- package/dist/quota/cliproxy/config.js.map +0 -1
- package/dist/quota/cliproxy/format.d.ts +0 -18
- package/dist/quota/cliproxy/format.d.ts.map +0 -1
- package/dist/quota/cliproxy/format.js +0 -71
- package/dist/quota/cliproxy/format.js.map +0 -1
- package/dist/quota/cliproxy/index.d.ts +0 -44
- package/dist/quota/cliproxy/index.d.ts.map +0 -1
- package/dist/quota/cliproxy/index.js +0 -148
- package/dist/quota/cliproxy/index.js.map +0 -1
- package/dist/quota/cliproxy/parse.d.ts +0 -46
- package/dist/quota/cliproxy/parse.d.ts.map +0 -1
- package/dist/quota/cliproxy/parse.js +0 -176
- package/dist/quota/cliproxy/parse.js.map +0 -1
- package/dist/quota/cliproxy/types.d.ts +0 -82
- package/dist/quota/cliproxy/types.d.ts.map +0 -1
- package/dist/quota/cliproxy/types.js +0 -33
- package/dist/quota/cliproxy/types.js.map +0 -1
|
@@ -9,16 +9,14 @@
|
|
|
9
9
|
* The response mirrors the CLI card's data model so clients can reproduce it
|
|
10
10
|
* exactly: one GLM section (plan level + per-window items with per-model
|
|
11
11
|
* details), one Opencode Go section (rolling/weekly/monthly windows, the
|
|
12
|
-
* relative reset countdown converted to an absolute timestamp), one Ollama
|
|
12
|
+
* relative reset countdown converted to an absolute timestamp), and one Ollama
|
|
13
13
|
* Cloud section (session/weekly/monthly fractions as percents, with the
|
|
14
|
-
* derived reset moments when available — the API itself returns none)
|
|
15
|
-
*
|
|
16
|
-
* percents with reset moments). Provider failures are reported per-section as
|
|
14
|
+
* derived reset moments when available — the API itself returns none).
|
|
15
|
+
* Provider failures are reported per-section as
|
|
17
16
|
* `kind` strings rather than throwing — the client renders the same status
|
|
18
17
|
* line the CLI would (a `not_configured` section is simply omitted, matching
|
|
19
18
|
* the CLI).
|
|
20
19
|
*/
|
|
21
|
-
import type { CpQueryResult } from "../quota/cliproxy/types.js";
|
|
22
20
|
import type { OcQueryResult } from "../quota/ollama-cloud/types.js";
|
|
23
21
|
import type { GoQueryResult, GoWindowKey } from "../quota/opencode-go/types.js";
|
|
24
22
|
import type { QuotaItem, QuotaResult } from "../quota/types.js";
|
|
@@ -76,39 +74,10 @@ export interface OcUsageStats {
|
|
|
76
74
|
windows?: OcWindowEntry[];
|
|
77
75
|
usage?: OcUsageDetail;
|
|
78
76
|
}
|
|
79
|
-
/** One window of one CLIProxy Gemini model family: usage fraction as percent. */
|
|
80
|
-
export interface CpWindowEntry {
|
|
81
|
-
window: "5h" | "week";
|
|
82
|
-
usedPercent: number;
|
|
83
|
-
resetsAt?: number;
|
|
84
|
-
}
|
|
85
|
-
/** One CLIProxy Gemini model family and its per-window usage. */
|
|
86
|
-
export interface CpModelEntry {
|
|
87
|
-
name: string;
|
|
88
|
-
windows: CpWindowEntry[];
|
|
89
|
-
}
|
|
90
|
-
/** One CLIProxy Gemini account and its per-family usage. */
|
|
91
|
-
export interface CpAccountEntry {
|
|
92
|
-
label: string;
|
|
93
|
-
models: CpModelEntry[];
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* CLIProxy section — `accounts` (per-subscription detail) and `combined`
|
|
97
|
-
* (pool-wide per-window rows across all subscriptions, the numbers the CLI
|
|
98
|
-
* card renders) present only on success, plus the count of non-Gemini
|
|
99
|
-
* accounts the proxy routes (informational tail for clients).
|
|
100
|
-
*/
|
|
101
|
-
export interface CpUsageStats {
|
|
102
|
-
kind: CpQueryResult["kind"];
|
|
103
|
-
accounts?: CpAccountEntry[];
|
|
104
|
-
combined?: CpWindowEntry[];
|
|
105
|
-
otherAccounts?: number;
|
|
106
|
-
}
|
|
107
77
|
export interface UsageStatsResult {
|
|
108
78
|
glm: GlmUsageStats;
|
|
109
79
|
opencode: GoUsageStats;
|
|
110
80
|
ollama: OcUsageStats;
|
|
111
|
-
cliproxy: CpUsageStats;
|
|
112
81
|
}
|
|
113
82
|
/** `account/usage_stats` handler — all providers, queried in parallel. */
|
|
114
83
|
export declare function accountUsageStats(): Promise<UsageStatsResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/handlers/account.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/handlers/account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhE,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,WAAW,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;iFAC6E;IAC7E,MAAM,EAAE,KAAK,CAAC;CACf;AAED,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,aAAa,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;CACtB;AAmFD,0EAA0E;AAC1E,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAOnE;AAWD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
|
package/dist/handlers/account.js
CHANGED
|
@@ -9,17 +9,15 @@
|
|
|
9
9
|
* The response mirrors the CLI card's data model so clients can reproduce it
|
|
10
10
|
* exactly: one GLM section (plan level + per-window items with per-model
|
|
11
11
|
* details), one Opencode Go section (rolling/weekly/monthly windows, the
|
|
12
|
-
* relative reset countdown converted to an absolute timestamp), one Ollama
|
|
12
|
+
* relative reset countdown converted to an absolute timestamp), and one Ollama
|
|
13
13
|
* Cloud section (session/weekly/monthly fractions as percents, with the
|
|
14
|
-
* derived reset moments when available — the API itself returns none)
|
|
15
|
-
*
|
|
16
|
-
* percents with reset moments). Provider failures are reported per-section as
|
|
14
|
+
* derived reset moments when available — the API itself returns none).
|
|
15
|
+
* Provider failures are reported per-section as
|
|
17
16
|
* `kind` strings rather than throwing — the client renders the same status
|
|
18
17
|
* line the CLI would (a `not_configured` section is simply omitted, matching
|
|
19
18
|
* the CLI).
|
|
20
19
|
*/
|
|
21
20
|
import { parseRemoteConfig } from "../remote/config.js";
|
|
22
|
-
import { aggregateCpFamilies, combinedCpWindows } from "../quota/cliproxy/aggregate.js";
|
|
23
21
|
import { queryCombined } from "../quota/combined.js";
|
|
24
22
|
/** Window labels matching the CLI's card (`5h` / `Week` / `Month`). */
|
|
25
23
|
const GO_WINDOW_LABELS = {
|
|
@@ -102,40 +100,13 @@ function toOcStats(result) {
|
|
|
102
100
|
: undefined;
|
|
103
101
|
return { kind: "success", windows, ...(usage !== undefined && { usage }) };
|
|
104
102
|
}
|
|
105
|
-
/** CLIProxy windows pass through with the 0..1 fraction converted to percent. */
|
|
106
|
-
function toCpWindowEntries(windows) {
|
|
107
|
-
return windows.map((w) => ({
|
|
108
|
-
window: w.window,
|
|
109
|
-
usedPercent: w.used * 100,
|
|
110
|
-
...(w.resetAt !== undefined && { resetsAt: w.resetAt }),
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
/** CLIProxy stats: per-account detail plus the pool-wide combined rows. */
|
|
114
|
-
function toCpStats(result, otherCount) {
|
|
115
|
-
if (result.kind !== "success")
|
|
116
|
-
return { kind: result.kind };
|
|
117
|
-
const families = aggregateCpFamilies(result.accounts);
|
|
118
|
-
return {
|
|
119
|
-
kind: "success",
|
|
120
|
-
accounts: result.accounts.map((account) => ({
|
|
121
|
-
label: account.label,
|
|
122
|
-
models: account.models.map((model) => ({
|
|
123
|
-
name: model.name,
|
|
124
|
-
windows: toCpWindowEntries(model.windows),
|
|
125
|
-
})),
|
|
126
|
-
})),
|
|
127
|
-
combined: toCpWindowEntries(combinedCpWindows(families)),
|
|
128
|
-
...(otherCount > 0 && { otherAccounts: otherCount }),
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
103
|
/** `account/usage_stats` handler — all providers, queried in parallel. */
|
|
132
104
|
export async function accountUsageStats() {
|
|
133
|
-
const { glm, go, oc
|
|
105
|
+
const { glm, go, oc } = await queryCombined("all");
|
|
134
106
|
return {
|
|
135
107
|
glm: toGlmStats(glm),
|
|
136
108
|
opencode: toGoStats(go),
|
|
137
109
|
ollama: toOcStats(oc),
|
|
138
|
-
cliproxy: toCpStats(cp, cpOtherCount),
|
|
139
110
|
};
|
|
140
111
|
}
|
|
141
112
|
/**
|
|
@@ -163,11 +134,7 @@ export async function accountUsageStatsViaHub(env = process.env) {
|
|
|
163
134
|
});
|
|
164
135
|
if (resp.ok) {
|
|
165
136
|
const body = (await resp.json());
|
|
166
|
-
|
|
167
|
-
// silently hide the section from clients. The hub auto-upgrades onto
|
|
168
|
-
// the current dist, so the skew window is short; meanwhile a local
|
|
169
|
-
// query keeps the answer complete.
|
|
170
|
-
if (body.glm && body.cliproxy)
|
|
137
|
+
if (body.glm)
|
|
171
138
|
return body;
|
|
172
139
|
}
|
|
173
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/handlers/account.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/handlers/account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAuErD,uEAAuE;AACvE,MAA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G,MAAM,KAAK,CAAC,UAAU,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,YAAY,EAAE;gBAC/E,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE;gBACpD,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC;aACjD,CAAC,CAAC;YACH,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAA8B,CAAC;gBAC9D,IAAI,IAAI,CAAC,GAAG;oBAAE,OAAO,IAAwB,CAAC;YAChD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,+CAA+C;QACjD,CAAC;IACH,CAAC;IACD,OAAO,iBAAiB,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/handlers/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAGrD,OAAO,EAAwB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,OAAO,KAAK,EAGV,YAAY,EAGb,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/handlers/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAGrD,OAAO,EAAwB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,E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,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,MAAM,EAClB,OAAO,UAAO,GACb,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
package/dist/handlers/session.js
CHANGED
|
@@ -21,18 +21,18 @@ import { backendCapabilities } from "../backend/adapter.js";
|
|
|
21
21
|
import { EventStreamListener, TurnMonitor } from "../backend/listener.js";
|
|
22
22
|
import { disallowedToolList } from "../backend/resolve.js";
|
|
23
23
|
import { resolveReal } from "../backend/sandbox.js";
|
|
24
|
-
import { buildModes, buildConfigOptions, buildInitialConfigOptions, DEFAULT_MODEL_ID, DEFAULT_PROVIDER_ID, formatModelValue, loadAllModels, modelContextWindow, parseModelValue, } from "../config/options.js";
|
|
24
|
+
import { buildModes, buildConfigOptions, buildInitialConfigOptions, DEFAULT_MODEL_ID, DEFAULT_PROVIDER_ID, formatModelValue, loadAllModels, modelContextWindow, parseModelValue, rememberModelChoice, } from "../config/options.js";
|
|
25
25
|
import { currentModelCached, emitInitialUsage } from "../config/model-cache.js";
|
|
26
26
|
import { forceRefreshQuota, scheduleQuotaDockBackstop, startQuotaRefresher, } from "../quota/live.js";
|
|
27
27
|
import { noteUserActivity, pushSettled, pushSourceLabel } from "../push/push.js";
|
|
28
28
|
import { buildProviderRegistry } from "../config/provider-registry.js";
|
|
29
29
|
import { configProviderIdFor, pushAccountProviderConfig } from "../config/account-provider.js";
|
|
30
|
-
import { initialSessionMode } from "../config/settings.js";
|
|
30
|
+
import { initialSessionMode, pinAdvertisedModel } from "../config/settings.js";
|
|
31
31
|
import { probeInitialModelCatalog } from "../config/initial-model-catalog.js";
|
|
32
32
|
import { applyModelSwitch, buildResumeRuntimeModel } from "../config/runtime-model.js";
|
|
33
33
|
import { effectiveWorkflowGate, effectiveWorkflowGateNow, ensureWorkflowPolicyPushed, filterWorkflowCommands, } from "../config/workflow-gate.js";
|
|
34
34
|
import { messages } from "../i18n.js";
|
|
35
|
-
import { lookupLazySession, lookupModelChoiceByZcodeSid, recordMaterializedSession, rememberLazySession, } from "../lazy-sessions.js";
|
|
35
|
+
import { lookupLazySession, lookupModelChoiceByZcodeSid, recordAdvertisedModel, recordMaterializedSession, rememberLazySession, } from "../lazy-sessions.js";
|
|
36
36
|
import { refreshTerminalTabTitle } from "../terminal-title.js";
|
|
37
37
|
import { isClosedSessionId } from "../closed-sessions.js";
|
|
38
38
|
import { buildDiffContent, EventTranslator, extractLocations, formatTurnError, isBackendLostError, isContentLiveDelivered, isGatewayBlipTurnError, isTransientTurnError, ProjectionDiffer, } from "../translators/index.js";
|
|
@@ -87,6 +87,19 @@ function initialCatalog(server, cwd) {
|
|
|
87
87
|
}
|
|
88
88
|
return { cached: null, flight };
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The model configOption's advertised current value, if the menu carries one.
|
|
92
|
+
*
|
|
93
|
+
* `session/new` has no backend session yet, so the current model there is a
|
|
94
|
+
* projection (`buildConfigOptions` leader / catalog-probe snapshot), not a
|
|
95
|
+
* measurement. Whoever receives it may skip its model switch on equality —
|
|
96
|
+
* the pin at materialization below uses this exact value to keep that
|
|
97
|
+
* projection true.
|
|
98
|
+
*/
|
|
99
|
+
function advertisedModelFrom(options) {
|
|
100
|
+
const model = options.find((option) => option.id === "model");
|
|
101
|
+
return model?.type === "select" ? model.currentValue : undefined;
|
|
102
|
+
}
|
|
90
103
|
/** Send only to the connection that adopted this still-unmodified placeholder. */
|
|
91
104
|
function updateInitialCatalog(server, cwd, sid, client, flight) {
|
|
92
105
|
if (!flight)
|
|
@@ -119,6 +132,14 @@ function updateInitialCatalog(server, cwd, sid, client, flight) {
|
|
|
119
132
|
await enqueueSessionSend(sid, async () => {
|
|
120
133
|
if (!valid())
|
|
121
134
|
return;
|
|
135
|
+
// The probe snapshot is the truthful current model. A client may
|
|
136
|
+
// only ever see this later menu before it prompts, so the pin at
|
|
137
|
+
// materialization must follow the LATEST advertised value.
|
|
138
|
+
const advertised = advertisedModelFrom(options);
|
|
139
|
+
if (advertised) {
|
|
140
|
+
pending.advertisedModel = advertised;
|
|
141
|
+
recordAdvertisedModel(sid, advertised);
|
|
142
|
+
}
|
|
122
143
|
await (client ?? server.clients.broadcast()).notify("session/update", {
|
|
123
144
|
sessionId: sid,
|
|
124
145
|
update: { sessionUpdate: "config_option_update", configOptions: options },
|
|
@@ -526,6 +547,12 @@ export async function newSession(server, params, client) {
|
|
|
526
547
|
const cwd = server.sessionCwds.get(bindSid) ?? process.cwd();
|
|
527
548
|
const catalog = initialCatalog(server, cwd);
|
|
528
549
|
const configOptions = await buildInitialConfigOptions(server, bindRoot, catalog.cached);
|
|
550
|
+
const boundPending = server.pendingSessions.get(bindSid);
|
|
551
|
+
const boundModel = advertisedModelFrom(configOptions);
|
|
552
|
+
if (boundPending && boundModel) {
|
|
553
|
+
boundPending.advertisedModel = boundModel;
|
|
554
|
+
recordAdvertisedModel(bindSid, boundModel);
|
|
555
|
+
}
|
|
529
556
|
updateInitialCatalog(server, cwd, bindSid, client, catalog.flight);
|
|
530
557
|
return { sessionId: bindSid, modes, configOptions };
|
|
531
558
|
}
|
|
@@ -639,6 +666,12 @@ export async function newSession(server, params, client) {
|
|
|
639
666
|
scheduleQuotaDockBackstop(server);
|
|
640
667
|
const catalog = initialCatalog(server, cwd);
|
|
641
668
|
const configOptions = await buildInitialConfigOptions(server, clientConnectionRoot(client), catalog.cached);
|
|
669
|
+
const pendingAtNew = server.pendingSessions.get(acpSid);
|
|
670
|
+
const advertisedModel = advertisedModelFrom(configOptions);
|
|
671
|
+
if (pendingAtNew && advertisedModel) {
|
|
672
|
+
pendingAtNew.advertisedModel = advertisedModel;
|
|
673
|
+
recordAdvertisedModel(acpSid, advertisedModel);
|
|
674
|
+
}
|
|
642
675
|
updateInitialCatalog(server, cwd, acpSid, client, catalog.flight);
|
|
643
676
|
return { sessionId: acpSid, modes, configOptions };
|
|
644
677
|
}
|
|
@@ -895,7 +928,7 @@ export async function ensureRealSession(server, acpSid, opts = {}) {
|
|
|
895
928
|
// the guard above already proved the record's cwd matches).
|
|
896
929
|
const cwd = server.serveMode ? process.cwd() : record.cwd;
|
|
897
930
|
const mcpServers = server.sessionMcpServers.get(acpSid);
|
|
898
|
-
pending = { cwd, mcpServers };
|
|
931
|
+
pending = { cwd, mcpServers, advertisedModel: record.advertisedModel };
|
|
899
932
|
server.pendingSessions.set(acpSid, pending);
|
|
900
933
|
if (cwd !== "/")
|
|
901
934
|
server.sessionCwds.set(acpSid, cwd);
|
|
@@ -997,6 +1030,35 @@ export async function ensureRealSession(server, acpSid, opts = {}) {
|
|
|
997
1030
|
throw new Error(`zcode refused configured model ${selected}`);
|
|
998
1031
|
}
|
|
999
1032
|
}
|
|
1033
|
+
// The pending menu advertised a model before any backend session existed
|
|
1034
|
+
// (buildConfigOptions projects the dropdown leader, or the catalog probe's
|
|
1035
|
+
// snapshot). session/create is the first moment a model really exists —
|
|
1036
|
+
// and the backend's own default can disagree with that projection (e.g.
|
|
1037
|
+
// the desktop's active account family from setting.json wins over the
|
|
1038
|
+
// bridge's dropdown leader). ACP clients may skip a requested switch when
|
|
1039
|
+
// it equals the advertised current value, so the mismatch silently ran
|
|
1040
|
+
// turns on a model nobody selected (observed with T3Code: the thread
|
|
1041
|
+
// stored a custom-provider model, the turn billed the desktop's coding
|
|
1042
|
+
// plan instead and failed 1113). Make the advertisement true: pin the
|
|
1043
|
+
// advertised model unless the env pair above or a client-recorded choice
|
|
1044
|
+
// already owns the selection. ZCODE_ACP_PIN_DEFAULT_MODEL=0 opts out.
|
|
1045
|
+
const advertised = pending.advertisedModel;
|
|
1046
|
+
if (!(pinnedProvider && pinnedModel) &&
|
|
1047
|
+
advertised &&
|
|
1048
|
+
pinAdvertisedModel() &&
|
|
1049
|
+
!server.sessionModelChoices.get(sid)) {
|
|
1050
|
+
if (await applyModelSwitch(server, sid, advertised)) {
|
|
1051
|
+
// Remember it: a setModel before the session's first input applies
|
|
1052
|
+
// in-memory only, and a later resume reverts to the workspace default
|
|
1053
|
+
// — the re-assert path needs this to restore the same model.
|
|
1054
|
+
rememberModelChoice(server, acpSid, sid, { model: advertised });
|
|
1055
|
+
log(`session/new ${acpSid}: pinned the advertised model ${advertised}`);
|
|
1056
|
+
}
|
|
1057
|
+
else {
|
|
1058
|
+
warn(`session/new ${acpSid}: could not pin the advertised model ${advertised}` +
|
|
1059
|
+
" — keeping the backend default");
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1000
1062
|
// session/create loads the session into this backend process.
|
|
1001
1063
|
server.markBackendLoaded(acpSid);
|
|
1002
1064
|
// A fresh session's store is complete (empty) by construction — seed the
|