myagent-ai 1.15.1 → 1.15.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.15.1",
3
+ "version": "1.15.2",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
@@ -1854,8 +1854,10 @@ async function selectSession(id) {
1854
1854
  return m && (m.role === 'user' || m.role === 'assistant' || m.role === 'tool');
1855
1855
  }).map(function(m) {
1856
1856
  var content = (m.content != null) ? String(m.content) : '';
1857
- // Strip XML tags from assistant messages (backend may store raw LLM XML output)
1858
- if (m.role === 'assistant' && content && content.trim().startsWith('<')) {
1857
+ // Strip XML tags from assistant messages that are raw LLM output (key is empty or llm_output)
1858
+ // Do NOT strip tool_call messages — their content has a specific format (beforecalltext\n调用工具:...)
1859
+ var mkey = (m.key || '').toLowerCase();
1860
+ if (m.role === 'assistant' && mkey !== 'tool_call' && content && content.trim().startsWith('<')) {
1859
1861
  content = (typeof _stripXmlTags === 'function') ? _stripXmlTags(content) : content;
1860
1862
  }
1861
1863
  return {
@@ -1923,8 +1925,8 @@ async function loadMoreMessages() {
1923
1925
  return m && (m.role === 'user' || m.role === 'assistant' || m.role === 'tool');
1924
1926
  }).map(function(m) {
1925
1927
  var content = (m.content != null) ? String(m.content) : '';
1926
- // Strip XML tags from assistant messages (backend may store raw LLM XML output)
1927
- if (m.role === 'assistant' && content && content.trim().startsWith('<')) {
1928
+ var mkey = (m.key || '').toLowerCase();
1929
+ if (m.role === 'assistant' && mkey !== 'tool_call' && content && content.trim().startsWith('<')) {
1928
1930
  content = (typeof _stripXmlTags === 'function') ? _stripXmlTags(content) : content;
1929
1931
  }
1930
1932
  return {
@@ -1937,8 +1939,8 @@ async function loadMoreMessages() {
1937
1939
 
1938
1940
  // Group consecutive non-user messages for the loaded batch
1939
1941
  const grouped = groupHistoryMessages(loaded);
1940
- // 追加到现有消息前面(保持滚动位置)
1941
- state.messages = grouped.concat(state.messages);
1942
+ // Prepend to existing messages, then RE-GROUP the boundary to merge split groups
1943
+ state.messages = groupHistoryMessages(grouped.concat(state.messages));
1942
1944
  state._msgLoadOffset += loaded.length;
1943
1945
  state._msgLoadTotal = state.messages.length;
1944
1946