deeper-cli 1.3.2 → 1.3.3

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/cli/index.js CHANGED
@@ -12838,7 +12838,10 @@ async function loadNamedSession(history, name) {
12838
12838
  }
12839
12839
  const data = JSON.parse(readFileSync37(file, "utf-8"));
12840
12840
  history.push({ role: "system", content: `[\u5DF2\u52A0\u8F7D: ${name} (${data.messages?.length || 0} \u6761)]` });
12841
- if (data.messages) for (const m of data.messages) history.push(m);
12841
+ if (data.messages) for (const m of data.messages) {
12842
+ if (m.role === "tool" && !m.name) m.name = "tool";
12843
+ history.push(m);
12844
+ }
12842
12845
  trimHistory(history, MAX_HISTORY);
12843
12846
  O(g(`\u5DF2\u52A0\u8F7D: ${name}`) + "\n\n");
12844
12847
  }
@@ -12856,7 +12859,10 @@ async function loadLatestSession(history) {
12856
12859
  const data = JSON.parse(readFileSync37(file, "utf-8"));
12857
12860
  const label = files[0].replace(/^sess_|\.json$/g, "");
12858
12861
  history.push({ role: "system", content: `[\u5DF2\u52A0\u8F7D: ${label} (${data.messages?.length || 0} \u6761)]` });
12859
- if (data.messages) for (const m of data.messages) history.push(m);
12862
+ if (data.messages) for (const m of data.messages) {
12863
+ if (m.role === "tool" && !m.name) m.name = "tool";
12864
+ history.push(m);
12865
+ }
12860
12866
  trimHistory(history, MAX_HISTORY);
12861
12867
  O(g(`\u5DF2\u52A0\u8F7D: ${label}`) + "\n\n");
12862
12868
  }