@cortexkit/opencode-magic-context 0.49.78 → 0.49.80
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 +2 -2
- package/dist/chunk-embedding-write-worker.js +1 -1
- package/dist/{context-6pxdmpay.js → context-7rkrv5q8.js} +162 -68
- package/dist/{derive-budgets-def8genf.js → derive-budgets-2z6xxm7e.js} +1 -1
- package/dist/{embedding-backfill-rrmzvg7n.js → embedding-backfill-0tvprmrn.js} +1 -1
- package/dist/features/magic-context/dreamer/curate-category-rotation.d.ts +1 -1
- package/dist/features/magic-context/dreamer/curate-category-rotation.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/curate-memory-safety.d.ts +5 -1
- package/dist/features/magic-context/dreamer/curate-memory-safety.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +2 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-backfill.d.ts +4 -0
- package/dist/features/magic-context/memory/embedding-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/hooks/magic-context/image-token-estimate.d.ts.map +1 -1
- package/dist/{index-16h5fhem.js → index-177yv84k.js} +4 -6
- package/dist/{index-8mt6vvwx.js → index-2q0t43fy.js} +1 -1
- package/dist/{index-jfs6k0xk.js → index-9554nr2q.js} +6 -6
- package/dist/{index-kn23xzst.js → index-aawwdt26.js} +1 -1
- package/dist/{index-dcdk1thy.js → index-exvsw656.js} +7 -7
- package/dist/{index-7jj5jk78.js → index-ezgeq2z7.js} +5 -5
- package/dist/{index-xkn7vq89.js → index-hpmx99e9.js} +4 -4
- package/dist/{index-c3a833vk.js → index-jhhkb4jv.js} +2 -2
- package/dist/{index-cssarkg7.js → index-m4q6ptgz.js} +4 -4
- package/dist/{index-r865s8hf.js → index-m6rkq3t4.js} +1 -1
- package/dist/{index-1pfjvk89.js → index-mgvj4vkb.js} +7 -7
- package/dist/{index-ngwmx6nt.js → index-tky3j43e.js} +47 -5
- package/dist/{index-k6b1av2m.js → index-twmeey4h.js} +2 -2
- package/dist/{index-enpatj5k.js → index-v0epndb8.js} +7 -7
- package/dist/{index-c7xvvhdd.js → index-xjpemea9.js} +115 -68
- package/dist/{index-rjm4hjyb.js → index-xsdaz3mq.js} +1 -1
- package/dist/{index-bdnak4d0.js → index-y208s7zx.js} +5 -3
- package/dist/{index-72qk8fs8.js → index-zpd4pxnp.js} +13 -8
- package/dist/{index-vr6t0y4w.js → index-zzvd4a9z.js} +1 -1
- package/dist/index.js +21 -21
- package/dist/{message-index-bounded-s0bckzqz.js → message-index-bounded-cfkeyf72.js} +3 -3
- package/dist/migration-worker.js +1 -1
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-kqyb1y8c.js → read-session-chunk-s3qac56g.js} +2 -2
- package/dist/{recomp-orchestrator-38ed4yhj.js → recomp-orchestrator-n7h0a0tn.js} +10 -10
- package/dist/{render-8s531gd5.js → render-bjxgkrk6.js} +6 -6
- package/dist/{search-archive-2f1j2dh8.js → search-archive-p3jhx9wc.js} +4 -4
- package/dist/{search-m4r4v4aw.js → search-z56487n8.js} +7 -7
- package/dist/shared/models-dev-cache.d.ts +2 -0
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +9 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/{storage-tags-d3nqrva7.js → storage-tags-6e83pvff.js} +1 -1
- package/dist/{store-j5rvve3v.js → store-8trkpmtx.js} +3 -1
- package/dist/{transform-postprocess-phase-ch5fsw7h.js → transform-postprocess-phase-f0wssyce.js} +11 -11
- package/dist/v2/auto-search-worker.js +2 -2
- package/dist/v2/chunk-embedding-write-worker.js +2 -2
- package/dist/v2/{context-h3r9gxrd.js → context-r1swhysg.js} +256 -119
- package/dist/v2/{derive-budgets-z93fdnp7.js → derive-budgets-2eam671q.js} +2 -2
- package/dist/v2/{embedding-backfill-g9scycm5.js → embedding-backfill-qnaswpmb.js} +1 -1
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/owner.d.ts +2 -4
- package/dist/v2/fold/owner.d.ts.map +1 -1
- package/dist/v2/fold/partial-boundary.d.ts +25 -0
- package/dist/v2/fold/partial-boundary.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-vfx2zx9y.js → message-index-bounded-0xy4dn04.js} +3 -3
- package/dist/v2/migration-worker.js +2 -2
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-bh402br0.js → read-session-chunk-6mt2t6dy.js} +2 -2
- package/dist/v2/{recomp-orchestrator-43grkr1k.js → recomp-orchestrator-4w2w4kd4.js} +12 -12
- package/dist/v2/{render-90pve6jf.js → render-hwqk0d8t.js} +7 -7
- package/dist/v2/{search-archive-ha08g13n.js → search-archive-mdxzvgpm.js} +4 -4
- package/dist/v2/{search-xr5wb3a3.js → search-eftsvbg7.js} +6 -6
- package/dist/v2/{server-86vydsx9.js → server-0dmzr7f9.js} +2 -2
- package/dist/v2/{server-kmaxv4g3.js → server-25qtxt4d.js} +6 -6
- package/dist/v2/{server-6jxvkyrr.js → server-2gcfmd47.js} +1 -1
- package/dist/v2/{server-wc0bb04b.js → server-34pvhvxt.js} +8 -8
- package/dist/v2/{server-468mya5v.js → server-39bcszk4.js} +47 -1
- package/dist/v2/{server-b8qp1ark.js → server-76v5y7zm.js} +2 -2
- package/dist/v2/{server-9sf3qp02.js → server-bj779zmp.js} +1 -1
- package/dist/v2/{server-gsz7h1zr.js → server-dhdn8mwq.js} +1 -1
- package/dist/v2/{server-92fhew3p.js → server-fqnty3nk.js} +10 -10
- package/dist/v2/{server-qcbxjpkv.js → server-ma9jwnas.js} +4 -4
- package/dist/v2/{server-2adwe0be.js → server-nqdzv8b7.js} +47 -5
- package/dist/v2/{server-65r7p1z4.js → server-pxdpwycq.js} +12 -7
- package/dist/v2/{server-fw2sjpkx.js → server-r00xyx66.js} +1 -1
- package/dist/v2/{server-aewxmvnf.js → server-rp52f40v.js} +1 -1
- package/dist/v2/{server-10af6m7d.js → server-x8ksqcw7.js} +4 -6
- package/dist/v2/{server-cxkb9725.js → server-xdh4r20h.js} +5 -3
- package/dist/v2/{server-fjd90bk0.js → server-zw1e3wq5.js} +2 -2
- package/dist/v2/server.js +4 -4
- package/dist/v2/{storage-tags-j4he6hwe.js → storage-tags-z8j8wq34.js} +1 -1
- package/dist/v2/{store-1fax2zhj.js → store-m3zny7q2.js} +4 -2
- package/dist/v2/{v2-archive-reader-xs0d7yyr.js → v2-archive-reader-p89x05hj.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-ghbsa00k.js → wrapup-orchestrator-0f4nwpbv.js} +12 -12
- package/dist/{v2-archive-reader-maj9xst8.js → v2-archive-reader-vzmzb245.js} +1 -1
- package/dist/{wrapup-orchestrator-q12ejyw9.js → wrapup-orchestrator-5k9hgb3t.js} +11 -11
- package/package.json +1 -1
- package/src/shared/models-dev-cache.test.ts +67 -1
- package/src/shared/models-dev-cache.ts +71 -4
- package/src/shared/subagent-runner.ts +10 -0
|
@@ -196,7 +196,7 @@ import {
|
|
|
196
196
|
snapRangeToCompartments,
|
|
197
197
|
getActiveCompartmentRun,
|
|
198
198
|
startCompartmentAgent
|
|
199
|
-
} from "./index-
|
|
199
|
+
} from "./index-exvsw656.js";
|
|
200
200
|
import {
|
|
201
201
|
hasTrustedAbsoluteWall,
|
|
202
202
|
applyProvenInputFloor,
|
|
@@ -208,7 +208,7 @@ import {
|
|
|
208
208
|
deriveTriggerBudget2,
|
|
209
209
|
resolveKnownHistorianContextLimit2,
|
|
210
210
|
resolveHistorianProducerLimits2
|
|
211
|
-
} from "./index-
|
|
211
|
+
} from "./index-tky3j43e.js";
|
|
212
212
|
import {
|
|
213
213
|
resolveModelCalibration,
|
|
214
214
|
calibrateBuckets,
|
|
@@ -355,7 +355,7 @@ import {
|
|
|
355
355
|
getTagsByNumbers2,
|
|
356
356
|
getDroppedTagsByNumbers2,
|
|
357
357
|
getMaxDroppedTagNumber2
|
|
358
|
-
} from "./index-
|
|
358
|
+
} from "./index-y208s7zx.js";
|
|
359
359
|
import {
|
|
360
360
|
BoundedSessionMap,
|
|
361
361
|
observeTemporalDecisions,
|
|
@@ -427,7 +427,7 @@ import {
|
|
|
427
427
|
readRawSessionMessageById2,
|
|
428
428
|
readSessionChunk2,
|
|
429
429
|
readRawSessionSeedTail2
|
|
430
|
-
} from "./index-
|
|
430
|
+
} from "./index-2q0t43fy.js";
|
|
431
431
|
import {
|
|
432
432
|
isFailClosedBlockingError,
|
|
433
433
|
shouldBypassFailClosedBlock,
|
|
@@ -453,7 +453,7 @@ import {
|
|
|
453
453
|
runSqliteOptimize,
|
|
454
454
|
openDatabase,
|
|
455
455
|
openCurrentDatabase
|
|
456
|
-
} from "./index-
|
|
456
|
+
} from "./index-aawwdt26.js";
|
|
457
457
|
import {
|
|
458
458
|
unescapeXml,
|
|
459
459
|
resolveWorkspaceShareCategories,
|
|
@@ -569,10 +569,10 @@ import {
|
|
|
569
569
|
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
570
570
|
getProjectState,
|
|
571
571
|
bumpProjectUserProfileVersion
|
|
572
|
-
} from "./index-
|
|
572
|
+
} from "./index-xsdaz3mq.js";
|
|
573
573
|
import {
|
|
574
574
|
getLastIndexedOrdinal
|
|
575
|
-
} from "./index-
|
|
575
|
+
} from "./index-zzvd4a9z.js";
|
|
576
576
|
import {
|
|
577
577
|
SESSION_NOTE_CONDITION_ERROR,
|
|
578
578
|
getNoteByIdInScope,
|
|
@@ -657,7 +657,7 @@ import {
|
|
|
657
657
|
readGitFileChangeTimesSince,
|
|
658
658
|
verificationFileExists,
|
|
659
659
|
normalizeVerificationFiles
|
|
660
|
-
} from "./index-
|
|
660
|
+
} from "./index-9554nr2q.js";
|
|
661
661
|
import {
|
|
662
662
|
computeCueContentHash,
|
|
663
663
|
hasMuralCueColumns,
|
|
@@ -704,13 +704,13 @@ import {
|
|
|
704
704
|
resolveMemoriesByIdsForSearch2,
|
|
705
705
|
unifiedSearch2,
|
|
706
706
|
formatSearchResults2
|
|
707
|
-
} from "./index-
|
|
707
|
+
} from "./index-zpd4pxnp.js";
|
|
708
708
|
import {
|
|
709
709
|
scheduleReconciliation,
|
|
710
710
|
scheduleIncrementalIndex,
|
|
711
711
|
getMessageIndexQueueHeapStats,
|
|
712
712
|
clearSessionTracking
|
|
713
|
-
} from "./index-
|
|
713
|
+
} from "./index-m6rkq3t4.js";
|
|
714
714
|
import {
|
|
715
715
|
flushIgnoredMessages2,
|
|
716
716
|
clearIgnoredMessages2,
|
|
@@ -720,7 +720,7 @@ import {
|
|
|
720
720
|
import {
|
|
721
721
|
setRecompStarting2,
|
|
722
722
|
setRecompTerminal2
|
|
723
|
-
} from "./index-
|
|
723
|
+
} from "./index-hpmx99e9.js";
|
|
724
724
|
import {
|
|
725
725
|
makeToolCompositeKey,
|
|
726
726
|
searchMessageHistoryOffThread,
|
|
@@ -805,7 +805,7 @@ import {
|
|
|
805
805
|
abortSessionFailClosed2,
|
|
806
806
|
evaluateEmergencyFailClosed2,
|
|
807
807
|
runPostTransformPhase2
|
|
808
|
-
} from "./index-
|
|
808
|
+
} from "./index-mgvj4vkb.js";
|
|
809
809
|
import {
|
|
810
810
|
ANNOUNCEMENT_VERSION2,
|
|
811
811
|
ANNOUNCEMENT_FEATURES2,
|
|
@@ -820,13 +820,13 @@ import {
|
|
|
820
820
|
renderMessageByOrdinal2,
|
|
821
821
|
renderVerboseRangeForTool2,
|
|
822
822
|
renderItemByTag2
|
|
823
|
-
} from "./index-
|
|
823
|
+
} from "./index-twmeey4h.js";
|
|
824
824
|
import {
|
|
825
825
|
readV2ArchiveOffThread2
|
|
826
|
-
} from "./index-
|
|
826
|
+
} from "./index-m4q6ptgz.js";
|
|
827
827
|
import {
|
|
828
828
|
renderSearchArchiveOffThread2
|
|
829
|
-
} from "./index-
|
|
829
|
+
} from "./index-jhhkb4jv.js";
|
|
830
830
|
import {
|
|
831
831
|
COMPACTION_ENABLED_PATH,
|
|
832
832
|
isDreamerRunnable,
|
|
@@ -4011,7 +4011,7 @@ function beginCurateCategoryRun(db, projectIdentity, memories) {
|
|
|
4011
4011
|
}));
|
|
4012
4012
|
return scope;
|
|
4013
4013
|
}
|
|
4014
|
-
function
|
|
4014
|
+
function curateTaskStateAfterCategoryTurn(db, projectIdentity, category) {
|
|
4015
4015
|
const state = readState(db, projectIdentity);
|
|
4016
4016
|
return JSON.stringify({
|
|
4017
4017
|
...state,
|
|
@@ -4055,6 +4055,22 @@ function isDirectiveShapedProjectRule(category, content) {
|
|
|
4055
4055
|
// src/features/magic-context/dreamer/curate-memory-safety.ts
|
|
4056
4056
|
var PROJECT_SCOPED_CATEGORIES = new Set(V2_MEMORY_CATEGORIES);
|
|
4057
4057
|
var USER_PROFILE_REFERENCE = /\buser(?:[\s_-]+)(?:profile|preferences?)\b|\bU\d+\b/i;
|
|
4058
|
+
var CURATE_SAFETY_REFUSAL_REASONS = [
|
|
4059
|
+
"missing-active-same-category-successor",
|
|
4060
|
+
"user-profile-is-not-project-memory",
|
|
4061
|
+
"directive-shaped-project-rule",
|
|
4062
|
+
"content-loss"
|
|
4063
|
+
];
|
|
4064
|
+
var refusalReasons = new Set(CURATE_SAFETY_REFUSAL_REASONS);
|
|
4065
|
+
function parseCurateSafetyRefusal(action, output) {
|
|
4066
|
+
if (action !== "archive" && action !== "update")
|
|
4067
|
+
return null;
|
|
4068
|
+
const refusal = /^Skipped (archive|update) for memory \[ID: -?\d+(?:, -?\d+)*\]: curate safety refusal \(([a-z,-]+)\); refused=[1-9]\d*\.$/.exec(output);
|
|
4069
|
+
if (refusal?.[1] !== action || !refusal[2])
|
|
4070
|
+
return null;
|
|
4071
|
+
const reasons = [...new Set(refusal[2].split(","))];
|
|
4072
|
+
return reasons.every((reason) => refusalReasons.has(reason)) ? reasons : null;
|
|
4073
|
+
}
|
|
4058
4074
|
var refusalCountsBySession = new Map;
|
|
4059
4075
|
function isSurvivingConsolidationTarget(memory, successor, projectIdentity) {
|
|
4060
4076
|
return successor !== null && successor.id !== memory.id && successor.status === "active" && successor.supersededByMemoryId === null && (successor.expiresAt === null || successor.expiresAt > Date.now()) && projectIdentity(successor) === projectIdentity(memory) && successor.category === memory.category;
|
|
@@ -10053,8 +10069,11 @@ function validateCurateAssistantText(text) {
|
|
|
10053
10069
|
}
|
|
10054
10070
|
return text;
|
|
10055
10071
|
}
|
|
10072
|
+
function emptyCurateMemoryOperations() {
|
|
10073
|
+
return { totalCalls: 0, completedActions: [], refusals: [] };
|
|
10074
|
+
}
|
|
10056
10075
|
function inspectCurateMemoryOperations(messages) {
|
|
10057
|
-
const summary =
|
|
10076
|
+
const summary = emptyCurateMemoryOperations();
|
|
10058
10077
|
if (!Array.isArray(messages))
|
|
10059
10078
|
return summary;
|
|
10060
10079
|
for (const message of messages) {
|
|
@@ -10069,28 +10088,69 @@ function inspectCurateMemoryOperations(messages) {
|
|
|
10069
10088
|
const toolName = part.tool ?? part.name;
|
|
10070
10089
|
if (toolName !== "ctx_memory")
|
|
10071
10090
|
continue;
|
|
10091
|
+
const state = isRecord(part.state) ? part.state : null;
|
|
10092
|
+
const input = isRecord(state?.input) ? state.input : null;
|
|
10093
|
+
const action = input?.action;
|
|
10094
|
+
const output = state?.status === "completed" && typeof state.output === "string" ? state.output : null;
|
|
10095
|
+
if (output && (action === "get" || action === "list") && /^(?:Found \d+ (?:active )?memor(?:y|ies):|No active memories found\.$|id -?\d+: not found or not visible from this project)/.test(output))
|
|
10096
|
+
continue;
|
|
10072
10097
|
summary.totalCalls += 1;
|
|
10073
|
-
if (!
|
|
10098
|
+
if (!output)
|
|
10074
10099
|
continue;
|
|
10075
|
-
|
|
10076
|
-
const action = input?.action;
|
|
10077
|
-
const output = typeof part.state.output === "string" ? part.state.output : "";
|
|
10078
|
-
if (output === "completed" && (action === "merge" || action === "archive" || action === "update") || action === "merge" && output.startsWith("Merged memories") || action === "archive" && output.startsWith("Archived memor") || action === "update" && output.startsWith("Updated memory"))
|
|
10100
|
+
if (action === "merge" && output.startsWith("Merged memories") || action === "archive" && output.startsWith("Archived memor") || action === "update" && output.startsWith("Updated memory")) {
|
|
10079
10101
|
summary.completedActions.push(action);
|
|
10102
|
+
} else {
|
|
10103
|
+
const reasons = parseCurateSafetyRefusal(action, output);
|
|
10104
|
+
if (reasons)
|
|
10105
|
+
summary.refusals.push(reasons);
|
|
10106
|
+
}
|
|
10080
10107
|
}
|
|
10081
10108
|
}
|
|
10082
10109
|
return summary;
|
|
10083
10110
|
}
|
|
10111
|
+
function unrecognisedCurateOperations(operations) {
|
|
10112
|
+
return operations.totalCalls - operations.completedActions.length - operations.refusals.length;
|
|
10113
|
+
}
|
|
10114
|
+
function validateCurateOutput(messages, text, transport) {
|
|
10115
|
+
const operations = inspectCurateMemoryOperations(messages);
|
|
10116
|
+
if (text)
|
|
10117
|
+
validateCurateAssistantText(text);
|
|
10118
|
+
if (operations.completedActions.length || operations.refusals.length && !unrecognisedCurateOperations(operations))
|
|
10119
|
+
return operations;
|
|
10120
|
+
if (!text && transport === "child")
|
|
10121
|
+
throw new Error("Dreamer returned no assistant output.");
|
|
10122
|
+
if (operations.totalCalls > 0)
|
|
10123
|
+
throw new Error("Curate returned no completed ctx_memory tool result.");
|
|
10124
|
+
if (!text)
|
|
10125
|
+
throw new Error("Dreamer returned no assistant output.");
|
|
10126
|
+
return operations;
|
|
10127
|
+
}
|
|
10084
10128
|
function formatExpiredArchiveProgress(count) {
|
|
10085
10129
|
return `curate: archived ${count} expired ${count === 1 ? "memory" : "memories"}`;
|
|
10086
10130
|
}
|
|
10087
|
-
function formatCurateMemoryOperations(
|
|
10131
|
+
function formatCurateMemoryOperations(operations) {
|
|
10132
|
+
const { completedActions: actions, refusals } = operations;
|
|
10133
|
+
if (!actions.length && !refusals.length)
|
|
10134
|
+
return null;
|
|
10088
10135
|
const actionCounts = new Map;
|
|
10089
10136
|
for (const action of actions)
|
|
10090
10137
|
actionCounts.set(action, (actionCounts.get(action) ?? 0) + 1);
|
|
10091
10138
|
const actionDetail = [...actionCounts].map(([action, count]) => count === 1 ? action : `${action} ×${count}`).join(", ");
|
|
10092
|
-
const
|
|
10093
|
-
|
|
10139
|
+
const applied = actions.length ? `${actions.length} memory ${actions.length === 1 ? "operation" : "operations"} applied (${actionDetail})` : "no changes";
|
|
10140
|
+
const detail = [`curate: ${applied}`];
|
|
10141
|
+
if (refusals.length) {
|
|
10142
|
+
const reasonCounts = new Map;
|
|
10143
|
+
for (const reasons of refusals) {
|
|
10144
|
+
for (const reason of reasons)
|
|
10145
|
+
reasonCounts.set(reason, (reasonCounts.get(reason) ?? 0) + 1);
|
|
10146
|
+
}
|
|
10147
|
+
const countedReasons = [...reasonCounts].sort(([a], [b]) => a.localeCompare(b)).map(([reason, count]) => `${reason} ×${count}`).join(", ");
|
|
10148
|
+
detail.push(`${refusals.length} ${refusals.length === 1 ? "operation" : "operations"} refused (${countedReasons})`);
|
|
10149
|
+
}
|
|
10150
|
+
const unrecognised = unrecognisedCurateOperations(operations);
|
|
10151
|
+
if (unrecognised)
|
|
10152
|
+
detail.push(`${unrecognised} with an unrecognised result`);
|
|
10153
|
+
return detail.join("; ");
|
|
10094
10154
|
}
|
|
10095
10155
|
function requireDreamClient(client) {
|
|
10096
10156
|
if (!client)
|
|
@@ -10298,6 +10358,7 @@ function createDreamTaskExecutor(deps) {
|
|
|
10298
10358
|
};
|
|
10299
10359
|
return writtenIds.length || deletedIds.length || archivedIds.length || mergedIds.length ? changes : null;
|
|
10300
10360
|
}
|
|
10361
|
+
let curateCategory;
|
|
10301
10362
|
try {
|
|
10302
10363
|
const skip = (reason) => {
|
|
10303
10364
|
log2(`[dreamer] ${config.task}: skipped (${reason})`);
|
|
@@ -10609,7 +10670,10 @@ function createDreamTaskExecutor(deps) {
|
|
|
10609
10670
|
computeMemoryDelta,
|
|
10610
10671
|
reportProgress,
|
|
10611
10672
|
leaseAcquisition,
|
|
10612
|
-
moduleRoute
|
|
10673
|
+
moduleRoute,
|
|
10674
|
+
onCurateCategory: (category) => {
|
|
10675
|
+
curateCategory = category;
|
|
10676
|
+
}
|
|
10613
10677
|
});
|
|
10614
10678
|
} catch (error) {
|
|
10615
10679
|
if (error instanceof DreamTokenBudgetExceeded) {
|
|
@@ -10627,7 +10691,11 @@ function createDreamTaskExecutor(deps) {
|
|
|
10627
10691
|
transient,
|
|
10628
10692
|
error: brief,
|
|
10629
10693
|
failureDetail: formatDreamRunFailure(failure),
|
|
10630
|
-
...retrospectiveOverflow ? { schedulePatch: retrospectiveOverflow.schedulePatch } : {
|
|
10694
|
+
...retrospectiveOverflow ? { schedulePatch: retrospectiveOverflow.schedulePatch } : curateCategory && !transient ? {
|
|
10695
|
+
schedulePatch: {
|
|
10696
|
+
taskStateJson: curateTaskStateAfterCategoryTurn(db, projectIdentity, curateCategory)
|
|
10697
|
+
}
|
|
10698
|
+
} : {}
|
|
10631
10699
|
};
|
|
10632
10700
|
} finally {
|
|
10633
10701
|
deps.onProgress?.(null, config.task);
|
|
@@ -11134,6 +11202,8 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11134
11202
|
const scope = beginCurateCategoryRun(db, projectIdentity, loadActiveMemoryPromptMemories(db, projectIdentity));
|
|
11135
11203
|
curateMemories = scope?.memories ?? [];
|
|
11136
11204
|
curateCategory = scope?.category;
|
|
11205
|
+
if (curateCategory)
|
|
11206
|
+
helpers.onCurateCategory(curateCategory);
|
|
11137
11207
|
log2(`[dreamer] curate pool: category=${curateCategory ?? "none"} in_scope=${curateMemories.length} expired_archived=${expiredArchived}`);
|
|
11138
11208
|
if (curateMemories.length === 0) {
|
|
11139
11209
|
const progress = expiredArchived > 0 ? formatExpiredArchiveProgress(expiredArchived) : "curate: no populated project-memory category";
|
|
@@ -11161,15 +11231,11 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11161
11231
|
if (task === "maintain-docs" && hasCurrentDocsProposal(docsDir)) {
|
|
11162
11232
|
const reason = "pending proposal matches current docs";
|
|
11163
11233
|
helpers.recordRun("completed", null, { progress: reason });
|
|
11164
|
-
return {
|
|
11165
|
-
status: "completed",
|
|
11166
|
-
detail: reason,
|
|
11167
|
-
...changes ? { schedulePatch: { taskStateJson: JSON.stringify({ head: changes.head }) } } : {}
|
|
11168
|
-
};
|
|
11234
|
+
return { status: "completed", detail: reason };
|
|
11169
11235
|
}
|
|
11170
11236
|
const curateChunks = curateMemories ? chunkCurateMemories(curateMemories, Math.max(4000, Math.floor(resolveRetrospectiveUsableInputTokens(config, deps) * 2))) : [];
|
|
11171
11237
|
const batches = task === "curate" ? curateChunks : [{ memories: [], crossChunkCandidates: [] }];
|
|
11172
|
-
const
|
|
11238
|
+
const curateOperations = emptyCurateMemoryOperations();
|
|
11173
11239
|
let curateRefused = 0;
|
|
11174
11240
|
let run = {
|
|
11175
11241
|
output: [],
|
|
@@ -11218,14 +11284,7 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11218
11284
|
parseDocsProposalOutput(text);
|
|
11219
11285
|
if (task !== "curate")
|
|
11220
11286
|
return text;
|
|
11221
|
-
|
|
11222
|
-
if (text)
|
|
11223
|
-
validateCurateAssistantText(text);
|
|
11224
|
-
if (memoryOperations.totalCalls > 0 && memoryOperations.completedActions.length === 0)
|
|
11225
|
-
throw new Error("Curate returned no completed ctx_memory tool result.");
|
|
11226
|
-
if (!text && memoryOperations.completedActions.length === 0)
|
|
11227
|
-
throw new Error("Dreamer returned no assistant output.");
|
|
11228
|
-
return { text: text || null, memoryOperations };
|
|
11287
|
+
return validateCurateOutput(completion.messages, text, "hidden");
|
|
11229
11288
|
}
|
|
11230
11289
|
});
|
|
11231
11290
|
childSessionId = hidden.childSessionId;
|
|
@@ -11284,24 +11343,15 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11284
11343
|
parseDocsProposalOutput(text);
|
|
11285
11344
|
return text;
|
|
11286
11345
|
}
|
|
11287
|
-
|
|
11288
|
-
if (text)
|
|
11289
|
-
validateCurateAssistantText(text);
|
|
11290
|
-
if (memoryOperations.completedActions.length > 0) {
|
|
11291
|
-
return { text, memoryOperations };
|
|
11292
|
-
}
|
|
11293
|
-
if (!text)
|
|
11294
|
-
throw new Error("Dreamer returned no assistant output.");
|
|
11295
|
-
if (memoryOperations.totalCalls > 0) {
|
|
11296
|
-
throw new Error("Curate returned no completed ctx_memory tool result.");
|
|
11297
|
-
}
|
|
11298
|
-
return { text, memoryOperations };
|
|
11346
|
+
return validateCurateOutput(messages, text, "child");
|
|
11299
11347
|
}
|
|
11300
11348
|
});
|
|
11301
11349
|
promptSettled = true;
|
|
11302
11350
|
}
|
|
11303
|
-
if (
|
|
11304
|
-
|
|
11351
|
+
if (typeof run.validated !== "string") {
|
|
11352
|
+
curateOperations.totalCalls += run.validated.totalCalls;
|
|
11353
|
+
curateOperations.completedActions.push(...run.validated.completedActions);
|
|
11354
|
+
curateOperations.refusals.push(...run.validated.refusals);
|
|
11305
11355
|
curateRefused += takeCurateSafetyRefusalCount(childSessionId ?? "");
|
|
11306
11356
|
}
|
|
11307
11357
|
if (childSessionId && !deps.hiddenCompletionExecutor) {
|
|
@@ -11317,17 +11367,15 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11317
11367
|
childSessionId = null;
|
|
11318
11368
|
}
|
|
11319
11369
|
}
|
|
11320
|
-
if (task === "curate")
|
|
11321
|
-
run.validated = {
|
|
11322
|
-
text: null,
|
|
11323
|
-
memoryOperations: { totalCalls: completedActions.length, completedActions }
|
|
11324
|
-
};
|
|
11325
11370
|
if (leaseLost)
|
|
11326
11371
|
throw new Error("Dream lease lost during task");
|
|
11327
11372
|
if (curateRefused > 0) {
|
|
11328
11373
|
helpers.reportProgress(curateRefused, curateRefused);
|
|
11329
11374
|
log2(`[dreamer] curate safety summary: refused=${curateRefused}`);
|
|
11330
11375
|
}
|
|
11376
|
+
const unrecognised = unrecognisedCurateOperations(curateOperations);
|
|
11377
|
+
if (unrecognised > 0)
|
|
11378
|
+
log2(`[dreamer] curate result summary: unrecognised=${unrecognised}`);
|
|
11331
11379
|
recordInvocation("completed", run.output);
|
|
11332
11380
|
if (task === "maintain-docs" && docsHashes && changes) {
|
|
11333
11381
|
try {
|
|
@@ -11347,13 +11395,12 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11347
11395
|
return { status: "failed", error: reason };
|
|
11348
11396
|
}
|
|
11349
11397
|
}
|
|
11350
|
-
const curateOutput = task === "curate" ? run.validated : undefined;
|
|
11351
11398
|
const curateScopeProgress = task === "curate" && curateCategory && curateMemories ? `curate: ${curateCategory} (${curateMemories.length})` : null;
|
|
11352
11399
|
const progress = [
|
|
11353
11400
|
curateScopeProgress,
|
|
11354
11401
|
expiredArchived > 0 ? formatExpiredArchiveProgress(expiredArchived) : null,
|
|
11355
|
-
|
|
11356
|
-
curateRefused > 0 ? `curate: refused ${curateRefused} unsafe mutation(s)` : null
|
|
11402
|
+
formatCurateMemoryOperations(curateOperations),
|
|
11403
|
+
curateRefused > 0 && !curateOperations.refusals.length ? `curate: refused ${curateRefused} unsafe mutation(s)` : null
|
|
11357
11404
|
].filter((value) => Boolean(value)).join("; ");
|
|
11358
11405
|
const curateCount = task === "curate" && curateCategory ? loadActiveMemoryPromptMemories(db, projectIdentity).filter((memory) => curateCategoryForMemoryCategory(memory.category) === curateCategory).length : undefined;
|
|
11359
11406
|
const curateBacklog = curateCount !== undefined && curateCategory ? {
|
|
@@ -11372,7 +11419,7 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11372
11419
|
...curateBacklog ? { backlog: curateBacklog } : {},
|
|
11373
11420
|
...curateCategory ? {
|
|
11374
11421
|
schedulePatch: {
|
|
11375
|
-
taskStateJson:
|
|
11422
|
+
taskStateJson: curateTaskStateAfterCategoryTurn(db, projectIdentity, curateCategory)
|
|
11376
11423
|
}
|
|
11377
11424
|
} : {}
|
|
11378
11425
|
};
|
|
@@ -16516,7 +16563,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16516
16563
|
return { count: buildCompartmentCount(db, sessionId, moduleStatus) };
|
|
16517
16564
|
});
|
|
16518
16565
|
const buildManagedCtx = async (db) => {
|
|
16519
|
-
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-
|
|
16566
|
+
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-2z6xxm7e.js"));
|
|
16520
16567
|
const { resolveHistorianModel } = await importPluginModule(() => import("./model-resolution-280gmqvd.js"));
|
|
16521
16568
|
const { userObservationCollectionEnabled, userObservationsRequested } = await importPluginModule(() => import("./task-config-t6bpyka7.js"));
|
|
16522
16569
|
const DEFAULT_HISTORIAN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
@@ -16568,7 +16615,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16568
16615
|
const db = readDatabase();
|
|
16569
16616
|
if (!db)
|
|
16570
16617
|
return { ok: false, error: "db unavailable" };
|
|
16571
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
16618
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-n7h0a0tn.js"));
|
|
16572
16619
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-ykvt5k2s.js"));
|
|
16573
16620
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
16574
16621
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -16653,7 +16700,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16653
16700
|
const db = readDatabase();
|
|
16654
16701
|
if (!db)
|
|
16655
16702
|
return { ok: false, error: "db unavailable" };
|
|
16656
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
16703
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-5k9hgb3t.js"));
|
|
16657
16704
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
16658
16705
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
16659
16706
|
if (!window)
|
|
@@ -30740,4 +30787,4 @@ function applyHiddenSubagentTemperature(input, output, log) {
|
|
|
30740
30787
|
output.temperature = temperature;
|
|
30741
30788
|
}
|
|
30742
30789
|
|
|
30743
|
-
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory, recordOpenCodeProvenInputFloor, resolveOpenCodeProvenInputFloor, resolveContextWindowGeometry, resolveContextLimit, WRAPUP_WINDOW_UNAVAILABLE, resolveOpenCodeWrapupWindow, resolveExecuteThresholdDetail, resolveModelKey, resolveSessionId, parseCacheTtl, createScheduler, computeHardCacheExpired, describeStorageUnavailability, resolveSessionCacheTtl, runEmbedHistoryDrain, pauseEmbedHistoryDrain, formatEmbedStatusText, getSessionProperties, getSessionCreatedInfo, getMessageUpdatedAssistantInfo, getMessageUpdatedInfo, getSessionErrorInfo, getMessageRemovedInfo, summarizeManualDream, createMagicContextCommandHandler, getLiveNotificationParams, createChatMessageHook, createEventHook, createCommandExecuteBeforeHook, createToolExecuteAfterHook, recordHiddenVariantWarning, buildStatusDetail, isDebugRpcEnabled, registerRpcHandlers, maybeAutoEmbedSessionBackfill, clearTransformDecisionSession, scheduleOpenCodeTransformDecisionWrite, stageOpenCodeV2TransformDecision, bindOpenCodeV2TransformDecision, maybeDeliverChannel2, createM0RenderOptions, lkgReplayLimit, measureLkgReplay, STORAGE_BUSY_MESSAGE, StorageBusyRefusalError, bindSystemDateRequestIdentity, bindSystemDateOutput, registerSystemDateRefresh, rustWrapupHistorianFields, isClearlyOverWindow, UnmanagedOverWindowError, UnresolvedHistoryBoundaryError, clearMessageTokensCache, createTransform, createSubcModuleClient, createModuleToolBackends, createRustRefusalRecovery, createSystemPromptHashHandler, tryMessagesTransformLkgReplay, createMessagesTransformHandler, primaryOnlyToolIds, subagentToolRefusal, guardSubagentTools, hideSubagentTools, removePrimaryOnlyTools, storedSubagentMode, createCtxExpandTools, CTX_MEMORY_LIST_TOOL_NAME, CTX_MEMORY_ACTIONS, createCtxMemoryTools, createCtxMemoryListTools, CTX_NOTE_DESCRIPTION, withoutSmartNoteText, createCtxNoteTools, createCtxReduceTools, createCtxSearchTools, parameterDescriptionsFor, applyJsonSchemaParameterDescriptions, MagicContextRpcServer, subagentTemperature, applyHiddenSubagentTemperature };
|
|
30790
|
+
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory, recordOpenCodeProvenInputFloor, resolveOpenCodeProvenInputFloor, resolveContextWindowGeometry, resolveContextLimit, WRAPUP_WINDOW_UNAVAILABLE, resolveOpenCodeWrapupWindow, resolveExecuteThresholdDetail, resolveModelKey, resolveSessionId, parseCacheTtl, createScheduler, computeHardCacheExpired, describeStorageUnavailability, resolveSessionCacheTtl, runEmbedHistoryDrain, pauseEmbedHistoryDrain, formatEmbedStatusText, getSessionProperties, getSessionCreatedInfo, getMessageUpdatedAssistantInfo, getMessageUpdatedInfo, getSessionErrorInfo, getMessageRemovedInfo, summarizeManualDream, createMagicContextCommandHandler, getLiveNotificationParams, createChatMessageHook, createEventHook, createCommandExecuteBeforeHook, createToolExecuteAfterHook, recordHiddenVariantWarning, buildStatusDetail, isDebugRpcEnabled, registerRpcHandlers, maybeAutoEmbedSessionBackfill, clearTransformDecisionSession, scheduleOpenCodeTransformDecisionWrite, stageOpenCodeV2TransformDecision, bindOpenCodeV2TransformDecision, maybeDeliverChannel2, createM0RenderOptions, lkgReplayLimit, measureLkgReplay, moduleRawBlockMappings, STORAGE_BUSY_MESSAGE, StorageBusyRefusalError, bindSystemDateRequestIdentity, bindSystemDateOutput, registerSystemDateRefresh, rustWrapupHistorianFields, isClearlyOverWindow, UnmanagedOverWindowError, UnresolvedHistoryBoundaryError, clearMessageTokensCache, createTransform, createSubcModuleClient, createModuleToolBackends, createRustRefusalRecovery, createSystemPromptHashHandler, tryMessagesTransformLkgReplay, createMessagesTransformHandler, primaryOnlyToolIds, subagentToolRefusal, guardSubagentTools, hideSubagentTools, removePrimaryOnlyTools, storedSubagentMode, createCtxExpandTools, CTX_MEMORY_LIST_TOOL_NAME, CTX_MEMORY_ACTIONS, createCtxMemoryTools, createCtxMemoryListTools, CTX_NOTE_DESCRIPTION, withoutSmartNoteText, createCtxNoteTools, createCtxReduceTools, createCtxSearchTools, parameterDescriptionsFor, applyJsonSchemaParameterDescriptions, MagicContextRpcServer, subagentTemperature, applyHiddenSubagentTemperature };
|
|
@@ -346,15 +346,17 @@ function estimateImageTokensFromHeader(header, bytes, jpegReader) {
|
|
|
346
346
|
function nativeMediaImage(part) {
|
|
347
347
|
if (part.type !== "media" || !isRecord(part.media))
|
|
348
348
|
return;
|
|
349
|
-
const { mediaType, source } = part.media;
|
|
349
|
+
const { mediaType: assetMediaType, source } = part.media;
|
|
350
|
+
const encoded = assetMediaType === undefined;
|
|
351
|
+
const mediaType = encoded && isRecord(source) ? source.mediaType : assetMediaType;
|
|
350
352
|
if (typeof mediaType !== "string" || !mediaType.startsWith("image/"))
|
|
351
353
|
return;
|
|
352
354
|
let inline;
|
|
353
355
|
if (isRecord(source)) {
|
|
354
356
|
const { type, data } = source;
|
|
355
|
-
if (type === "base64" && typeof data === "string" && data.length > 0)
|
|
357
|
+
if ((type === "base64" || encoded && type === "bytes") && typeof data === "string" && data.length > 0)
|
|
356
358
|
inline = data;
|
|
357
|
-
if (type === "bytes" && data instanceof Uint8Array && data.byteLength > 0)
|
|
359
|
+
if (!encoded && type === "bytes" && data instanceof Uint8Array && data.byteLength > 0)
|
|
358
360
|
inline = data;
|
|
359
361
|
}
|
|
360
362
|
return { mediaType, inline };
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
sanitizeFtsQuery,
|
|
55
55
|
searchMemoriesFTS,
|
|
56
56
|
searchMemoriesFTSUnion
|
|
57
|
-
} from "./index-
|
|
57
|
+
} from "./index-9554nr2q.js";
|
|
58
58
|
import {
|
|
59
59
|
ModuleMemoryAuthorityError2,
|
|
60
60
|
getMemoriesByProject2,
|
|
@@ -64,24 +64,24 @@ import {
|
|
|
64
64
|
import {
|
|
65
65
|
matchedSearchSnippet,
|
|
66
66
|
getIndexedMessageCorpusSize
|
|
67
|
-
} from "./index-
|
|
67
|
+
} from "./index-zzvd4a9z.js";
|
|
68
68
|
import {
|
|
69
69
|
getMessageIndexEpoch,
|
|
70
70
|
isMessageIndexSearchable,
|
|
71
71
|
withMemoryHintContent,
|
|
72
72
|
autoSearchRelevance,
|
|
73
73
|
recordAutoSearchLane
|
|
74
|
-
} from "./index-
|
|
74
|
+
} from "./index-m6rkq3t4.js";
|
|
75
75
|
import {
|
|
76
76
|
ensureMemoryEmbeddings2
|
|
77
|
-
} from "./index-
|
|
77
|
+
} from "./index-177yv84k.js";
|
|
78
78
|
import {
|
|
79
79
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
80
80
|
withMessageFtsSessionFilter
|
|
81
81
|
} from "./index-52x68mj4.js";
|
|
82
82
|
import {
|
|
83
83
|
isRecord
|
|
84
|
-
} from "./index-
|
|
84
|
+
} from "./index-y208s7zx.js";
|
|
85
85
|
import {
|
|
86
86
|
resolveWorkspaceShareCategories,
|
|
87
87
|
resolveWorkspaceIdentitySet,
|
|
@@ -2140,17 +2140,19 @@ async function getSemanticScores(args) {
|
|
|
2140
2140
|
if (!args.queryEmbedding || args.memories.length === 0 || !args.queryModelId || args.queryModelId === "off") {
|
|
2141
2141
|
return semanticScores;
|
|
2142
2142
|
}
|
|
2143
|
+
const expectedEmbedding = { modelId: args.queryModelId, generation: args.queryGeneration };
|
|
2143
2144
|
if (!args.workspace?.isWorkspaced) {
|
|
2144
2145
|
const cachedEmbeddings = getProjectEmbeddings2(args.db, args.projectPath, args.queryModelId);
|
|
2145
2146
|
const embeddings = args.backfillMemoryEmbeddings === false ? cachedEmbeddings : await ensureMemoryEmbeddings2({
|
|
2146
2147
|
db: args.db,
|
|
2147
2148
|
projectIdentity: args.projectPath,
|
|
2148
2149
|
memories: args.memories,
|
|
2149
|
-
existingEmbeddings: cachedEmbeddings
|
|
2150
|
+
existingEmbeddings: cachedEmbeddings,
|
|
2151
|
+
expectedEmbedding
|
|
2150
2152
|
});
|
|
2151
2153
|
for (const memory of args.memories) {
|
|
2152
2154
|
const memoryEmbedding = embeddings.get(memory.id);
|
|
2153
|
-
if (!memoryEmbedding) {
|
|
2155
|
+
if (!memoryEmbedding || memoryEmbedding.modelId !== args.queryModelId) {
|
|
2154
2156
|
continue;
|
|
2155
2157
|
}
|
|
2156
2158
|
semanticScores.set(memory.id, normalizeCosineScore(cosineSimilarity(args.queryEmbedding, memoryEmbedding.embedding)));
|
|
@@ -2174,7 +2176,8 @@ async function getSemanticScores(args) {
|
|
|
2174
2176
|
db: args.db,
|
|
2175
2177
|
projectIdentity: args.projectPath,
|
|
2176
2178
|
memories: ownMemories,
|
|
2177
|
-
existingEmbeddings: ownEmbeddings
|
|
2179
|
+
existingEmbeddings: ownEmbeddings,
|
|
2180
|
+
expectedEmbedding
|
|
2178
2181
|
});
|
|
2179
2182
|
}
|
|
2180
2183
|
for (const identity of workspace.identities) {
|
|
@@ -2302,6 +2305,7 @@ async function searchMemories(args) {
|
|
|
2302
2305
|
backfillMemoryEmbeddings: args.backfillMemoryEmbeddings,
|
|
2303
2306
|
queryEmbedding: args.queryEmbedding,
|
|
2304
2307
|
queryModelId: args.queryModelId,
|
|
2308
|
+
queryGeneration: args.queryGeneration,
|
|
2305
2309
|
workspace: args.workspace
|
|
2306
2310
|
});
|
|
2307
2311
|
const sourceNameByMemoryId = sourceNamesForSearchMemories({
|
|
@@ -3204,6 +3208,7 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
|
|
|
3204
3208
|
memoryEnabled: true,
|
|
3205
3209
|
queryEmbedding,
|
|
3206
3210
|
queryModelId: embeddingModelId && embeddingModelId !== "off" ? embeddingModelId : null,
|
|
3211
|
+
queryGeneration: queryContract?.generation ?? embeddingSnapshot?.generation,
|
|
3207
3212
|
workspace,
|
|
3208
3213
|
visibleMemoryIds: options.visibleMemoryIds,
|
|
3209
3214
|
backfillMemoryEmbeddings: options.backfillMemoryEmbeddings,
|