@mingxy/cerebro 1.18.14 → 1.18.15
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 -2
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.15",
|
|
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,8 @@ export function autoRecallHook(client: CerebroClient, containerTags: string[], t
|
|
|
478
478
|
};
|
|
479
479
|
|
|
480
480
|
if (!shouldRecallRes.should_recall) {
|
|
481
|
-
|
|
482
|
-
if (
|
|
481
|
+
// 兜底:即使不召回记忆,只要有 profile 就注入(与 recall 路径对齐)
|
|
482
|
+
if (profileBlock) {
|
|
483
483
|
appendToSystem(output.system, profileBlock);
|
|
484
484
|
logDebug("autoRecallHook profile injected (no-recall path)", { sessionId: input.sessionID, outputSystemLength: output.system.length });
|
|
485
485
|
|