mindkeeper-openclaw 0.2.30 → 0.2.31
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/index.js +24 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -851,16 +851,35 @@ var Tracker = class {
|
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
853
|
let message = null;
|
|
854
|
+
let usedLlm = false;
|
|
855
|
+
let templateReason = null;
|
|
854
856
|
if (this.config.commitMessage.mode === "llm" && diffs.length > 0) {
|
|
855
|
-
|
|
857
|
+
if (this.llmProvider) {
|
|
858
|
+
message = await generateLlmMessage(diffs, this.llmProvider, this.log);
|
|
859
|
+
if (message) usedLlm = true;
|
|
860
|
+
else templateReason = "LLM API call failed (check logs above for error)";
|
|
861
|
+
} else {
|
|
862
|
+
templateReason = "LLM provider not configured (no default model or API key in OpenClaw)";
|
|
863
|
+
}
|
|
864
|
+
} else if (this.config.commitMessage.mode === "llm" && diffs.length === 0) {
|
|
865
|
+
templateReason = "first commit or no diff (no previous version to compare, diffs.length=0)";
|
|
866
|
+
} else {
|
|
867
|
+
templateReason = "config: commitMessage.mode is 'template'";
|
|
856
868
|
}
|
|
857
869
|
if (!message) {
|
|
858
|
-
if (this.config.commitMessage.mode === "llm" && this.log?.warn) {
|
|
859
|
-
const reason = diffs.length === 0 ? "No diff available (first commit or no file changes), using template" : "LLM failed, falling back to template";
|
|
860
|
-
this.log.warn(`[mindkeeper] ${reason}`);
|
|
861
|
-
}
|
|
862
870
|
message = generateTemplateMessage(filesToCommit);
|
|
863
871
|
}
|
|
872
|
+
if (this.log) {
|
|
873
|
+
if (usedLlm) {
|
|
874
|
+
this.log.info?.(
|
|
875
|
+
`[mindkeeper] Commit message: LLM-generated \u2014 "${message.slice(0, 50)}${message.length > 50 ? "\u2026" : ""}"`
|
|
876
|
+
);
|
|
877
|
+
} else {
|
|
878
|
+
this.log.warn?.(
|
|
879
|
+
`[mindkeeper] Commit message: template \u2014 reason: ${templateReason}`
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
864
883
|
const oid = await this.store.commit(message);
|
|
865
884
|
return {
|
|
866
885
|
oid,
|