@mingxy/cerebro 1.18.14 → 1.18.16
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/package.json +2 -2
- package/src/client.ts +10 -1
- package/src/hooks.ts +2 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mingxy/cerebro",
|
|
3
|
-
"version": "1.18.
|
|
4
|
-
"description": "Cerebro persistent memory plugin for OpenCode
|
|
3
|
+
"version": "1.18.16",
|
|
4
|
+
"description": "Cerebro persistent memory plugin for OpenCode — auto-recall, auto-capture, 9 memory tools with clustering, project-scoped memory isolation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"exports": {
|
package/src/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logWarn, logError } from "./logger.js";
|
|
1
|
+
import { logInfo, logWarn, logError } from "./logger.js";
|
|
2
2
|
import type { OmemPluginConfig } from "./config.js";
|
|
3
3
|
|
|
4
4
|
function sanitizeContent(text: string, maxLen: number): string {
|
|
@@ -391,6 +391,15 @@ export class CerebroClient {
|
|
|
391
391
|
...recall_overrides,
|
|
392
392
|
project_path: projectPath,
|
|
393
393
|
}, 20_000);
|
|
394
|
+
logInfo("shouldRecall raw response", {
|
|
395
|
+
should_recall: res?.should_recall,
|
|
396
|
+
memCount: res?.memories?.length ?? 0,
|
|
397
|
+
discardedCount: res?.discarded?.length ?? 0,
|
|
398
|
+
confidence: res?.confidence,
|
|
399
|
+
reason: res?.reason,
|
|
400
|
+
rawKeys: res ? Object.keys(res) : "null",
|
|
401
|
+
rawJSON: JSON.stringify(res).slice(0, 500),
|
|
402
|
+
});
|
|
394
403
|
return res;
|
|
395
404
|
}
|
|
396
405
|
|
package/src/hooks.ts
CHANGED
|
@@ -478,8 +478,7 @@ export function autoRecallHook(client: CerebroClient, containerTags: string[], t
|
|
|
478
478
|
};
|
|
479
479
|
|
|
480
480
|
if (!shouldRecallRes.should_recall) {
|
|
481
|
-
|
|
482
|
-
if (didInjectProfile) {
|
|
481
|
+
if (profileTtlExpired && profileBlock) {
|
|
483
482
|
appendToSystem(output.system, profileBlock);
|
|
484
483
|
logDebug("autoRecallHook profile injected (no-recall path)", { sessionId: input.sessionID, outputSystemLength: output.system.length });
|
|
485
484
|
|
|
@@ -523,7 +522,7 @@ export function autoRecallHook(client: CerebroClient, containerTags: string[], t
|
|
|
523
522
|
logDebug("autoRecallHook block was EMPTY — no injection", { sessionId: input.sessionID });
|
|
524
523
|
}
|
|
525
524
|
|
|
526
|
-
if (profileBlock) {
|
|
525
|
+
if (profileTtlExpired && profileBlock) {
|
|
527
526
|
appendToSystem(output.system, profileBlock);
|
|
528
527
|
logDebug("autoRecallHook profile injected after context", { sessionId: input.sessionID, outputSystemLength: output.system.length });
|
|
529
528
|
}
|