koneck 2.76.0 → 2.76.2
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/dist/engine.d.ts +12 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +61 -3
- package/dist/engine.js.map +1 -1
- package/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +31 -1
- package/dist/ink-chat.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/web/events.d.ts +11 -0
- package/dist/web/events.d.ts.map +1 -1
- package/dist/web/events.js.map +1 -1
- package/dist/web/sessions.d.ts.map +1 -1
- package/dist/web/sessions.js +1 -0
- package/dist/web/sessions.js.map +1 -1
- package/dist/web/ui-client.d.ts.map +1 -1
- package/dist/web/ui-client.js +11 -0
- package/dist/web/ui-client.js.map +1 -1
- package/package.json +1 -1
package/dist/engine.d.ts
CHANGED
|
@@ -281,6 +281,18 @@ export interface AgentSession {
|
|
|
281
281
|
* just chose "low" because they are waiting means by it.
|
|
282
282
|
*/
|
|
283
283
|
setPace(pace: Pace): void;
|
|
284
|
+
/**
|
|
285
|
+
* The provider and model actually in use, now.
|
|
286
|
+
*
|
|
287
|
+
* Not the ones the session was created with. Failover replaces them mid-run, and everything that
|
|
288
|
+
* reported them read the config the caller still held — so a run that moved from glm to gemini
|
|
289
|
+
* and finished there was written down as a glm session. The record named a model that had not
|
|
290
|
+
* done most of the work.
|
|
291
|
+
*/
|
|
292
|
+
readonly running: {
|
|
293
|
+
provider: string;
|
|
294
|
+
model: string;
|
|
295
|
+
};
|
|
284
296
|
}
|
|
285
297
|
/**
|
|
286
298
|
* Image paths a prompt refers to that actually exist on disk.
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAc5B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,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,EACnB,eAAe,CAAC,EAAE,OAAO,EAAE,EAC3B,MAAM,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,YAAY,CAAC,CAiLvB"}
|
package/dist/engine.js
CHANGED
|
@@ -255,6 +255,15 @@ export function isRetryableProviderError(err) {
|
|
|
255
255
|
return /model|route|not supported|unavailable|no such/.test(text);
|
|
256
256
|
}
|
|
257
257
|
if (status === undefined) {
|
|
258
|
+
/*
|
|
259
|
+
* A dead link is retryable by definition, and saying so here rather than repeating the patterns
|
|
260
|
+
* is what keeps the two answers from contradicting each other. They did: "read ETIMEDOUT" was
|
|
261
|
+
* recognised as a lost connection and refused a retry in the same breath, because this list
|
|
262
|
+
* matches "timeout" and that message says "etimedout". The run ended on a blip the classifier
|
|
263
|
+
* had already identified.
|
|
264
|
+
*/
|
|
265
|
+
if (isConnectivityFailure(err))
|
|
266
|
+
return true;
|
|
258
267
|
// Network-level failures carry no status.
|
|
259
268
|
// "Connection error." is the OpenAI SDK's APIConnectionError wording and carries no status,
|
|
260
269
|
// which is exactly the transient case retrying exists for. It cost a four-turn run.
|
|
@@ -357,7 +366,19 @@ export function isConnectivityFailure(err) {
|
|
|
357
366
|
const text = `${e?.message ?? ''} ${e?.code ?? ''}`.toLowerCase();
|
|
358
367
|
if (!text.trim())
|
|
359
368
|
return false;
|
|
360
|
-
|
|
369
|
+
/*
|
|
370
|
+
* Every way a socket dies, including the ones that do not mention a socket.
|
|
371
|
+
*
|
|
372
|
+
* "Premature close" is what Node says when a response body ends before it should, and "terminated"
|
|
373
|
+
* is undici's wording for the same event. Neither contains a word like connection or timeout, so
|
|
374
|
+
* both fell through every pattern here and ended runs outright — the reported case was a stream
|
|
375
|
+
* that stopped mid-sentence after six seconds and took the whole run with it.
|
|
376
|
+
*
|
|
377
|
+
* "aborted" is deliberately absent. A user pressing stop produces exactly that word, and retrying
|
|
378
|
+
* somebody's cancellation is the worst possible reading of it; the caller checks the signal
|
|
379
|
+
* before this is consulted.
|
|
380
|
+
*/
|
|
381
|
+
return /connection error|econnrefused|econnreset|econnaborted|etimedout|enotfound|eai_again|ehostunreach|enetunreach|enetdown|epipe|socket hang up|socket disconnected|fetch failed|network|dns|tunnel|offline|premature close|terminated|unexpected end|stream closed|other side closed/
|
|
361
382
|
.test(text);
|
|
362
383
|
}
|
|
363
384
|
export function retryDelayMs(err, attempt, random = Math.random) {
|
|
@@ -1180,6 +1201,8 @@ detectedContext = { current: 0 }) {
|
|
|
1180
1201
|
* one, and what somebody means by "wait for the network" is an amount of time.
|
|
1181
1202
|
*/
|
|
1182
1203
|
let offlineSince = 0;
|
|
1204
|
+
/** Whether the attempt in flight has emitted any of the reply yet. */
|
|
1205
|
+
let shownThisAttempt = false;
|
|
1183
1206
|
let emptyTurns = 0;
|
|
1184
1207
|
/** Retries spent on an empty turn from a model already known to use tools. */
|
|
1185
1208
|
let emptyRetries = 0;
|
|
@@ -1635,6 +1658,15 @@ detectedContext = { current: 0 }) {
|
|
|
1635
1658
|
* so every call reasoned at the provider's default and running `echo hello` cost a full
|
|
1636
1659
|
* deliberation. Measured: KONECK's own overhead for a command is about forty milliseconds.
|
|
1637
1660
|
*/
|
|
1661
|
+
/*
|
|
1662
|
+
* Whether this attempt has already put words on screen.
|
|
1663
|
+
*
|
|
1664
|
+
* A retry re-asks from the same messages, so the model says its piece again — and the half a
|
|
1665
|
+
* sentence the failed attempt managed is still sitting in the transcript. Six retries of a
|
|
1666
|
+
* stream that died mid-sentence produced "node_modules is present. Let me" six times over.
|
|
1667
|
+
* Reset per attempt, so only an attempt that actually showed something asks for it back.
|
|
1668
|
+
*/
|
|
1669
|
+
shownThisAttempt = false;
|
|
1638
1670
|
const paceField = config.pace && !effortRefused
|
|
1639
1671
|
// effortValue is set when a provider has told us which values it takes; until then the
|
|
1640
1672
|
// ordinary mapping applies.
|
|
@@ -1817,6 +1849,8 @@ detectedContext = { current: 0 }) {
|
|
|
1817
1849
|
heldTail = hold;
|
|
1818
1850
|
if (emit) {
|
|
1819
1851
|
config.onChunk?.(emit);
|
|
1852
|
+
// So a retry knows there is something on screen to take back.
|
|
1853
|
+
shownThisAttempt = true;
|
|
1820
1854
|
if (!silent) {
|
|
1821
1855
|
if (spinner && !spinnerStopped) {
|
|
1822
1856
|
spinner.stop();
|
|
@@ -2078,6 +2112,10 @@ detectedContext = { current: 0 }) {
|
|
|
2078
2112
|
config.onOffline?.(offline
|
|
2079
2113
|
? { provider: config.provider, attempt: turnRetries, nextInMs: delay, downForMs: waitedFor }
|
|
2080
2114
|
: null);
|
|
2115
|
+
// Whatever the failed attempt managed to say is withdrawn before it is said again, so a
|
|
2116
|
+
// recovered turn reads as one reply rather than as several false starts stitched together.
|
|
2117
|
+
if (shownThisAttempt)
|
|
2118
|
+
config.onStreamReset?.();
|
|
2081
2119
|
// Interruptible: a wait measured in minutes must not swallow a stop.
|
|
2082
2120
|
await sleepUnlessAborted(delay, combinedSignal);
|
|
2083
2121
|
if (combinedSignal.aborted)
|
|
@@ -3175,6 +3213,17 @@ initialPlan) {
|
|
|
3175
3213
|
// new pace gets its own attempt without anything else to reset here.
|
|
3176
3214
|
config = { ...config, pace };
|
|
3177
3215
|
},
|
|
3216
|
+
/*
|
|
3217
|
+
* Read live, because failover reassigns config inside this closure.
|
|
3218
|
+
*
|
|
3219
|
+
* Everything outside holds the config it passed in, which stops being true the moment a run
|
|
3220
|
+
* moves elsewhere — so a session that started on glm-5.3-flash, was rate limited, and finished
|
|
3221
|
+
* on gemini was written to disk as a glm session. A getter is the whole fix: the answer is
|
|
3222
|
+
* whatever is true when asked rather than whatever was true at construction.
|
|
3223
|
+
*/
|
|
3224
|
+
get running() {
|
|
3225
|
+
return { provider: config.provider, model: config.model };
|
|
3226
|
+
},
|
|
3178
3227
|
};
|
|
3179
3228
|
}
|
|
3180
3229
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
@@ -3244,8 +3293,17 @@ export async function runAgent(task, config, initialMessages, resume) {
|
|
|
3244
3293
|
await saveSession(config.cwd, resume?.id ?? session.id, {
|
|
3245
3294
|
id: resume?.id ?? session.id,
|
|
3246
3295
|
task: (resume?.task ?? task).slice(0, 120),
|
|
3247
|
-
|
|
3248
|
-
|
|
3296
|
+
/*
|
|
3297
|
+
* What actually ran, not what was asked for.
|
|
3298
|
+
*
|
|
3299
|
+
* These read config.provider and config.model from the closure the caller still holds, and
|
|
3300
|
+
* failover replaces the session's own config rather than that one — so a run that started on
|
|
3301
|
+
* glm-5.3-flash, hit a rate limit and finished on gemini was written down as a glm session.
|
|
3302
|
+
* The file named a model that had done none of the later work, and the sidebar then showed
|
|
3303
|
+
* that name beside a transcript full of another model's output.
|
|
3304
|
+
*/
|
|
3305
|
+
provider: session.running.provider,
|
|
3306
|
+
model: session.running.model,
|
|
3249
3307
|
cwd: config.cwd,
|
|
3250
3308
|
startedAt: resume?.startedAt ?? startedAt,
|
|
3251
3309
|
turns: session.stats.turns,
|