zcode-acp-server 0.88.1 → 0.89.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 +1 -1
- package/dist/code-fingerprint.json +2 -2
- package/dist/config/account-provider.d.ts.map +1 -1
- package/dist/config/account-provider.js +66 -18
- package/dist/config/account-provider.js.map +1 -1
- package/dist/config/deferred-probe-capability.d.ts +10 -1
- package/dist/config/deferred-probe-capability.d.ts.map +1 -1
- package/dist/config/deferred-probe-capability.js +41 -1
- package/dist/config/deferred-probe-capability.js.map +1 -1
- package/dist/config/start-plan-verdict.d.ts +45 -0
- package/dist/config/start-plan-verdict.d.ts.map +1 -0
- package/dist/config/start-plan-verdict.js +44 -0
- package/dist/config/start-plan-verdict.js.map +1 -0
- package/dist/handlers/account.d.ts +3 -1
- package/dist/handlers/account.d.ts.map +1 -1
- package/dist/handlers/account.js +7 -6
- package/dist/handlers/account.js.map +1 -1
- package/dist/handlers/background-tasks.d.ts +29 -0
- package/dist/handlers/background-tasks.d.ts.map +1 -1
- package/dist/handlers/background-tasks.js +97 -0
- package/dist/handlers/background-tasks.js.map +1 -1
- package/dist/handlers/replay.d.ts.map +1 -1
- package/dist/handlers/replay.js +22 -4
- package/dist/handlers/replay.js.map +1 -1
- package/dist/handlers/rewind.d.ts +55 -0
- package/dist/handlers/rewind.d.ts.map +1 -0
- package/dist/handlers/rewind.js +284 -0
- package/dist/handlers/rewind.js.map +1 -0
- package/dist/handlers/session.d.ts.map +1 -1
- package/dist/handlers/session.js +8 -0
- package/dist/handlers/session.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/quota/startplan.d.ts +24 -1
- package/dist/quota/startplan.d.ts.map +1 -1
- package/dist/quota/startplan.js +40 -2
- package/dist/quota/startplan.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +23 -1
- package/dist/server.js.map +1 -1
- package/docs/PROTOCOL.md +61 -10
- package/docs/REMOTE-CLIENTS.md +27 -0
- package/docs/TROUBLESHOOTING.md +20 -11
- package/package.json +1 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `session/edit_user_message` + `session/retry_turn` — the ACP rewind
|
|
3
|
+
* extensions (ADR-0012 in zcode-acp-app): edit-and-resend and regenerate for
|
|
4
|
+
* the latest turn, mapped onto the v4 conversation commands `editUserQuery` /
|
|
5
|
+
* `retryTurn` (spec: zcode-acp-app .zcode/docs/session-rewind-backend-
|
|
6
|
+
* requirements.md).
|
|
7
|
+
*
|
|
8
|
+
* Upstream wire facts these handlers depend on (source-verified against
|
|
9
|
+
* ~/Develop/NoBackup/ZCode @ 3.18.2):
|
|
10
|
+
* - Both commands are CAS + row-targeting: the `v4/command` envelope MUST
|
|
11
|
+
* carry `baseRevision` AND `baseLogEpoch` (command.ts
|
|
12
|
+
* COMMANDS_REQUIRING_BASE_REVISION / ROW_TARGETING_COMMANDS; the inbox
|
|
13
|
+
* rejects a missing pair and answers `proto.staleRevision` /
|
|
14
|
+
* `proto.staleLogEpoch` / `proto.staleTarget` on drift). The read-only
|
|
15
|
+
* `v4/conversation/rowsRange` response carries both values (`atRevision` /
|
|
16
|
+
* `atLogEpoch`) plus the row projection — one read provides the target and
|
|
17
|
+
* the CAS pair atomically.
|
|
18
|
+
* - Row addressing: a persisted message's `entityId` IS its store messageId
|
|
19
|
+
* (product-projection.ts `entityId = messageId ?? pendingInputId`;
|
|
20
|
+
* transcript-hydration.ts `entityId: String(message.info.id)`), i.e. the
|
|
21
|
+
* same id the bridge replays as `_meta.zcode.mid` / top-level `messageId`.
|
|
22
|
+
* - `editUserQuery` is latest-real-user-query only, `retryTurn` latest
|
|
23
|
+
* assistant row only (upstream guards `latestQueryEditOnly` /
|
|
24
|
+
* `latestAssistantRetryOnly`); the rows' `actions.canEdit` / `canRetry`
|
|
25
|
+
* flags are the same verdict the gateway will enforce, so refusing locally
|
|
26
|
+
* saves the round trip.
|
|
27
|
+
* - A `blocked` edit (unsafe workspace rewind combination) rides an ACCEPTED
|
|
28
|
+
* ack as `result.disposition: "blocked"` — checked explicitly below.
|
|
29
|
+
* - The replacement turn is started by the backend, not by a bridge
|
|
30
|
+
* `session/send`: no turn loop owns it, so its text would be silently
|
|
31
|
+
* dropped. The handler pre-claims it on the session's BackgroundTaskListener
|
|
32
|
+
* (`claimRewindTurn`) — the first `turn.started` after the claim is forwarded
|
|
33
|
+
* like a background notification turn (text deltas + busy window), and the
|
|
34
|
+
* listener's foreign-turn tracking broadcasts the running transitions.
|
|
35
|
+
*/
|
|
36
|
+
import { randomUUID } from "node:crypto";
|
|
37
|
+
import { RequestError } from "@agentclientprotocol/sdk";
|
|
38
|
+
import { ProjectionDiffer } from "../translators/projection-differ.js";
|
|
39
|
+
import { log, warn } from "../utils.js";
|
|
40
|
+
import { emitSessionTurnState } from "./io.js";
|
|
41
|
+
import { fetchMessages } from "./replay.js";
|
|
42
|
+
import { ensureRealSession } from "./session.js";
|
|
43
|
+
/** v4/command budget — the edit path includes a preempt stop barrier (the
|
|
44
|
+
* backend waits for a running turn to unwind) before the rewind cut and
|
|
45
|
+
* admission, so this is deliberately longer than steering's admission ack. */
|
|
46
|
+
const REWIND_COMMAND_TIMEOUT_MS = 60_000;
|
|
47
|
+
/** rowsRange tail window. The editable/retryable rows are latest-only, so the
|
|
48
|
+
* last window (no beforeRowId cursor) always contains them; 200 is the
|
|
49
|
+
* protocol max (PROTOCOL_V4_LIMITS.rowsRangeMaxLimit). */
|
|
50
|
+
const ROWS_RANGE_LIMIT = 200;
|
|
51
|
+
/** One stale-retry: the rowsRange read and the command admission race every
|
|
52
|
+
* other writer (a notification turn, a concurrent client) — a single refresh
|
|
53
|
+
* covers the realistic contention; more would just burn CAS round trips. */
|
|
54
|
+
const REWIND_STALE_RETRIES = 1;
|
|
55
|
+
/**
|
|
56
|
+
* Read the conversation row projection's tail window. Read-only, stateless,
|
|
57
|
+
* resend-safe upstream; a backend without the v4 face answers -32601 (older
|
|
58
|
+
* than desktop 3.14.3 — the first tag whose source tree carries the command
|
|
59
|
+
* set), which surfaces as a clean error to the caller.
|
|
60
|
+
*/
|
|
61
|
+
async function fetchRowsRange(server, zcodeSid) {
|
|
62
|
+
const backend = await server.ensureBackend();
|
|
63
|
+
const resp = await backend.request(server.nextId(), "v4/conversation/rowsRange", { sessionId: zcodeSid, limit: ROWS_RANGE_LIMIT }, 15_000);
|
|
64
|
+
if (resp.error) {
|
|
65
|
+
throw new RequestError(-32603, `rewind unavailable on this backend: ${resp.error.message ?? "rowsRange rejected"}`);
|
|
66
|
+
}
|
|
67
|
+
const result = (resp.result ?? {});
|
|
68
|
+
if (typeof result.atRevision !== "number" || typeof result.atLogEpoch !== "string") {
|
|
69
|
+
throw new RequestError(-32603, "rewind unavailable: rowsRange answered an unknown shape");
|
|
70
|
+
}
|
|
71
|
+
const rows = (result.rows ?? []).flatMap((raw) => {
|
|
72
|
+
const rowId = raw["rowId"];
|
|
73
|
+
const entityId = raw["entityId"];
|
|
74
|
+
if (typeof rowId !== "number" || typeof entityId !== "string" || !entityId)
|
|
75
|
+
return [];
|
|
76
|
+
const actions = (raw["actions"] ?? {});
|
|
77
|
+
return [
|
|
78
|
+
{
|
|
79
|
+
rowId,
|
|
80
|
+
entityId,
|
|
81
|
+
kind: typeof raw["kind"] === "string" ? raw["kind"] : "",
|
|
82
|
+
canEdit: actions["canEdit"] === true,
|
|
83
|
+
canRetry: actions["canRetry"] === true,
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
});
|
|
87
|
+
return { rows, atRevision: result.atRevision, atLogEpoch: result.atLogEpoch };
|
|
88
|
+
}
|
|
89
|
+
function rowNotFound(messageId) {
|
|
90
|
+
return new RequestError(-32602, `message ${messageId} not found in the current conversation (it may already have been rewound away)`);
|
|
91
|
+
}
|
|
92
|
+
/** The edit target: the userInput row whose entityId is the client-supplied
|
|
93
|
+
* message handle, and which the projection still marks editable. */
|
|
94
|
+
function resolveEditRow(snapshot, messageId) {
|
|
95
|
+
const row = snapshot.rows.find((r) => r.entityId === messageId);
|
|
96
|
+
if (!row)
|
|
97
|
+
throw rowNotFound(messageId);
|
|
98
|
+
if (row.kind !== "userInput" || !row.canEdit) {
|
|
99
|
+
throw new RequestError(-32602, "only the latest user message can be edited (backend guard: guard.actionUnavailable)");
|
|
100
|
+
}
|
|
101
|
+
return row;
|
|
102
|
+
}
|
|
103
|
+
/** The retry target: the client's assistant message handle, or (omitted) the
|
|
104
|
+
* newest retryable assistant row = the latest turn. */
|
|
105
|
+
function resolveRetryRow(snapshot, messageId) {
|
|
106
|
+
if (messageId) {
|
|
107
|
+
const row = snapshot.rows.find((r) => r.entityId === messageId);
|
|
108
|
+
if (!row)
|
|
109
|
+
throw rowNotFound(messageId);
|
|
110
|
+
if (row.kind !== "assistantText" || !row.canRetry) {
|
|
111
|
+
throw new RequestError(-32602, "only the latest assistant reply can be regenerated (backend guard: guard.actionUnavailable)");
|
|
112
|
+
}
|
|
113
|
+
return row;
|
|
114
|
+
}
|
|
115
|
+
const latest = [...snapshot.rows].reverse().find((r) => r.kind === "assistantText" && r.canRetry);
|
|
116
|
+
if (!latest) {
|
|
117
|
+
throw new RequestError(-32602, "no retryable turn in the current conversation");
|
|
118
|
+
}
|
|
119
|
+
return latest;
|
|
120
|
+
}
|
|
121
|
+
/** Send one v4 rewind command envelope and classify the ack. Returns the
|
|
122
|
+
* accepted ack, throws a RequestError carrying the backend's message
|
|
123
|
+
* verbatim, or returns null on a CAS-stale verdict (caller refreshes). */
|
|
124
|
+
async function sendRewindCommand(server, zcodeSid, type, payload, baseRevision, baseLogEpoch) {
|
|
125
|
+
const backend = await server.ensureBackend();
|
|
126
|
+
const envelope = {
|
|
127
|
+
commandId: randomUUID(),
|
|
128
|
+
clientId: "zcode-acp-server",
|
|
129
|
+
sessionId: zcodeSid,
|
|
130
|
+
baseRevision,
|
|
131
|
+
baseLogEpoch,
|
|
132
|
+
type,
|
|
133
|
+
payload,
|
|
134
|
+
issuedAt: Date.now(),
|
|
135
|
+
};
|
|
136
|
+
const resp = await backend.request(server.nextId(), "v4/command", envelope, REWIND_COMMAND_TIMEOUT_MS);
|
|
137
|
+
if (resp.error) {
|
|
138
|
+
throw new RequestError(-32603, `rewind failed: ${resp.error.message ?? "unknown error"}`);
|
|
139
|
+
}
|
|
140
|
+
const ack = (resp.result ?? {});
|
|
141
|
+
if (ack.status === "stale")
|
|
142
|
+
return null;
|
|
143
|
+
if (ack.status !== "accepted") {
|
|
144
|
+
const detail = ack.message ?? ack.reasonCode ?? ack.status ?? "not accepted";
|
|
145
|
+
throw new RequestError(-32603, `rewind rejected by backend: ${detail}`);
|
|
146
|
+
}
|
|
147
|
+
if (ack.result?.type === type && ack.result.disposition === "blocked") {
|
|
148
|
+
// Upstream still answers `accepted` for a blocked workspace-rewind
|
|
149
|
+
// combination — surface it as the failure it is.
|
|
150
|
+
const detail = ack.result.reasonCode ?? ack.reasonCode ?? "blocked";
|
|
151
|
+
throw new RequestError(-32603, `rewind blocked by backend: ${detail}`);
|
|
152
|
+
}
|
|
153
|
+
return ack;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Post-rewind re-baseline (best-effort): the store history was rewritten in
|
|
157
|
+
* place — the discarded branch is gone. Seed the hydration watermark like
|
|
158
|
+
* fork does (entry presence = observed-settled, so the client-triggered
|
|
159
|
+
* reload's replay read skips the generation's settle poll), and re-anchor the
|
|
160
|
+
* projection differ: its `historyAnchor` may point into the discarded branch,
|
|
161
|
+
* and a gone `afterMessageId` cursor makes the backend answer the FULL store
|
|
162
|
+
* (fetchMessages), so the next turn's diff would needlessly scan it all.
|
|
163
|
+
*/
|
|
164
|
+
async function rebaseAfterRewind(server, zcodeSid) {
|
|
165
|
+
server.hydrationWatermark.set(zcodeSid, 0);
|
|
166
|
+
// Ensure a differ exists (the rewind may be the first action on a freshly
|
|
167
|
+
// attached session) — same as the compact path — so the anchor is correct
|
|
168
|
+
// for the next turn even though no bridge turn ever ran here.
|
|
169
|
+
let differ = server.differs.get(zcodeSid);
|
|
170
|
+
if (!differ) {
|
|
171
|
+
differ = new ProjectionDiffer();
|
|
172
|
+
server.differs.set(zcodeSid, differ);
|
|
173
|
+
}
|
|
174
|
+
differ.resetTurn();
|
|
175
|
+
try {
|
|
176
|
+
const messages = await fetchMessages(server, zcodeSid);
|
|
177
|
+
if (messages.length > 0)
|
|
178
|
+
differ.markSeen(messages);
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
warn(`rewind: differ re-baseline read failed (ignored): ${e instanceof Error ? e.message : String(e)}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Shared body of both rewind methods: busy raise → target resolve → claim the
|
|
186
|
+
* replacement turn → command (one stale retry) → re-baseline. The ack returns
|
|
187
|
+
* at admission: the replacement turn runs after it, streamed to every
|
|
188
|
+
* attached client through the claimed-turn forwarding, and the busy state
|
|
189
|
+
* settles at that turn's terminal (the listener's foreign-turn tracking), so
|
|
190
|
+
* the handler must NOT settle it on the accepted path — the claim watchdog
|
|
191
|
+
* covers the accepted-but-no-turn edge.
|
|
192
|
+
*/
|
|
193
|
+
async function runRewind(server, acpSid, zcodeSid, buildRequest) {
|
|
194
|
+
const listener = await server.ensureBackgroundListener(zcodeSid);
|
|
195
|
+
let accepted = false;
|
|
196
|
+
let claimToken = null;
|
|
197
|
+
await emitSessionTurnState(server, acpSid, true);
|
|
198
|
+
try {
|
|
199
|
+
claimToken = listener.claimRewindTurn();
|
|
200
|
+
for (let attempt = 0;; attempt++) {
|
|
201
|
+
const snapshot = await fetchRowsRange(server, zcodeSid);
|
|
202
|
+
const request = buildRequest(snapshot);
|
|
203
|
+
const ack = await sendRewindCommand(server, zcodeSid, request.type, request.payload, snapshot.atRevision, snapshot.atLogEpoch);
|
|
204
|
+
if (ack) {
|
|
205
|
+
accepted = true;
|
|
206
|
+
log(`rewind ${request.type} → accepted (rewound ${request.rewoundMessageId.slice(-8)})`);
|
|
207
|
+
await rebaseAfterRewind(server, zcodeSid);
|
|
208
|
+
return { ok: true, rewoundMessageId: request.rewoundMessageId };
|
|
209
|
+
}
|
|
210
|
+
if (attempt >= REWIND_STALE_RETRIES) {
|
|
211
|
+
throw new RequestError(-32603, "rewind rejected by backend: conversation kept changing (stale)");
|
|
212
|
+
}
|
|
213
|
+
log(`rewind ${request.type} → stale projection, refreshing target and retrying`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
finally {
|
|
217
|
+
if (!accepted) {
|
|
218
|
+
// Token-guarded: a concurrent rewind that superseded our claim owns
|
|
219
|
+
// the slot now — dropping ITS claim (and busy window) from OUR failure
|
|
220
|
+
// would kill the flight still in progress. No-op when the claim already
|
|
221
|
+
// armed (token consumed) or belongs to a newer call.
|
|
222
|
+
if (claimToken !== null)
|
|
223
|
+
listener.releaseRewindClaim(claimToken);
|
|
224
|
+
// Settle only when nothing else holds the session busy: another
|
|
225
|
+
// client's turn may legitimately be running (our raise locked everyone;
|
|
226
|
+
// a blind broadcast-false would unlock it mid-flight). That turn's own
|
|
227
|
+
// lifecycle settles the state — a turn IS running, so the caller's UI
|
|
228
|
+
// reading stays truthful.
|
|
229
|
+
const busyElsewhere = [...server.pendingTurns.values()].some((t) => t.zcodeSid === zcodeSid) ||
|
|
230
|
+
server.foreignActiveTurns.has(zcodeSid) ||
|
|
231
|
+
server.notifyTurnActiveSince.has(zcodeSid);
|
|
232
|
+
if (!busyElsewhere)
|
|
233
|
+
await emitSessionTurnState(server, acpSid, false);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* `session/edit_user_message {sessionId, messageId, newText}` → v4
|
|
239
|
+
* `editUserQuery` (workspaceMode always "preserve" — file rewind stays a
|
|
240
|
+
* desktop-app concern per the spec's non-goals).
|
|
241
|
+
*/
|
|
242
|
+
export async function editUserMessage(server, params) {
|
|
243
|
+
const messageId = params.messageId;
|
|
244
|
+
const newText = params.newText;
|
|
245
|
+
if (typeof messageId !== "string" || !messageId) {
|
|
246
|
+
throw new RequestError(-32602, "edit_user_message requires messageId (the _meta.zcode.mid of a user message)");
|
|
247
|
+
}
|
|
248
|
+
if (typeof newText !== "string" || !newText.trim()) {
|
|
249
|
+
// Upstream rejects an empty replacement when the original also had no
|
|
250
|
+
// attachments/quotes; the ACP surface is text-only, so refuse early and
|
|
251
|
+
// keep the failure from burning a rewind round trip.
|
|
252
|
+
throw new RequestError(-32602, "edit_user_message requires non-empty newText");
|
|
253
|
+
}
|
|
254
|
+
const zcodeSid = await ensureRealSession(server, params.sessionId);
|
|
255
|
+
return runRewind(server, params.sessionId, zcodeSid, (snapshot) => {
|
|
256
|
+
const row = resolveEditRow(snapshot, messageId);
|
|
257
|
+
return {
|
|
258
|
+
type: "editUserQuery",
|
|
259
|
+
payload: {
|
|
260
|
+
target: { rowId: row.rowId, entityId: row.entityId },
|
|
261
|
+
newText,
|
|
262
|
+
workspaceMode: "preserve",
|
|
263
|
+
},
|
|
264
|
+
rewoundMessageId: messageId,
|
|
265
|
+
};
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* `session/retry_turn {sessionId, messageId?}` → v4 `retryTurn`. An omitted
|
|
270
|
+
* messageId retries the latest turn.
|
|
271
|
+
*/
|
|
272
|
+
export async function retryTurn(server, params) {
|
|
273
|
+
const messageId = typeof params.messageId === "string" && params.messageId ? params.messageId : undefined;
|
|
274
|
+
const zcodeSid = await ensureRealSession(server, params.sessionId);
|
|
275
|
+
return runRewind(server, params.sessionId, zcodeSid, (snapshot) => {
|
|
276
|
+
const row = resolveRetryRow(snapshot, messageId);
|
|
277
|
+
return {
|
|
278
|
+
type: "retryTurn",
|
|
279
|
+
payload: { target: { rowId: row.rowId, entityId: row.entityId } },
|
|
280
|
+
rewoundMessageId: row.entityId,
|
|
281
|
+
};
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingUR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["../../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,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,OAAO,KAAK,EAGV,YAAY,EAGb,MAAM,qBAAqB,CAAC;AA8C7B,OAAO,EAEL,eAAe,EAOf,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAiQhE;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CASvF;AAwND;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAIvD;AAqBD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAiBpD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,GAAG,CAAC,iBAA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,WAAW,EACjB,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CA6sB7B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iCAAiC,CAC/C,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACpB,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,OAAO,GACjB,OAAO,CAET;AA+DD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,OAAO,EAAE,GAAG,SAAS,EAC5B,UAAU,EAAE,KAAK,CAAC;IAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,GAAG,SAAS,GACxE,OAAO,EAAE,CASX;AA0BD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,cAAc,EACtB,EAAE,EAAE,GAAG,CAAC,YAAY,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAmBf;AA0ED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,cAAc,EACtB,EAAE,EAAE,GAAG,CAAC,YAAY,EACpB,MAAM,EAAE,MAAM,EACd,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
|
@@ -24,6 +24,7 @@ import { resolveReal } from "../backend/sandbox.js";
|
|
|
24
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
|
+
import { warmStartPlanVerdict } from "../quota/startplan.js";
|
|
27
28
|
import { noteUserActivity, pushSettled, pushSourceLabel } from "../push/push.js";
|
|
28
29
|
import { buildProviderRegistry } from "../config/provider-registry.js";
|
|
29
30
|
import { configProviderIdFor, pushAccountProviderConfig } from "../config/account-provider.js";
|
|
@@ -394,6 +395,13 @@ async function syncProviderRegistry(server, cwd) {
|
|
|
394
395
|
// models the user's config selects never reach `settings.model.available`
|
|
395
396
|
// (verified 2026-09 — switches then fail with "Provider Registry 中不存在
|
|
396
397
|
// Model"). Pushing the snapshot restores desktop parity. Best-effort.
|
|
398
|
+
//
|
|
399
|
+
// Warm the billing-authoritative Start Plan verdict first (#406): the
|
|
400
|
+
// snapshot, the dropdown and the runtime-headers answer all read it
|
|
401
|
+
// synchronously. Bounded — an offline/slow gateway leaves `unknown` and
|
|
402
|
+
// the legacy connection-selection gate decides (no credentials → no
|
|
403
|
+
// network at all).
|
|
404
|
+
await warmStartPlanVerdict();
|
|
397
405
|
await pushAccountProviderConfig(await server.ensureBackend(), () => server.nextId());
|
|
398
406
|
const registry = buildProviderRegistry();
|
|
399
407
|
if (registry.providers.length === 0) {
|