koneck 2.128.45 → 2.128.47
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/compressor.d.ts +23 -4
- package/dist/compressor.d.ts.map +1 -1
- package/dist/compressor.js +40 -5
- package/dist/compressor.js.map +1 -1
- package/dist/engine.d.ts +3 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +103 -12
- package/dist/engine.js.map +1 -1
- package/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +22 -0
- package/dist/ink-chat.js.map +1 -1
- package/package.json +1 -1
package/dist/compressor.d.ts
CHANGED
|
@@ -46,6 +46,20 @@ export declare function safeCutAtOrBefore(messages: readonly Message[], from: nu
|
|
|
46
46
|
* is a prompt the model will refuse.
|
|
47
47
|
*/
|
|
48
48
|
export declare function safeCutAtOrAfter(messages: readonly Message[], from: number, balanced?: boolean[]): number | null;
|
|
49
|
+
/**
|
|
50
|
+
* What a compaction attempt did, including the two ways it can decline.
|
|
51
|
+
*
|
|
52
|
+
* Both used to be indistinguishable from "not needed", which is how a compaction that could never
|
|
53
|
+
* work came to be retried on every turn.
|
|
54
|
+
*/
|
|
55
|
+
export interface CompressResult {
|
|
56
|
+
messages: Message[];
|
|
57
|
+
compressed: boolean;
|
|
58
|
+
/** It summarised, and the result was no smaller. The original is returned. */
|
|
59
|
+
noGain?: boolean;
|
|
60
|
+
/** The instructions and tool schemas alone fill the window. Nothing was attempted. */
|
|
61
|
+
floorExceedsWindow?: boolean;
|
|
62
|
+
}
|
|
49
63
|
export interface CompressOptions {
|
|
50
64
|
/** The model's context window, so compaction happens before the model overflows rather than
|
|
51
65
|
* at a number chosen without reference to it. */
|
|
@@ -59,6 +73,14 @@ export interface CompressOptions {
|
|
|
59
73
|
promptTokens?: number;
|
|
60
74
|
/** Forced by an overflow the model has already refused: the size no longer matters. */
|
|
61
75
|
force?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Instructions plus tool schemas: what the prompt costs before a word of conversation.
|
|
78
|
+
*
|
|
79
|
+
* Compaction cannot reduce it — the schemas are not even sent as messages — so when it alone
|
|
80
|
+
* fills the window there is nothing to compact under, and rounds of summarising are model calls
|
|
81
|
+
* that cannot succeed.
|
|
82
|
+
*/
|
|
83
|
+
fixedCost?: number;
|
|
62
84
|
}
|
|
63
85
|
/**
|
|
64
86
|
* The instruction the session is currently working on.
|
|
@@ -84,9 +106,6 @@ export declare function activeRequestIndex(messages: readonly Message[]): number
|
|
|
84
106
|
* again later.
|
|
85
107
|
*/
|
|
86
108
|
export declare function keepForTarget(messages: readonly Message[], size: number, limit: number, start?: number): number;
|
|
87
|
-
export declare function compressIfNeeded(messages: Message[], client: OpenAI, model: string, options?: CompressOptions): Promise<
|
|
88
|
-
messages: Message[];
|
|
89
|
-
compressed: boolean;
|
|
90
|
-
}>;
|
|
109
|
+
export declare function compressIfNeeded(messages: Message[], client: OpenAI, model: string, options?: CompressOptions): Promise<CompressResult>;
|
|
91
110
|
export { estimateTokens };
|
|
92
111
|
//# sourceMappingURL=compressor.d.ts.map
|
package/dist/compressor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compressor.d.ts","sourceRoot":"","sources":["../src/compressor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAM1C,iBAAS,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAenD;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtF;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CAW1E;AAED,yEAAyE;AACzE,wBAAgB,yBAAy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C,QAAQ,EAAE,OAAO,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EAGb,OAAO,GAAE,eAAkD,GAC1D,OAAO,CAAC,cAAc,CAAC,CA0IzB;AA8BD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/compressor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shouldCompact, COMPACT_AT, DEFAULT_CONTEXT_LIMIT } from './context-limit.js';
|
|
1
|
+
import { shouldCompact, COMPACT_AT, DEFAULT_CONTEXT_LIMIT, overheadIsCrowded } from './context-limit.js';
|
|
2
2
|
const CHARS_PER_TOKEN = 4;
|
|
3
3
|
const KEEP_RECENT_MESSAGES = 12;
|
|
4
4
|
function estimateTokens(messages) {
|
|
@@ -204,6 +204,27 @@ options = { limit: DEFAULT_CONTEXT_LIMIT }) {
|
|
|
204
204
|
if (!options.force && !shouldCompact(size, options.limit)) {
|
|
205
205
|
return { messages, compressed: false };
|
|
206
206
|
}
|
|
207
|
+
/*
|
|
208
|
+
* Refused when the window cannot hold the prompt whatever is cut.
|
|
209
|
+
*
|
|
210
|
+
* The instructions and the tool schemas are not in `messages` — the schemas are not sent as
|
|
211
|
+
* messages at all — so compaction cannot touch them. When they alone exceed the window, summing
|
|
212
|
+
* the conversation to nothing still leaves a prompt too large, and every round is a model call
|
|
213
|
+
* that cannot succeed. Watched against Ollama serving 4,096 with a 7,453-token floor: compact,
|
|
214
|
+
* compact again, forever.
|
|
215
|
+
*
|
|
216
|
+
* There is nothing to compact your way under, so it stops and says which number is the problem.
|
|
217
|
+
*
|
|
218
|
+
* Speculative compaction only. `force` means the provider has already refused this prompt for
|
|
219
|
+
* length, and then cutting the conversation is the one lever there is: the floor is an estimate,
|
|
220
|
+
* the real limit may be higher than the one being compared against, and declining to try
|
|
221
|
+
* guarantees the failure it is predicting. Attempt it and let the retry find out.
|
|
222
|
+
*/
|
|
223
|
+
if (!options.force
|
|
224
|
+
&& options.fixedCost !== undefined
|
|
225
|
+
&& overheadIsCrowded(options.fixedCost, options.limit)) {
|
|
226
|
+
return { messages, compressed: false, floorExceedsWindow: true };
|
|
227
|
+
}
|
|
207
228
|
// Always keep: system prompt + first user message + the last N messages.
|
|
208
229
|
//
|
|
209
230
|
// The tail boundary is then walked back to a turn boundary. A fixed-size slice can begin part
|
|
@@ -280,10 +301,24 @@ options = { limit: DEFAULT_CONTEXT_LIMIT }) {
|
|
|
280
301
|
role: 'assistant',
|
|
281
302
|
content: `[COMPRESSED HISTORY — ${middle.length} messages]\n${summary}`,
|
|
282
303
|
};
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
304
|
+
const rebuilt = [...head, summaryMsg, ...restated(activeMessage), ...tail];
|
|
305
|
+
/*
|
|
306
|
+
* Compaction that saved nothing is not compaction.
|
|
307
|
+
*
|
|
308
|
+
* `compressed: true` used to mean "a summary was produced", not "the conversation got
|
|
309
|
+
* smaller" — and those come apart whenever the middle was already short: a summary of two
|
|
310
|
+
* brief messages, plus the active request restated, can be longer than what it replaced.
|
|
311
|
+
* Reported as two notices in a row, the second reading "8 messages summarised into 8", each
|
|
312
|
+
* one a model call that bought nothing.
|
|
313
|
+
*
|
|
314
|
+
* Measured rather than assumed, and the original is kept when the rebuild is not smaller.
|
|
315
|
+
* Saying so is the caller's business; what matters here is not claiming a reduction that did
|
|
316
|
+
* not happen, because a caller that believes it will come straight back and ask again.
|
|
317
|
+
*/
|
|
318
|
+
if (estimateTokens(rebuilt) >= estimateTokens(messages)) {
|
|
319
|
+
return { messages, compressed: false, noGain: true };
|
|
320
|
+
}
|
|
321
|
+
return { messages: rebuilt, compressed: true };
|
|
287
322
|
}
|
|
288
323
|
catch {
|
|
289
324
|
// If summarisation fails, just drop the middle — tail + head is still coherent. The active
|
package/dist/compressor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compressor.js","sourceRoot":"","sources":["../src/compressor.ts"],"names":[],"mappings":"AA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,EAAa,CAAC,CAAC;AAC7E,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -199,7 +199,9 @@ export declare function stepAwaitsUser(text: string): boolean;
|
|
|
199
199
|
* fix; carrying on when they meant stop writes files they never asked for.
|
|
200
200
|
*/
|
|
201
201
|
export declare function replyAwaitsUser(text: string): boolean;
|
|
202
|
-
export declare function announcesMoreWork(text: string
|
|
202
|
+
export declare function announcesMoreWork(text: string, opts?: {
|
|
203
|
+
taskBuilds?: boolean;
|
|
204
|
+
}): boolean;
|
|
203
205
|
export { buildClient } from './providers.js';
|
|
204
206
|
/**
|
|
205
207
|
* `git status --short`, summarised rather than pasted.
|
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,OAAO,EACE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAwBtC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAgBtC,OAAO,EAAwD,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtG,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAA0D,KAAK,SAAS,EAAE,MAC1E,oBAAoB,CAAC;AAM5B,OAAO,EAAE,kBAAkB,EACK,MAAM,iBAAiB,CAAC;AAIxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,UAAU,EAKX,MAAM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,CAAC,UAAU,CAAC;AAClC,iGAAiG;AACjG,WAAW,CAAC,EAAE,IAAI,GACjB,OAAO,CAAC,YAAY,CAAC,CAqYvB;AAwBD;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,uFAAuF;IACvF,SAAS,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
|
@@ -15,7 +15,7 @@ import { claim, release, describeClaims } from './claims.js';
|
|
|
15
15
|
import { handoffFrom, describeHandoff, worthSaying } from './handoff.js';
|
|
16
16
|
import { readAll as readLedger, relevant as relevantFindings, withStaleness, describeFindings, deriveFindings, freshFindings, record as recordFindings, changedSince, currentSha } from './ledger.js';
|
|
17
17
|
import { repoNameFor } from './session-bus.js';
|
|
18
|
-
import { compressIfNeeded } from './compressor.js';
|
|
18
|
+
import { compressIfNeeded, activeRequestIndex } from './compressor.js';
|
|
19
19
|
import { contextLimitFor, looksLikeContextOverflow, parseContextLimit, fetchModelContextLimit, ollamaServingLimit, fixedRequestTokens, overheadIsCrowded, crowdedWindowAdvice, probeServedContext, decideServedWindow, detectWindowPlateau, truncationNotice, windowFixFor, windowSettingIgnored, runsOnThisMachine, } from './context-limit.js';
|
|
20
20
|
import { generateSessionId, saveSession } from './session.js';
|
|
21
21
|
import { EMPTY_PLAN, parsePlan, planReminder, planAck, noPlanReminder } from './plan.js';
|
|
@@ -510,19 +510,42 @@ const SHARED_WORK = /\b(npm|yarn|pnpm|bun)\s+(run\s+\S+|test|install|ci|build|st
|
|
|
510
510
|
* reporting skipped work has not answered the question, however long the write-up is. They are
|
|
511
511
|
* therefore checked at any length, unlike the forward-looking phrases below.
|
|
512
512
|
*/
|
|
513
|
+
/*
|
|
514
|
+
* The agent describing its own process: an admission whatever the task was.
|
|
515
|
+
*
|
|
516
|
+
* "I stopped there", "I only ran the initial searches", "I have not yet read the tests" — these are
|
|
517
|
+
* about what the agent did, and a long report that says them is an unfinished job, not an answer.
|
|
518
|
+
*/
|
|
513
519
|
const ADMITS_UNFINISHED = new RegExp([
|
|
514
|
-
|
|
515
|
-
"\\b(?:haven'?t|have not) (?:finished|completed|yet\\b)",
|
|
520
|
+
"\\b(?:haven'?t|have not) (?:finished|completed)\\b",
|
|
516
521
|
"\\bi stopped (?:there|here|short)\\b",
|
|
517
|
-
"\\b(?:has|have) not yet (?:read|checked|reviewed|examined|explored|looked
|
|
518
|
-
"\\
|
|
522
|
+
"\\b(?:has|have|haven'?t) not yet (?:read|checked|reviewed|examined|explored|looked)\\b",
|
|
523
|
+
"\\b(?:haven'?t|have not) yet (?:read|checked|reviewed|examined|explored|looked)\\b",
|
|
524
|
+
"\\bnot yet (?:read|checked|reviewed|examined|explored|started)\\b",
|
|
519
525
|
"\\bi only (?:ran|did|searched|looked|checked|read)\\b",
|
|
520
|
-
"\\
|
|
521
|
-
|
|
526
|
+
"\\bi still (?:need|have) to\\b",
|
|
527
|
+
"\\bwill (?:now )?(?:proceed|begin|start) to\\b",
|
|
528
|
+
].join('|'), 'i');
|
|
529
|
+
/*
|
|
530
|
+
* What does not exist yet: a confession in a build, and the answer in a question.
|
|
531
|
+
*
|
|
532
|
+
* These used to sit in the list above and counted in every task. So asked "check what i am working
|
|
533
|
+
* on?", a model that did the whole investigation correctly and reported "the actual financial logic
|
|
534
|
+
* for the Stokvel platform is yet to be implemented" was read as admitting its own work was
|
|
535
|
+
* unfinished — because the sentence matched `yet to be implemented`. It was nudged to continue,
|
|
536
|
+
* sent the same accurate summary back, and the run was then labelled "Not finished" on a question
|
|
537
|
+
* it had answered in full.
|
|
538
|
+
*
|
|
539
|
+
* The words are identical either way. Whether they are a confession depends on whether the agent
|
|
540
|
+
* was asked to make the thing, and that is known: it is the task.
|
|
541
|
+
*/
|
|
542
|
+
const DESCRIBES_UNBUILT = new RegExp([
|
|
543
|
+
"\\b(?:has|have) not yet (?:created|written|implemented|added|changed)\\b",
|
|
544
|
+
"\\bnot yet (?:created|written|implemented|added)\\b",
|
|
545
|
+
"\\bstill (?:needs?|remains?) to\\b",
|
|
522
546
|
"\\bno (?:files?|changes?|code|modules?) (?:were|was|have been|has been)\\b",
|
|
523
547
|
"\\bnothing (?:was|were|has been|have been) (?:created|changed|written|implemented|added|modified)\\b",
|
|
524
548
|
"\\b(?:remains?|yet) to be (?:written|created|implemented|done|added)\\b",
|
|
525
|
-
"\\bwill (?:now )?(?:proceed|begin|start) to\\b",
|
|
526
549
|
].join('|'), 'i');
|
|
527
550
|
/**
|
|
528
551
|
* Detects a provider or gateway error that arrived as assistant *content* with HTTP 200, rather
|
|
@@ -629,7 +652,7 @@ export function replyAwaitsUser(text) {
|
|
|
629
652
|
return /\b(say the word|just say the word|shall i\b|should i (proceed|continue|go ahead|start)|want me to\b|would you like me to\b|do you want me to\b|if you'?d like,? i'?ll|if you want,? i'?ll|ready when you are|your call\b|give me the go-?ahead|with your (approval|go-?ahead|sign-?off)|awaiting your|let me know (if|whether) you (want|would like|need) me to|tell me (which|and i'?ll))/
|
|
630
653
|
.test(tail);
|
|
631
654
|
}
|
|
632
|
-
export function announcesMoreWork(text) {
|
|
655
|
+
export function announcesMoreWork(text, opts = {}) {
|
|
633
656
|
const trimmed = text.trim();
|
|
634
657
|
if (!trimmed)
|
|
635
658
|
return false;
|
|
@@ -637,6 +660,10 @@ export function announcesMoreWork(text) {
|
|
|
637
660
|
// says "I stopped there" is still an unfinished job, not an answer.
|
|
638
661
|
if (ADMITS_UNFINISHED.test(trimmed))
|
|
639
662
|
return true;
|
|
663
|
+
// Unbuilt things are only a confession when building them was the job. Unknown means yes: a
|
|
664
|
+
// caller that cannot say keeps the stricter reading it always had.
|
|
665
|
+
if ((opts.taskBuilds ?? true) && DESCRIBES_UNBUILT.test(trimmed))
|
|
666
|
+
return true;
|
|
640
667
|
// Forward-looking intent ("now let me read X") only counts in short text, since a long
|
|
641
668
|
// answer that happens to mention reading a file is a conclusion, not a preamble.
|
|
642
669
|
if (trimmed.length > 600)
|
|
@@ -1643,6 +1670,9 @@ compactRequest = { pending: false }) {
|
|
|
1643
1670
|
* was the wrong and only moment.
|
|
1644
1671
|
*/
|
|
1645
1672
|
let windowReprobed = false;
|
|
1673
|
+
/** Both said once per session: they describe the setup, not the turn. */
|
|
1674
|
+
let floorNoticeGiven = false;
|
|
1675
|
+
let noGainNoticeGiven = false;
|
|
1646
1676
|
/** Why the turn loop was broken out of, when it was. Null means it ran to its own end. */
|
|
1647
1677
|
let stoppedBecause = null;
|
|
1648
1678
|
/** Reported prompt counts against the history that produced them, for spotting a plateau. */
|
|
@@ -1910,7 +1940,38 @@ compactRequest = { pending: false }) {
|
|
|
1910
1940
|
limit: effectiveLimit(),
|
|
1911
1941
|
promptTokens: lastPromptTokens,
|
|
1912
1942
|
force: forceCompact || compactRequest.pending,
|
|
1943
|
+
// So it can decline outright when the instructions and tool schemas alone fill the window,
|
|
1944
|
+
// instead of spending a summarisation call on a conversation that is not the problem.
|
|
1945
|
+
...(fixedCost > 0 ? { fixedCost } : {}),
|
|
1913
1946
|
});
|
|
1947
|
+
/*
|
|
1948
|
+
* Two ways compaction declines, each said once and then left alone.
|
|
1949
|
+
*
|
|
1950
|
+
* Retrying either is the fault being fixed: with Ollama serving 4,096 against a 7,453-token
|
|
1951
|
+
* floor, the conversation was summarised on every single turn — "8 messages summarised into
|
|
1952
|
+
* 8" — each round a model call that could not have helped. Reported as compaction notices
|
|
1953
|
+
* stacking up after the window had supposedly been raised.
|
|
1954
|
+
*/
|
|
1955
|
+
if (compressed.floorExceedsWindow && !floorNoticeGiven) {
|
|
1956
|
+
floorNoticeGiven = true;
|
|
1957
|
+
const endpoint = resolveProvider(config.provider, config.baseURL).baseURL;
|
|
1958
|
+
const advice = crowdedWindowAdvice(fixedCost, effectiveLimit(), {
|
|
1959
|
+
model: config.model,
|
|
1960
|
+
endpoint,
|
|
1961
|
+
remote: !runsOnThisMachine(endpoint),
|
|
1962
|
+
runtime: config.servedRuntime ?? null,
|
|
1963
|
+
});
|
|
1964
|
+
config.onCompactNoop?.('the instructions and tool descriptions alone do not fit the window, so summarising the '
|
|
1965
|
+
+ 'conversation cannot get under it');
|
|
1966
|
+
config.onCrowdedWindow?.(fixedCost, effectiveLimit(), advice);
|
|
1967
|
+
if (!silent)
|
|
1968
|
+
tui.printWarning(advice);
|
|
1969
|
+
}
|
|
1970
|
+
if (compressed.noGain && !noGainNoticeGiven) {
|
|
1971
|
+
noGainNoticeGiven = true;
|
|
1972
|
+
config.onCompactNoop?.('summarising produced nothing smaller than what it replaced, so the conversation was left '
|
|
1973
|
+
+ 'as it was');
|
|
1974
|
+
}
|
|
1914
1975
|
if (!compressed.compressed && compactRequest.pending) {
|
|
1915
1976
|
/*
|
|
1916
1977
|
* Asked for, and there was nothing to do.
|
|
@@ -2930,8 +2991,20 @@ compactRequest = { pending: false }) {
|
|
|
2930
2991
|
// A run asked to build something that is about to end without having written anything has
|
|
2931
2992
|
// not finished, whatever its closing paragraph claims. This catches the phrasings a fixed
|
|
2932
2993
|
// list of admissions cannot.
|
|
2933
|
-
|
|
2934
|
-
|
|
2994
|
+
/*
|
|
2995
|
+
* The request being worked on, not the first thing ever typed.
|
|
2996
|
+
*
|
|
2997
|
+
* This read the session's first user message, which in the session that reported it was
|
|
2998
|
+
* "Hi" — the actual question came second. Harmless there by luck; wrong in general, since a
|
|
2999
|
+
* session that opened with "build X" and later asked a question would have every question
|
|
3000
|
+
* judged as an unfinished build. activeRequestIndex already skips KONECK's own nudges, for
|
|
3001
|
+
* exactly this reason, and is what compaction uses to find the same thing.
|
|
3002
|
+
*/
|
|
3003
|
+
const activeAt = activeRequestIndex(messages);
|
|
3004
|
+
const activeRequest = activeAt >= 0 ? messages[activeAt] : undefined;
|
|
3005
|
+
const taskText = typeof activeRequest?.content === 'string' ? activeRequest.content : '';
|
|
3006
|
+
const taskBuilds = BUILD_INTENT.test(taskText);
|
|
3007
|
+
const builtNothing = finishedWithoutBuilding(taskText, usedMutatingTool);
|
|
2935
3008
|
// A turn with no text and no tool calls is not an answer; it is the provider returning
|
|
2936
3009
|
// nothing. A few in a row means the model is not responding, and continuing to nudge an
|
|
2937
3010
|
// unresponsive endpoint just burns turns before reporting a success that never happened.
|
|
@@ -3037,6 +3110,24 @@ compactRequest = { pending: false }) {
|
|
|
3037
3110
|
}
|
|
3038
3111
|
previousReply = replyBody;
|
|
3039
3112
|
if (identicalReplies >= 1) {
|
|
3113
|
+
/*
|
|
3114
|
+
* A finished answer, sent twice because it was pushed, is finished.
|
|
3115
|
+
*
|
|
3116
|
+
* Two identical replies mean the nudge is not landing, and there are two reasons that
|
|
3117
|
+
* happens. Either the model is stuck — it keeps announcing a step it never takes — or it has
|
|
3118
|
+
* already answered and there is nothing to continue with, so it gives the answer again.
|
|
3119
|
+
* This ran into the second as if it were the first: asked "check what i am working on?",
|
|
3120
|
+
* the model investigated, answered accurately, was pushed by a false reading of its own
|
|
3121
|
+
* summary, repeated the summary, and the run was then reported "Not finished".
|
|
3122
|
+
*
|
|
3123
|
+
* They are told apart by what is left. Nothing on the plan, nothing the task needed built,
|
|
3124
|
+
* and a reply that does not announce more work: that is an answer, and it is accepted.
|
|
3125
|
+
*/
|
|
3126
|
+
const planLeft = planRef.current.steps.some(step => step.state === 'todo' || step.state === 'doing');
|
|
3127
|
+
if (!planLeft && !builtNothing && !announcesMoreWork(assistantContent, { taskBuilds })) {
|
|
3128
|
+
messages.push({ role: 'assistant', content: assistantContent });
|
|
3129
|
+
return !forcedAnswer;
|
|
3130
|
+
}
|
|
3040
3131
|
/*
|
|
3041
3132
|
* Why it stopped, what is left, and what to do — all three.
|
|
3042
3133
|
*
|
|
@@ -3068,7 +3159,7 @@ compactRequest = { pending: false }) {
|
|
|
3068
3159
|
pushNudge(repetitionNotice(looping));
|
|
3069
3160
|
continue;
|
|
3070
3161
|
}
|
|
3071
|
-
if ((announcesMoreWork(assistantContent) || builtNothing || nextStep !== undefined)
|
|
3162
|
+
if ((announcesMoreWork(assistantContent, { taskBuilds }) || builtNothing || nextStep !== undefined)
|
|
3072
3163
|
&& continuationNudges < MAX_CONTINUATION_NUDGES) {
|
|
3073
3164
|
continuationNudges++;
|
|
3074
3165
|
messages.push({ role: 'assistant', content: assistantContent });
|