@cortexkit/opencode-magic-context 0.49.65 → 0.49.67
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/auto-search-worker.js +1 -1
- package/dist/chunk-embedding-write-worker.js +1 -1
- package/dist/{context-3mfsdp1v.js → context-1acz1d4x.js} +18 -15
- package/dist/features/magic-context/compartment-storage.d.ts +7 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +5 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/types.d.ts +2 -0
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +3 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +24 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +3 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/unmanaged-over-window.d.ts +4 -0
- package/dist/hooks/magic-context/unmanaged-over-window.d.ts.map +1 -1
- package/dist/{index-stqmv1mt.js → index-2t9e10mt.js} +72 -21
- package/dist/{index-7dj3s7qq.js → index-2x46rnct.js} +1 -1
- package/dist/{index-71h616be.js → index-3v5mfapn.js} +1 -1
- package/dist/{index-wz0t5e5s.js → index-8a1m48va.js} +3 -3
- package/dist/{index-gwb2wpz7.js → index-fybdhbd4.js} +2 -2
- package/dist/{index-qn27gh4e.js → index-g53qhdrb.js} +1 -1
- package/dist/{index-san8daqa.js → index-gy33sq5h.js} +6 -6
- package/dist/{index-x2hwwzk1.js → index-m47yte97.js} +64 -32
- package/dist/{index-c0k54yhd.js → index-m6cv2hv3.js} +3 -3
- package/dist/{index-g59gpt1j.js → index-nfvyraa3.js} +3 -3
- package/dist/{index-ezr8mr1c.js → index-ngrrs3yb.js} +13 -4
- package/dist/{index-6kgsfb81.js → index-q73yeb83.js} +1 -1
- package/dist/{index-kvfrse61.js → index-t20q6aj6.js} +12 -1
- package/dist/{index-0ab398z2.js → index-xmk2a6pq.js} +2 -2
- package/dist/{index-8596jbnw.js → index-z10dryn5.js} +5 -5
- package/dist/index.js +18 -18
- package/dist/{message-index-bounded-zs7ah2te.js → message-index-bounded-f27039js.js} +3 -3
- package/dist/migration-worker.js +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +6 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-jf2f8jz8.js → read-session-chunk-4ma2vsva.js} +2 -2
- package/dist/{recomp-orchestrator-nyj8ca0y.js → recomp-orchestrator-p9c4jg9m.js} +7 -7
- package/dist/{render-n46wpv2n.js → render-h16ea0th.js} +6 -6
- package/dist/{search-archive-9k6vsp44.js → search-archive-km2ahm3e.js} +4 -4
- package/dist/{search-s386bwwh.js → search-m9rpnh7m.js} +5 -5
- package/dist/{storage-tags-2r952wqy.js → storage-tags-ktp70q1e.js} +1 -1
- package/dist/{transform-postprocess-phase-8yjcca9t.js → transform-postprocess-phase-120s1ep8.js} +8 -8
- package/dist/v2/auto-search-worker.js +1 -1
- package/dist/v2/chunk-embedding-write-worker.js +1 -1
- package/dist/v2/{context-34sr5ner.js → context-p0z7mrsf.js} +71 -18
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-axbs1s97.js → message-index-bounded-td516y9c.js} +3 -3
- package/dist/v2/migration-worker.js +1 -1
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-41cm522x.js → read-session-chunk-6dz32wmh.js} +2 -2
- package/dist/v2/{recomp-orchestrator-r4gqhhaw.js → recomp-orchestrator-ayy7xzm3.js} +6 -6
- package/dist/v2/{render-7v7yx9xb.js → render-gqp4fwqn.js} +6 -6
- package/dist/v2/{search-archive-1yc8bh6y.js → search-archive-qn82j8k0.js} +4 -4
- package/dist/v2/{search-mabwkzw2.js → search-dhekqtfc.js} +4 -4
- package/dist/v2/{server-yxw43z2w.js → server-166m5nrw.js} +13 -4
- package/dist/v2/{server-bh9yzxpz.js → server-34vhmd1d.js} +2 -2
- package/dist/v2/{server-k97r77x3.js → server-77207nf4.js} +2 -2
- package/dist/v2/{server-hcgqsdrh.js → server-jew1m85s.js} +1 -1
- package/dist/v2/{server-9rwm2z2h.js → server-n6hdj0fn.js} +64 -32
- package/dist/v2/{server-8w9b5exq.js → server-q8ta10e5.js} +1 -1
- package/dist/v2/{server-cdddk5d1.js → server-s1a0bwpc.js} +1 -1
- package/dist/v2/{server-anh8gf0w.js → server-s66wvkpf.js} +2 -2
- package/dist/v2/{server-hb5zm7yh.js → server-verzg5w8.js} +12 -1
- package/dist/v2/{server-bnka2vf2.js → server-xwcg55a8.js} +3 -3
- package/dist/v2/server.js +2 -2
- package/dist/v2/{storage-tags-9zs0gc7w.js → storage-tags-qe8r1n9w.js} +1 -1
- package/dist/v2/{v2-archive-reader-pgk140pb.js → v2-archive-reader-tbjwxvc5.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-p0ysz3s9.js → wrapup-orchestrator-ksdzyfby.js} +6 -6
- package/dist/{v2-archive-reader-cv6veqnz.js → v2-archive-reader-j16k987e.js} +1 -1
- package/dist/{wrapup-orchestrator-dxda1svq.js → wrapup-orchestrator-w09bkgmk.js} +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
recordToolParameters,
|
|
5
5
|
createDroppedInputToolExecuteBeforeHook,
|
|
6
6
|
readRawSessionMessages2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-q73yeb83.js";
|
|
8
8
|
import {
|
|
9
9
|
setHarness2
|
|
10
10
|
} from "./index-pavzsdc6.js";
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
checkCompactionMarkerConsistency,
|
|
59
59
|
clearInjectionCache,
|
|
60
60
|
clearNoteNudgeTriggerOnly
|
|
61
|
-
} from "./index-
|
|
61
|
+
} from "./index-m47yte97.js";
|
|
62
62
|
import"./index-sd3egckz.js";
|
|
63
63
|
import {
|
|
64
64
|
hasTrustedAbsoluteWall,
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
parameterDescriptionsFor,
|
|
144
144
|
MagicContextRpcServer,
|
|
145
145
|
applyHiddenSubagentTemperature
|
|
146
|
-
} from "./index-
|
|
146
|
+
} from "./index-2t9e10mt.js";
|
|
147
147
|
import {
|
|
148
148
|
resolveOpenCodeDbPath,
|
|
149
149
|
openCodeDbPathExists,
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
dropServedRecord,
|
|
196
196
|
registerLkgPersistence,
|
|
197
197
|
dropSlot
|
|
198
|
-
} from "./index-
|
|
198
|
+
} from "./index-ngrrs3yb.js";
|
|
199
199
|
import {
|
|
200
200
|
recordSessionProjectIdentity
|
|
201
201
|
} from "./index-jg7sbt3v.js";
|
|
@@ -210,7 +210,7 @@ import {
|
|
|
210
210
|
openDatabaseAsync,
|
|
211
211
|
isDatabasePersisted,
|
|
212
212
|
getDatabasePersistenceError
|
|
213
|
-
} from "./index-
|
|
213
|
+
} from "./index-g53qhdrb.js";
|
|
214
214
|
import {
|
|
215
215
|
registerExitAbort,
|
|
216
216
|
unregisterExitAbort
|
|
@@ -230,7 +230,7 @@ import"./index-pxnzyvjc.js";
|
|
|
230
230
|
import {
|
|
231
231
|
getDefaultSubcConnectionFile,
|
|
232
232
|
SubcModuleTransport
|
|
233
|
-
} from "./index-
|
|
233
|
+
} from "./index-m6cv2hv3.js";
|
|
234
234
|
import"./index-qt1qqasc.js";
|
|
235
235
|
import"./index-e6ncz7a6.js";
|
|
236
236
|
import {
|
|
@@ -280,7 +280,7 @@ import {
|
|
|
280
280
|
isAnthropicFamilyRoute,
|
|
281
281
|
deleteTagsByMessageId2,
|
|
282
282
|
getMaxTagNumberBySession2
|
|
283
|
-
} from "./index-
|
|
283
|
+
} from "./index-t20q6aj6.js";
|
|
284
284
|
import {
|
|
285
285
|
resolveHistorianModel2,
|
|
286
286
|
resolveOpenCodeAgentOverrides2,
|
|
@@ -293,7 +293,7 @@ import {
|
|
|
293
293
|
import"./index-snbpdpa3.js";
|
|
294
294
|
import {
|
|
295
295
|
deleteIndexedMessage
|
|
296
|
-
} from "./index-
|
|
296
|
+
} from "./index-2x46rnct.js";
|
|
297
297
|
import"./index-6athgjba.js";
|
|
298
298
|
import"./index-tebcx987.js";
|
|
299
299
|
import {
|
|
@@ -317,13 +317,13 @@ import {
|
|
|
317
317
|
armBindingRecoverySafely,
|
|
318
318
|
collectForeignTextParts,
|
|
319
319
|
resetDegradedCacheCount2
|
|
320
|
-
} from "./index-
|
|
320
|
+
} from "./index-gy33sq5h.js";
|
|
321
321
|
import {
|
|
322
322
|
scheduleClearAndReindex
|
|
323
|
-
} from "./index-
|
|
323
|
+
} from "./index-3v5mfapn.js";
|
|
324
324
|
import {
|
|
325
325
|
runManagedRecomp2
|
|
326
|
-
} from "./index-
|
|
326
|
+
} from "./index-8a1m48va.js";
|
|
327
327
|
import {
|
|
328
328
|
isValidSemver,
|
|
329
329
|
compareSemverCore
|
|
@@ -331,11 +331,11 @@ import {
|
|
|
331
331
|
import"./index-fmsr7v69.js";
|
|
332
332
|
import {
|
|
333
333
|
runManagedWrapup2
|
|
334
|
-
} from "./index-
|
|
335
|
-
import"./index-
|
|
334
|
+
} from "./index-z10dryn5.js";
|
|
335
|
+
import"./index-xmk2a6pq.js";
|
|
336
336
|
import"./index-52x68mj4.js";
|
|
337
|
-
import"./index-
|
|
338
|
-
import"./index-
|
|
337
|
+
import"./index-nfvyraa3.js";
|
|
338
|
+
import"./index-fybdhbd4.js";
|
|
339
339
|
import {
|
|
340
340
|
isDreamerRunnable,
|
|
341
341
|
isSmartNoteSurfaceAvailable,
|
|
@@ -8203,7 +8203,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8203
8203
|
// package.json
|
|
8204
8204
|
var package_default = {
|
|
8205
8205
|
name: "@cortexkit/opencode-magic-context",
|
|
8206
|
-
version: "0.49.
|
|
8206
|
+
version: "0.49.67",
|
|
8207
8207
|
type: "module",
|
|
8208
8208
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8209
8209
|
main: "dist/index.js",
|
|
@@ -12082,7 +12082,7 @@ async function setup(context) {
|
|
|
12082
12082
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12083
12083
|
log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
|
|
12084
12084
|
}
|
|
12085
|
-
const { registerContext } = await import("./context-
|
|
12085
|
+
const { registerContext } = await import("./context-1acz1d4x.js");
|
|
12086
12086
|
setHarness2("opencode2");
|
|
12087
12087
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12088
12088
|
const duties = await registerContext(context);
|
|
@@ -12555,7 +12555,7 @@ var server = async (ctx) => {
|
|
|
12555
12555
|
rustReplayParticipant: () => magicContextRuntime.magicContext?.getRustReplayParticipant?.() ?? null,
|
|
12556
12556
|
onStorageBusyRefusal: async (sessionId, message) => {
|
|
12557
12557
|
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-ykvt5k2s.js"));
|
|
12558
|
-
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-
|
|
12558
|
+
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-120s1ep8.js"));
|
|
12559
12559
|
await sendStatusNotification(ctx.client, sessionId, message, {
|
|
12560
12560
|
toastDurationMs: 15000
|
|
12561
12561
|
});
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
yieldIndexChunk2
|
|
5
5
|
} from "./index-gzy5w8ya.js";
|
|
6
6
|
import"./index-1zx87sdm.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-t20q6aj6.js";
|
|
8
8
|
import"./index-5vsk2cpp.js";
|
|
9
9
|
import"./index-pavzsdc6.js";
|
|
10
10
|
import"./index-ywrz4wy2.js";
|
|
@@ -17,7 +17,7 @@ import"./index-1d042x6w.js";
|
|
|
17
17
|
import"./index-q7q6qp1f.js";
|
|
18
18
|
import"./index-58e3y90n.js";
|
|
19
19
|
import"./index-x40zr813.js";
|
|
20
|
-
import"./index-
|
|
20
|
+
import"./index-q73yeb83.js";
|
|
21
21
|
import {
|
|
22
22
|
MESSAGE_INDEX_MAX_FTS_BYTES,
|
|
23
23
|
messageIndexSkipKey,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
markMessageIndexDirty,
|
|
26
26
|
getIndexableContent,
|
|
27
27
|
indexSingleMessage
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-2x46rnct.js";
|
|
29
29
|
import"./index-s32f8y67.js";
|
|
30
30
|
import"./index-m0pwswv9.js";
|
|
31
31
|
|
package/dist/migration-worker.js
CHANGED
|
@@ -131,6 +131,9 @@ export declare function createSessionHooks(args: {
|
|
|
131
131
|
magicContext: ({
|
|
132
132
|
"experimental.chat.messages.transform": ((_input: Record<string, never>, output: {
|
|
133
133
|
messages: unknown[];
|
|
134
|
+
}, warmFitRetry?: {
|
|
135
|
+
tokens: number;
|
|
136
|
+
limit: number;
|
|
134
137
|
}) => Promise<void>) & {
|
|
135
138
|
clearSessionLogState: (sessionId: string) => void;
|
|
136
139
|
invalidateRustWireState(sessionId: string): void;
|
|
@@ -204,6 +207,9 @@ export declare function createSessionHooksAsync(args: {
|
|
|
204
207
|
magicContext: ({
|
|
205
208
|
"experimental.chat.messages.transform": ((_input: Record<string, never>, output: {
|
|
206
209
|
messages: unknown[];
|
|
210
|
+
}, warmFitRetry?: {
|
|
211
|
+
tokens: number;
|
|
212
|
+
limit: number;
|
|
207
213
|
}) => Promise<void>) & {
|
|
208
214
|
clearSessionLogState: (sessionId: string) => void;
|
|
209
215
|
invalidateRustWireState(sessionId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;;;;;mBAcrB,CAAC;aAA2B,CAAC;aAE3E,CAAC;eAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;2BA+G28zC,CAAC;;;;eAA8iB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA3Gxi1C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C
|
|
1
|
+
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;;;;;mBAcrB,CAAC;aAA2B,CAAC;aAE3E,CAAC;eAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;2BA+G28zC,CAAC;;;;eAA8iB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA3Gxi1C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;;;;;;;;qBAkG8uJ,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAAhkG,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAAwl8C,CAAC;;;;;;;;;;;;;;;;EAvDzrgD;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjE;;;;;;;;;;;;;;;;qBA6C8uJ,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAAhkG,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAAwl8C,CAAC;;;;;;;;;;;;;;;;GADzrgD"}
|
|
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
19
19
|
await main();
|
|
20
20
|
async function main() {
|
|
21
21
|
if (input.v2ArchiveReader) {
|
|
22
|
-
const { serveV2ArchiveReads } = await import("./v2-archive-reader-
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-j16k987e.js");
|
|
23
23
|
await serveV2ArchiveReads(port, openConnections);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
51
51
|
await runMessageFtsRowidMapBackfill(db);
|
|
52
52
|
reply = { kind: "fts-rowid-backfill" };
|
|
53
53
|
} else if (input.searchArchive) {
|
|
54
|
-
const { renderSearchArchive } = await import("./search-archive-
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-km2ahm3e.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-3sc9231y.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
81
81
|
const { setHarness } = await import("./harness-e4avh192.js");
|
|
82
82
|
setHarness(input.harness ?? "opencode");
|
|
83
83
|
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
84
|
-
import("./message-index-bounded-
|
|
84
|
+
import("./message-index-bounded-f27039js.js"),
|
|
85
85
|
import("./sqlite-context-pragmas-mv9jqwjh.js")
|
|
86
86
|
]);
|
|
87
87
|
configureContextDatabasePragmas(db);
|
|
@@ -95,7 +95,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
95
95
|
measurements: result.measurements
|
|
96
96
|
};
|
|
97
97
|
} else if (input.tagRatio !== undefined) {
|
|
98
|
-
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-
|
|
98
|
+
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-ktp70q1e.js");
|
|
99
99
|
const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
|
|
100
100
|
if (delta)
|
|
101
101
|
reply = { kind: "tag-delta", delta };
|
|
@@ -38,8 +38,8 @@ import {
|
|
|
38
38
|
readSessionChunk2,
|
|
39
39
|
getRawSessionMessageIdsThrough2,
|
|
40
40
|
readRawSessionSeedTail2
|
|
41
|
-
} from "./index-
|
|
42
|
-
import"./index-
|
|
41
|
+
} from "./index-q73yeb83.js";
|
|
42
|
+
import"./index-t20q6aj6.js";
|
|
43
43
|
import"./index-1zx87sdm.js";
|
|
44
44
|
import"./index-x40zr813.js";
|
|
45
45
|
import"./index-6nqz8hsz.js";
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-8a1m48va.js";
|
|
11
|
+
import"./index-m47yte97.js";
|
|
12
12
|
import"./index-832w615x.js";
|
|
13
13
|
import"./index-sd3egckz.js";
|
|
14
14
|
import"./index-n6aye6ny.js";
|
|
@@ -16,16 +16,16 @@ import"./index-zxj39ba2.js";
|
|
|
16
16
|
import"./index-jjvbk92s.js";
|
|
17
17
|
import"./index-gq1g9a3a.js";
|
|
18
18
|
import"./index-4dhv7mqz.js";
|
|
19
|
-
import"./index-
|
|
19
|
+
import"./index-ngrrs3yb.js";
|
|
20
20
|
import"./index-tebcx987.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-2x46rnct.js";
|
|
22
22
|
import"./index-2amn2s73.js";
|
|
23
23
|
import"./index-6athgjba.js";
|
|
24
24
|
import"./index-ngwmx6nt.js";
|
|
25
25
|
import"./index-1sq1krqw.js";
|
|
26
26
|
import"./index-qt1qqasc.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
27
|
+
import"./index-q73yeb83.js";
|
|
28
|
+
import"./index-t20q6aj6.js";
|
|
29
29
|
import"./index-1zx87sdm.js";
|
|
30
30
|
import"./index-x40zr813.js";
|
|
31
31
|
import"./index-x8a7jmkh.js";
|
|
@@ -35,7 +35,7 @@ import"./index-6nqz8hsz.js";
|
|
|
35
35
|
import"./index-jg7sbt3v.js";
|
|
36
36
|
import"./index-snbpdpa3.js";
|
|
37
37
|
import"./index-pxnzyvjc.js";
|
|
38
|
-
import"./index-
|
|
38
|
+
import"./index-g53qhdrb.js";
|
|
39
39
|
import"./index-fb3zxn06.js";
|
|
40
40
|
import"./index-xx05vta0.js";
|
|
41
41
|
import"./index-fr0wbhdn.js";
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
renderMessageByOrdinal2,
|
|
3
3
|
renderVerboseRangeForTool2,
|
|
4
4
|
renderItemByTag2
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
5
|
+
} from "./index-xmk2a6pq.js";
|
|
6
|
+
import"./index-ngrrs3yb.js";
|
|
7
7
|
import"./index-tebcx987.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-2x46rnct.js";
|
|
9
9
|
import"./index-2amn2s73.js";
|
|
10
10
|
import"./index-6athgjba.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
import"./index-q73yeb83.js";
|
|
12
|
+
import"./index-t20q6aj6.js";
|
|
13
13
|
import"./index-1zx87sdm.js";
|
|
14
14
|
import"./index-x40zr813.js";
|
|
15
15
|
import"./index-6nqz8hsz.js";
|
|
16
16
|
import"./index-snbpdpa3.js";
|
|
17
17
|
import"./index-pxnzyvjc.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-g53qhdrb.js";
|
|
19
19
|
import"./index-fb3zxn06.js";
|
|
20
20
|
import"./index-xx05vta0.js";
|
|
21
21
|
import"./index-fr0wbhdn.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderSearchArchive2,
|
|
3
3
|
renderSearchArchiveOffThread2
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-fybdhbd4.js";
|
|
5
|
+
import"./index-nfvyraa3.js";
|
|
6
6
|
import"./index-52x68mj4.js";
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
import"./index-q73yeb83.js";
|
|
8
|
+
import"./index-t20q6aj6.js";
|
|
9
9
|
import"./index-1zx87sdm.js";
|
|
10
10
|
import"./index-x40zr813.js";
|
|
11
11
|
import"./index-6nqz8hsz.js";
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-m6cv2hv3.js";
|
|
9
|
+
import"./index-3v5mfapn.js";
|
|
10
10
|
import"./index-52x68mj4.js";
|
|
11
11
|
import"./index-n6aye6ny.js";
|
|
12
12
|
import"./index-zxj39ba2.js";
|
|
@@ -14,11 +14,11 @@ import"./index-jjvbk92s.js";
|
|
|
14
14
|
import"./index-gq1g9a3a.js";
|
|
15
15
|
import"./index-4dhv7mqz.js";
|
|
16
16
|
import"./index-tebcx987.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-2x46rnct.js";
|
|
18
18
|
import"./index-2amn2s73.js";
|
|
19
19
|
import"./index-qt1qqasc.js";
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
20
|
+
import"./index-q73yeb83.js";
|
|
21
|
+
import"./index-t20q6aj6.js";
|
|
22
22
|
import"./index-1zx87sdm.js";
|
|
23
23
|
import"./index-x40zr813.js";
|
|
24
24
|
import"./index-zb4h9nrk.js";
|
package/dist/{transform-postprocess-phase-8yjcca9t.js → transform-postprocess-phase-120s1ep8.js}
RENAMED
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
finalizeMessageRepresentation2,
|
|
20
20
|
runPostTransformPhase2,
|
|
21
21
|
checkM0MutationDriftAndSignal2
|
|
22
|
-
} from "./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
22
|
+
} from "./index-gy33sq5h.js";
|
|
23
|
+
import"./index-3v5mfapn.js";
|
|
24
|
+
import"./index-m47yte97.js";
|
|
25
25
|
import"./index-832w615x.js";
|
|
26
26
|
import"./index-sd3egckz.js";
|
|
27
27
|
import"./index-n6aye6ny.js";
|
|
@@ -29,16 +29,16 @@ import"./index-zxj39ba2.js";
|
|
|
29
29
|
import"./index-jjvbk92s.js";
|
|
30
30
|
import"./index-gq1g9a3a.js";
|
|
31
31
|
import"./index-4dhv7mqz.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-ngrrs3yb.js";
|
|
33
33
|
import"./index-tebcx987.js";
|
|
34
|
-
import"./index-
|
|
34
|
+
import"./index-2x46rnct.js";
|
|
35
35
|
import"./index-2amn2s73.js";
|
|
36
36
|
import"./index-6athgjba.js";
|
|
37
37
|
import"./index-ngwmx6nt.js";
|
|
38
38
|
import"./index-1sq1krqw.js";
|
|
39
39
|
import"./index-qt1qqasc.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
40
|
+
import"./index-q73yeb83.js";
|
|
41
|
+
import"./index-t20q6aj6.js";
|
|
42
42
|
import"./index-1zx87sdm.js";
|
|
43
43
|
import"./index-x40zr813.js";
|
|
44
44
|
import"./index-x8a7jmkh.js";
|
|
@@ -48,7 +48,7 @@ import"./index-6nqz8hsz.js";
|
|
|
48
48
|
import"./index-jg7sbt3v.js";
|
|
49
49
|
import"./index-snbpdpa3.js";
|
|
50
50
|
import"./index-pxnzyvjc.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-g53qhdrb.js";
|
|
52
52
|
import"./index-fb3zxn06.js";
|
|
53
53
|
import"./index-xx05vta0.js";
|
|
54
54
|
import"./index-fr0wbhdn.js";
|
|
@@ -31,7 +31,7 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
31
31
|
import("./embedding-cache-mgyr73ef.js"),
|
|
32
32
|
import("./storage-memory-e6a7mb0k.js"),
|
|
33
33
|
import("./project-embedding-registry-k0hjqt11.js"),
|
|
34
|
-
import("./search-
|
|
34
|
+
import("./search-dhekqtfc.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-x6qw6mjk.js"),
|
|
36
36
|
import("./embedding-activity-g1dhes6g.js"),
|
|
37
37
|
import("./harness-e4avh192.js"),
|
|
@@ -220,7 +220,7 @@ import {
|
|
|
220
220
|
startCompartmentAgent,
|
|
221
221
|
setRecompStarting2,
|
|
222
222
|
setRecompTerminal2
|
|
223
|
-
} from "./server-
|
|
223
|
+
} from "./server-n6hdj0fn.js";
|
|
224
224
|
import {
|
|
225
225
|
resolveHistorianModel2
|
|
226
226
|
} from "./server-5kym00ag.js";
|
|
@@ -534,7 +534,7 @@ import {
|
|
|
534
534
|
adoptNullOwnerToolTag2,
|
|
535
535
|
getCandidateToolOwners2,
|
|
536
536
|
pickNearestPriorOwner2
|
|
537
|
-
} from "./server-
|
|
537
|
+
} from "./server-verzg5w8.js";
|
|
538
538
|
import {
|
|
539
539
|
textMentionsRecentCommit,
|
|
540
540
|
hasMeaningfulUserText2,
|
|
@@ -616,12 +616,12 @@ import {
|
|
|
616
616
|
readRawSessionMessageOrdinalById2,
|
|
617
617
|
readSessionChunk2,
|
|
618
618
|
readRawSessionSeedTail2
|
|
619
|
-
} from "./server-
|
|
619
|
+
} from "./server-s1a0bwpc.js";
|
|
620
620
|
import {
|
|
621
621
|
cleanSearchText,
|
|
622
622
|
matchedSearchSnippet,
|
|
623
623
|
getLastIndexedOrdinal
|
|
624
|
-
} from "./server-
|
|
624
|
+
} from "./server-q8ta10e5.js";
|
|
625
625
|
import"./server-ds8vpfkr.js";
|
|
626
626
|
import {
|
|
627
627
|
getMessageIndexEpoch,
|
|
@@ -648,7 +648,7 @@ import {
|
|
|
648
648
|
resolveMemoriesByIdsForSearch2,
|
|
649
649
|
unifiedSearch2,
|
|
650
650
|
formatSearchResults2
|
|
651
|
-
} from "./server-
|
|
651
|
+
} from "./server-34vhmd1d.js";
|
|
652
652
|
import {
|
|
653
653
|
embedPauseBySession,
|
|
654
654
|
embedRunStateBySession,
|
|
@@ -794,7 +794,7 @@ import {
|
|
|
794
794
|
saveSourceContent,
|
|
795
795
|
replaceSourceContent,
|
|
796
796
|
getSourceContents
|
|
797
|
-
} from "./server-
|
|
797
|
+
} from "./server-166m5nrw.js";
|
|
798
798
|
import {
|
|
799
799
|
startBootDeadline,
|
|
800
800
|
getUnconfirmedMigrationHolders,
|
|
@@ -810,7 +810,7 @@ import {
|
|
|
810
810
|
openDatabaseAsync,
|
|
811
811
|
isDatabasePersisted,
|
|
812
812
|
getDatabasePersistenceError
|
|
813
|
-
} from "./server-
|
|
813
|
+
} from "./server-jew1m85s.js";
|
|
814
814
|
import {
|
|
815
815
|
V2_MEMORY_CATEGORIES,
|
|
816
816
|
CATEGORY_PRIORITY
|
|
@@ -996,14 +996,14 @@ import {
|
|
|
996
996
|
renderMessageByOrdinal2,
|
|
997
997
|
renderVerboseRangeForTool2,
|
|
998
998
|
renderItemByTag2
|
|
999
|
-
} from "./server-
|
|
999
|
+
} from "./server-77207nf4.js";
|
|
1000
1000
|
import"./server-52x68mj4.js";
|
|
1001
1001
|
import {
|
|
1002
1002
|
readV2ArchiveOffThread2
|
|
1003
|
-
} from "./server-
|
|
1003
|
+
} from "./server-xwcg55a8.js";
|
|
1004
1004
|
import {
|
|
1005
1005
|
renderSearchArchiveOffThread2
|
|
1006
|
-
} from "./server-
|
|
1006
|
+
} from "./server-s66wvkpf.js";
|
|
1007
1007
|
import {
|
|
1008
1008
|
markHostInstructionRow,
|
|
1009
1009
|
hostInstructionRow,
|
|
@@ -20637,6 +20637,23 @@ function isClearlyOverWindow(tokens, contextLimit) {
|
|
|
20637
20637
|
return false;
|
|
20638
20638
|
return tokens > contextLimit * UNMANAGED_OVER_WINDOW_FACTOR;
|
|
20639
20639
|
}
|
|
20640
|
+
function appendedTailMayExceedWindow(messages, previousInputTokens, limit) {
|
|
20641
|
+
let remainingBytes = (limit - previousInputTokens) / 2;
|
|
20642
|
+
for (let i = messages.length - 1;i >= 0; --i) {
|
|
20643
|
+
const message = messages[i];
|
|
20644
|
+
if (!message)
|
|
20645
|
+
continue;
|
|
20646
|
+
if (message.info.role === "assistant")
|
|
20647
|
+
break;
|
|
20648
|
+
if (message.info.role !== "user")
|
|
20649
|
+
continue;
|
|
20650
|
+
const size = wireContentBytes([message], remainingBytes, 0.5);
|
|
20651
|
+
if (!size || size.bytes >= remainingBytes)
|
|
20652
|
+
return true;
|
|
20653
|
+
remainingBytes -= size.bytes;
|
|
20654
|
+
}
|
|
20655
|
+
return false;
|
|
20656
|
+
}
|
|
20640
20657
|
|
|
20641
20658
|
class UnmanagedOverWindowError extends Error {
|
|
20642
20659
|
estimatedTokens;
|
|
@@ -20819,7 +20836,7 @@ function createTransform(deps) {
|
|
|
20819
20836
|
}
|
|
20820
20837
|
deps.commitSeenLastPass?.set(sessionId, hasRecentCommit);
|
|
20821
20838
|
};
|
|
20822
|
-
const transform = async (_input, output) => {
|
|
20839
|
+
const transform = async (_input, output, warmFitRetry) => {
|
|
20823
20840
|
const startTime = performance.now();
|
|
20824
20841
|
const historianRun = deps.resolveHistorianRun?.();
|
|
20825
20842
|
const messages = output.messages;
|
|
@@ -21225,9 +21242,9 @@ function createTransform(deps) {
|
|
|
21225
21242
|
};
|
|
21226
21243
|
usagePercentageSynthetic = true;
|
|
21227
21244
|
}
|
|
21228
|
-
let unmanagedOverWindowPass = null;
|
|
21245
|
+
let unmanagedOverWindowPass = warmFitRetry ?? null;
|
|
21229
21246
|
const unmanagedOverWindowCarried = unmanagedOverWindowSessions.has(sessionId);
|
|
21230
|
-
if (fullFeatureMode && !compactionOff && typeof resolvedContextLimit === "number" && resolvedContextLimit > 0 && (unmanagedOverWindowCarried || isFirstTransformPassForSession && getLastCompartmentEndMessage(db, sessionId) < 0 && getMaxDroppedTagNumber2(db, sessionId) === 0)) {
|
|
21247
|
+
if (!warmFitRetry && fullFeatureMode && !compactionOff && typeof resolvedContextLimit === "number" && resolvedContextLimit > 0 && (unmanagedOverWindowCarried || isFirstTransformPassForSession && getLastCompartmentEndMessage(db, sessionId) < 0 && getMaxDroppedTagNumber2(db, sessionId) === 0)) {
|
|
21231
21248
|
try {
|
|
21232
21249
|
const incoming = estimateFinalWireInputTokens({
|
|
21233
21250
|
messages,
|
|
@@ -21256,6 +21273,13 @@ function createTransform(deps) {
|
|
|
21256
21273
|
sessionLog2(sessionId, `transform: over-window first-pass check could not estimate the incoming history: ${getErrorMessage(error)}`);
|
|
21257
21274
|
}
|
|
21258
21275
|
}
|
|
21276
|
+
if (warmFitRetry) {
|
|
21277
|
+
contextUsageEarly = {
|
|
21278
|
+
inputTokens: warmFitRetry.tokens,
|
|
21279
|
+
percentage: warmFitRetry.tokens / warmFitRetry.limit * 100
|
|
21280
|
+
};
|
|
21281
|
+
usagePercentageSynthetic = true;
|
|
21282
|
+
}
|
|
21259
21283
|
const emergencyUsagePercentageEarly = usagePercentageSynthetic ? Math.max(95, contextUsageEarly.percentage) : windowGeometry?.usableHard && contextUsageEarly.inputTokens > 0 ? contextUsageEarly.inputTokens / windowGeometry.usableHard * 100 : contextUsageEarly.percentage;
|
|
21260
21284
|
const currentModelKeyForBoundary = deps.getModelKey?.(sessionId);
|
|
21261
21285
|
const providerProvenLimitForRecovery = earlyStateSnapshot.overflow.needsEmergencyRecovery && earlyStateSnapshot.overflow.emergencyRecoveryOrigin === "provider_overflow" && typeof currentModelKeyForBoundary === "string" && currentModelKeyForBoundary.length > 0 && earlyStateSnapshot.overflow.detectedContextLimit > 0 && piModelRefToCanonical(earlyStateSnapshot.overflow.detectedContextLimitModelKey ?? "") === piModelRefToCanonical(currentModelKeyForBoundary) ? earlyStateSnapshot.overflow.detectedContextLimit : undefined;
|
|
@@ -21356,6 +21380,8 @@ function createTransform(deps) {
|
|
|
21356
21380
|
sessionLog2(sessionId, `transform: first pass after restart: saved reading ${savedReadingForExecute.percentage.toFixed(1)}% is at or above the ${effectiveExecuteThresholdPercentage}% execute threshold; the scheduler decides from it, every other pressure check keeps the cleared reading`);
|
|
21357
21381
|
}
|
|
21358
21382
|
const schedulerDecision = compactionOff ? "defer" : resolveSchedulerDecision(deps.scheduler, sessionMeta, schedulerReadsSavedReading ? savedReadingForExecute : schedulerUsage, sessionId, deps.getModelKey?.(sessionId), resolvedContextLimit);
|
|
21383
|
+
const hardFitLimit = windowGeometry?.usableHard ?? resolvedContextLimit;
|
|
21384
|
+
const warmAppendFit = schedulerDecision === "defer" && !compactionOff && !isFirstTransformPassForSession && !unmanagedOverWindowPass && hardFitLimit !== undefined && hardFitLimit > contextUsageEarly.inputTokens && appendedTailMayExceedWindow(messages, contextUsageEarly.inputTokens, hardFitLimit) ? { limit: hardFitLimit, input: structuredClone(entryOrderForThinkingFit) } : undefined;
|
|
21359
21385
|
const executeFromSavedReading = schedulerReadsSavedReading && schedulerDecision === "execute";
|
|
21360
21386
|
const schedulerDeferReason = schedulerDecision === "defer" ? "scheduler_defer" : null;
|
|
21361
21387
|
const historyRefreshExplicitBeforePrepare = !freezeM0M1 && deps.historyRefreshSessions.has(sessionId);
|
|
@@ -21573,7 +21599,11 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
21573
21599
|
const messagesBeforeInitialPrepare = isCacheBusting && deferredHistoryWasPendingAtPassStart ? [...messages] : null;
|
|
21574
21600
|
if (fullFeatureMode && !compactionOff) {
|
|
21575
21601
|
const tInj = performance.now();
|
|
21576
|
-
pendingCompartmentInjection = prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredHostInstructions, projectIdentity, deps.memoryConfig?.injectionBudgetTokens, deps.experimentalTemporalAwareness
|
|
21602
|
+
pendingCompartmentInjection = prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredHostInstructions, projectIdentity, deps.memoryConfig?.injectionBudgetTokens, deps.experimentalTemporalAwareness, sessionMeta.cachedM0TrimBoundaryId === undefined ? undefined : {
|
|
21603
|
+
hasCachedM0: sessionMeta.cachedM0Bytes !== null,
|
|
21604
|
+
boundary: sessionMeta.cachedM0TrimBoundaryId,
|
|
21605
|
+
partial: sessionMeta.cachedM0TrimBoundaryPartial ?? true
|
|
21606
|
+
});
|
|
21577
21607
|
if (messagesBeforeInitialPrepare) {
|
|
21578
21608
|
const skippedVisibleMessages = pendingCompartmentInjection?.skippedVisibleMessages ?? 0;
|
|
21579
21609
|
trimmedMessagesAtCompactionBoundary = messagesBeforeInitialPrepare.slice(0, skippedVisibleMessages);
|
|
@@ -22367,6 +22397,26 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
22367
22397
|
throw new UnresolvedHistoryBoundaryError(untrimmed.tokens, boundaryContextLimit, historyBoundaryRefusalCause(postTransformResult.prefixTrimRefusal, storedHistoryBoundaryPresence(db, sessionId)), remedy);
|
|
22368
22398
|
}
|
|
22369
22399
|
}
|
|
22400
|
+
if (warmAppendFit) {
|
|
22401
|
+
const served = estimateFinalWireInputTokens({
|
|
22402
|
+
messages,
|
|
22403
|
+
systemPromptTokens: sessionMeta.systemPromptTokens,
|
|
22404
|
+
providerID: modelForBudget?.providerID,
|
|
22405
|
+
modelID: modelForBudget?.modelID,
|
|
22406
|
+
agentName: notificationParams.agent,
|
|
22407
|
+
sessionId
|
|
22408
|
+
});
|
|
22409
|
+
const localTokens = served.toolDefinitionsMeasured ? served.rawTokens ?? served.tokens : Math.max(0, sessionMeta.systemPromptTokens) + served.messageTokens.conversation + served.messageTokens.toolCall;
|
|
22410
|
+
const provenTokens = served.refusalGrade ? served.refusalTokens : undefined;
|
|
22411
|
+
if (provenTokens !== undefined ? provenTokens > warmAppendFit.limit : isClearlyOverWindow(localTokens, warmAppendFit.limit)) {
|
|
22412
|
+
messages.splice(0, messages.length, ...warmAppendFit.input);
|
|
22413
|
+
await transform({}, output, {
|
|
22414
|
+
tokens: provenTokens ?? localTokens,
|
|
22415
|
+
limit: warmAppendFit.limit
|
|
22416
|
+
});
|
|
22417
|
+
return;
|
|
22418
|
+
}
|
|
22419
|
+
}
|
|
22370
22420
|
if (unmanagedOverWindowPass) {
|
|
22371
22421
|
const served = estimateFinalWireInputTokens({
|
|
22372
22422
|
messages,
|
|
@@ -22376,7 +22426,8 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
22376
22426
|
agentName: notificationParams.agent,
|
|
22377
22427
|
sessionId
|
|
22378
22428
|
});
|
|
22379
|
-
const
|
|
22429
|
+
const localTokens = served.toolDefinitionsMeasured ? served.rawTokens ?? served.tokens : Math.max(0, sessionMeta.systemPromptTokens) + served.messageTokens.conversation + served.messageTokens.toolCall;
|
|
22430
|
+
const servedTokens = warmFitRetry && served.refusalGrade ? served.refusalTokens ?? localTokens : localTokens;
|
|
22380
22431
|
if (!Number.isFinite(servedTokens) || servedTokens > unmanagedOverWindowPass.limit) {
|
|
22381
22432
|
sessionLog2(sessionId, `over-window first pass not sent: the request is still about ${servedTokens} tokens after this pass, over the ${unmanagedOverWindowPass.limit}-token window (history started at ${unmanagedOverWindowPass.tokens}) (MC-H06)`);
|
|
22382
22433
|
throw new UnmanagedOverWindowError(servedTokens, unmanagedOverWindowPass.limit);
|
|
@@ -26106,7 +26157,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26106
26157
|
const db = readDatabase();
|
|
26107
26158
|
if (!db)
|
|
26108
26159
|
return { ok: false, error: "db unavailable" };
|
|
26109
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
26160
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-ayy7xzm3.js"));
|
|
26110
26161
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-8g4r97bp.js"));
|
|
26111
26162
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
26112
26163
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -26191,7 +26242,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26191
26242
|
const db = readDatabase();
|
|
26192
26243
|
if (!db)
|
|
26193
26244
|
return { ok: false, error: "db unavailable" };
|
|
26194
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
26245
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-ksdzyfby.js"));
|
|
26195
26246
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
26196
26247
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
26197
26248
|
const ctx = {
|
|
@@ -58373,7 +58424,9 @@ async function registerContext(context) {
|
|
|
58373
58424
|
cause
|
|
58374
58425
|
});
|
|
58375
58426
|
}
|
|
58376
|
-
|
|
58427
|
+
const measured = estimate.refusalGrade ? estimate.refusalTokens : undefined;
|
|
58428
|
+
const oversized = measured !== undefined && Number.isFinite(measured) ? measured > limit : isClearlyOverWindow(estimate.rawTokens ?? 0, limit);
|
|
58429
|
+
if (!oversized)
|
|
58377
58430
|
return;
|
|
58378
58431
|
await refuseBeforeProvider(context.session, draft.sessionID, "checkpoint-over-window");
|
|
58379
58432
|
throw new V2ContextRefusal("Magic Context refused an oversized host checkpoint.");
|