@cortexkit/opencode-magic-context 0.49.27 → 0.49.28
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/{context-t2k97d6v.js → context-dxfztzsd.js} +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +2 -2
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/{index-qzbpbnqt.js → index-k9jx7ma9.js} +18 -3
- package/dist/index.js +3 -3
- package/dist/v2/{context-na0esngr.js → context-0qhz1nnj.js} +18 -3
- package/dist/v2/server.js +2 -2
- package/package.json +1 -1
|
@@ -10,8 +10,8 @@ import { type DreamerModuleRoute } from "./module-apply";
|
|
|
10
10
|
* Minimum wall-clock budget for one agentic mapping batch. Keep the existing
|
|
11
11
|
* four-minute floor even with smaller batches: reducing the memory count does
|
|
12
12
|
* not bound the latency of a slow provider or an individual tool investigation.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Timeout splits each receive this same floor, if the task deadline permits;
|
|
14
|
+
* otherwise the unmapped remainder resumes on a later run.
|
|
15
15
|
*/
|
|
16
16
|
export declare const MAP_BATCH_FLOOR_MS = 240000;
|
|
17
17
|
/** Cap on already-mapped file-independent rows re-queued per run. A silent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-memories.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/map-memories.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAER,wBAAwB,EAC3B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAS3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAIH,KAAK,mBAAmB,EAG3B,MAAM,WAAW,CAAC;AAKnB,OAAO,EAAE,KAAK,gBAAg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AE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAK5F;AAQD;;;;2EAI2E;AAC3E,wBAAgB,+BAA+B,CAC3C,KAAK,EAAE;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACvC,EACD,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAChB,OAAO,CAOT;AAcD;;2CAE2C;AAC3C,wBAAgB,qBAAqB,CACjC,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,eAAe,UAAQ,GACxB,cAAc,EAAE,CAwBlB;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAoKnF;AAwND;;8EAE8E;AAC9E,wBAAsB,kBAAkB,CACpC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,cAAc,EAAE,EACvB,YAAY,EAAE,MAAM,GACrB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAOlD"}
|
|
@@ -7184,8 +7184,8 @@ async function mapMemories(args) {
|
|
|
7184
7184
|
result.failureStage = outcome.failure.stage;
|
|
7185
7185
|
}
|
|
7186
7186
|
const committed = outcome.mapped + outcome.independent;
|
|
7187
|
+
const committedIds = new Set(outcome.committedIds);
|
|
7187
7188
|
runLeaseGuardedWrite(args.db, args.holderId, args.leaseKey, () => {
|
|
7188
|
-
const committedIds = new Set(outcome.committedIds);
|
|
7189
7189
|
for (const memory of batch.inputs) {
|
|
7190
7190
|
if (committedIds.has(memory.id)) {
|
|
7191
7191
|
delete retries[memory.id];
|
|
@@ -7220,7 +7220,22 @@ async function mapMemories(args) {
|
|
|
7220
7220
|
log2(`[dreamer] map-memories: targeted retry still omitted ${outcome.requeue.length} id(s); leaving them unmapped for the next run`);
|
|
7221
7221
|
}
|
|
7222
7222
|
}
|
|
7223
|
-
if (outcome.failure?.class === "timeout" &&
|
|
7223
|
+
if (outcome.failure?.class === "timeout" && batch.inputs.length > 1) {
|
|
7224
|
+
const unmapped = batch.inputs.filter((memory) => !committedIds.has(memory.id));
|
|
7225
|
+
const splitSize = Math.floor(batch.inputs.length / 2);
|
|
7226
|
+
const splits = [];
|
|
7227
|
+
for (let offset = 0;offset < unmapped.length; offset += splitSize) {
|
|
7228
|
+
splits.push({
|
|
7229
|
+
inputs: unmapped.slice(offset, offset + splitSize),
|
|
7230
|
+
isOmissionRetry: batch.isOmissionRetry
|
|
7231
|
+
});
|
|
7232
|
+
}
|
|
7233
|
+
if (splits.length > 0) {
|
|
7234
|
+
batches.splice(i + 1, 0, ...splits);
|
|
7235
|
+
log2(`[dreamer] map-memories: splitting batch [${batch.inputs.map((memory) => memory.id).join(",")}] into ${splits.map((split) => split.inputs.length).join("+")} after timeout; retrying ${unmapped.length} uncommitted mapping(s)`);
|
|
7236
|
+
}
|
|
7237
|
+
}
|
|
7238
|
+
if (outcome.failure?.class === "timeout" && batch.inputs.length === 1 && committed === 0) {
|
|
7224
7239
|
consecutiveTimeouts += 1;
|
|
7225
7240
|
timeoutStreakElapsedMs.push(outcome.failure.elapsedMs);
|
|
7226
7241
|
if (consecutiveTimeouts >= CONSECUTIVE_TIMEOUT_LIMIT2) {
|
|
@@ -7228,7 +7243,7 @@ async function mapMemories(args) {
|
|
|
7228
7243
|
log2(`[dreamer] map-memories starvation: circuit breaker tripped after ${consecutiveTimeouts} consecutive batch timeouts with no committed mappings (investigation made no durable progress); per-batch elapsed [${timeoutStreakElapsedMs.join("ms, ")}ms] vs ${sliceMs}ms slice; stopping with ${result.remaining} mapping(s) remaining`);
|
|
7229
7244
|
break;
|
|
7230
7245
|
}
|
|
7231
|
-
} else {
|
|
7246
|
+
} else if (committed > 0 || outcome.failure?.class !== "timeout") {
|
|
7232
7247
|
consecutiveTimeouts = 0;
|
|
7233
7248
|
timeoutStreakElapsedMs = [];
|
|
7234
7249
|
}
|
package/dist/index.js
CHANGED
|
@@ -187,7 +187,7 @@ import {
|
|
|
187
187
|
parameterDescriptionsFor,
|
|
188
188
|
MagicContextRpcServer,
|
|
189
189
|
applyHiddenSubagentTemperature
|
|
190
|
-
} from "./index-
|
|
190
|
+
} from "./index-k9jx7ma9.js";
|
|
191
191
|
import {
|
|
192
192
|
resolveOpenCodeDbPath,
|
|
193
193
|
openCodeDbPathExists,
|
|
@@ -8191,7 +8191,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8191
8191
|
// package.json
|
|
8192
8192
|
var package_default = {
|
|
8193
8193
|
name: "@cortexkit/opencode-magic-context",
|
|
8194
|
-
version: "0.49.
|
|
8194
|
+
version: "0.49.28",
|
|
8195
8195
|
type: "module",
|
|
8196
8196
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8197
8197
|
main: "dist/index.js",
|
|
@@ -12045,7 +12045,7 @@ async function setup(context) {
|
|
|
12045
12045
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12046
12046
|
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.`);
|
|
12047
12047
|
}
|
|
12048
|
-
const { registerContext } = await import("./context-
|
|
12048
|
+
const { registerContext } = await import("./context-dxfztzsd.js");
|
|
12049
12049
|
setHarness2("opencode2");
|
|
12050
12050
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12051
12051
|
const duties = await registerContext(context);
|
|
@@ -32160,8 +32160,8 @@ async function mapMemories(args) {
|
|
|
32160
32160
|
result.failureStage = outcome.failure.stage;
|
|
32161
32161
|
}
|
|
32162
32162
|
const committed = outcome.mapped + outcome.independent;
|
|
32163
|
+
const committedIds = new Set(outcome.committedIds);
|
|
32163
32164
|
runLeaseGuardedWrite(args.db, args.holderId, args.leaseKey, () => {
|
|
32164
|
-
const committedIds = new Set(outcome.committedIds);
|
|
32165
32165
|
for (const memory of batch.inputs) {
|
|
32166
32166
|
if (committedIds.has(memory.id)) {
|
|
32167
32167
|
delete retries[memory.id];
|
|
@@ -32196,7 +32196,22 @@ async function mapMemories(args) {
|
|
|
32196
32196
|
log2(`[dreamer] map-memories: targeted retry still omitted ${outcome.requeue.length} id(s); leaving them unmapped for the next run`);
|
|
32197
32197
|
}
|
|
32198
32198
|
}
|
|
32199
|
-
if (outcome.failure?.class === "timeout" &&
|
|
32199
|
+
if (outcome.failure?.class === "timeout" && batch.inputs.length > 1) {
|
|
32200
|
+
const unmapped = batch.inputs.filter((memory) => !committedIds.has(memory.id));
|
|
32201
|
+
const splitSize = Math.floor(batch.inputs.length / 2);
|
|
32202
|
+
const splits = [];
|
|
32203
|
+
for (let offset = 0;offset < unmapped.length; offset += splitSize) {
|
|
32204
|
+
splits.push({
|
|
32205
|
+
inputs: unmapped.slice(offset, offset + splitSize),
|
|
32206
|
+
isOmissionRetry: batch.isOmissionRetry
|
|
32207
|
+
});
|
|
32208
|
+
}
|
|
32209
|
+
if (splits.length > 0) {
|
|
32210
|
+
batches.splice(i + 1, 0, ...splits);
|
|
32211
|
+
log2(`[dreamer] map-memories: splitting batch [${batch.inputs.map((memory) => memory.id).join(",")}] into ${splits.map((split) => split.inputs.length).join("+")} after timeout; retrying ${unmapped.length} uncommitted mapping(s)`);
|
|
32212
|
+
}
|
|
32213
|
+
}
|
|
32214
|
+
if (outcome.failure?.class === "timeout" && batch.inputs.length === 1 && committed === 0) {
|
|
32200
32215
|
consecutiveTimeouts += 1;
|
|
32201
32216
|
timeoutStreakElapsedMs.push(outcome.failure.elapsedMs);
|
|
32202
32217
|
if (consecutiveTimeouts >= CONSECUTIVE_TIMEOUT_LIMIT2) {
|
|
@@ -32204,7 +32219,7 @@ async function mapMemories(args) {
|
|
|
32204
32219
|
log2(`[dreamer] map-memories starvation: circuit breaker tripped after ${consecutiveTimeouts} consecutive batch timeouts with no committed mappings (investigation made no durable progress); per-batch elapsed [${timeoutStreakElapsedMs.join("ms, ")}ms] vs ${sliceMs}ms slice; stopping with ${result.remaining} mapping(s) remaining`);
|
|
32205
32220
|
break;
|
|
32206
32221
|
}
|
|
32207
|
-
} else {
|
|
32222
|
+
} else if (committed > 0 || outcome.failure?.class !== "timeout") {
|
|
32208
32223
|
consecutiveTimeouts = 0;
|
|
32209
32224
|
timeoutStreakElapsedMs = [];
|
|
32210
32225
|
}
|
package/dist/v2/server.js
CHANGED
|
@@ -7874,7 +7874,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
7874
7874
|
// package.json
|
|
7875
7875
|
var package_default = {
|
|
7876
7876
|
name: "@cortexkit/opencode-magic-context",
|
|
7877
|
-
version: "0.49.
|
|
7877
|
+
version: "0.49.28",
|
|
7878
7878
|
type: "module",
|
|
7879
7879
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
7880
7880
|
main: "dist/index.js",
|
|
@@ -8195,7 +8195,7 @@ async function setup(context) {
|
|
|
8195
8195
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
8196
8196
|
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.`);
|
|
8197
8197
|
}
|
|
8198
|
-
const { registerContext } = await import("./context-
|
|
8198
|
+
const { registerContext } = await import("./context-0qhz1nnj.js");
|
|
8199
8199
|
setHarness2("opencode2");
|
|
8200
8200
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
8201
8201
|
const duties = await registerContext(context);
|
package/package.json
CHANGED