@myassis/gateway 1.0.61 → 1.0.62

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.
@@ -528,6 +528,9 @@ class LLMClient {
528
528
  if (d.finish_reason === 'length' && !d.content) {
529
529
  throw Error('exceed max message tokens');
530
530
  }
531
+ if (d.finish_reason === 'stop' && !d.content) {
532
+ throw Error('model return empty content');
533
+ }
531
534
  const toolCalls = d.toolCalls?.map((tc) => ({
532
535
  id: tc.id || '',
533
536
  toolName: tc.function?.name || '',
@@ -546,6 +549,9 @@ class LLMClient {
546
549
  if (messageData.finish_reason === 'length' && !messageData.content) {
547
550
  throw Error('exceed max message tokens');
548
551
  }
552
+ if (messageData.finish_reason === 'stop' && !messageData.content) {
553
+ throw Error('model return empty content');
554
+ }
549
555
  return {
550
556
  content: messageData.content || '',
551
557
  reasoningContent: messageData.reasoning_content || undefined,
@@ -82,17 +82,17 @@ class SessionStore {
82
82
  // ========== Session Operations ==========
83
83
  insertSession(session) {
84
84
  this.db.prepare(`
85
- INSERT INTO sessions (id, user_id, agent_id, title, select_model_id, voice_state, created_at, updated_at,last_message_summary,last_message_summary_at,unread_count,is_current,message_queue,message_queue_auto_execute)
86
- VALUES (?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?)
87
- `).run(session.id, session.userId, session.agentId || null, session.title, session.selectModelId || '', JSON.stringify(session.voiceState), session.createdAt, session.updatedAt, session.lastMessageSummary, session.lastMessageSummaryAt, session.unreadCount || 0, session.isCurrent ? 1 : 0, JSON.stringify(session.messageQueue || []), session.messageQueueAutoExecute === false ? 0 : 1);
85
+ INSERT INTO sessions (id, user_id, agent_id, title, select_model_id, voice_state, created_at, updated_at,last_message_summary,last_message_summary_at,unread_count,is_current,message_queue,message_queue_auto_execute, use_system_mode)
86
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?,?)
87
+ `).run(session.id, session.userId, session.agentId || null, session.title, session.selectModelId || '', JSON.stringify(session.voiceState), session.createdAt, session.updatedAt, session.lastMessageSummary, session.lastMessageSummaryAt, session.unreadCount || 0, session.isCurrent ? 1 : 0, JSON.stringify(session.messageQueue || []), session.messageQueueAutoExecute === false ? 0 : 1, session.useSystemMode ? 1 : 0);
88
88
  }
89
89
  updateSession(session) {
90
90
  this.db.prepare(`
91
91
  UPDATE sessions
92
92
  SET user_id = ?, agent_id = ?, title = ?, select_model_id = ?,
93
- voice_state = ?, updated_at = ?,last_message_summary=?,last_message_summary_at=?,unread_count=?,is_current=?,message_queue=?,message_queue_auto_execute=?
93
+ voice_state = ?, updated_at = ?,last_message_summary=?,last_message_summary_at=?,unread_count=?,is_current=?,message_queue=?,message_queue_auto_execute=?, use_system_mode=?
94
94
  WHERE id = ?
95
- `).run(session.userId, session.agentId || null, session.title, session.selectModelId || '', JSON.stringify(session.voiceState), session.updatedAt, session.lastMessageSummary, session.lastMessageSummaryAt, session.unreadCount || 0, session.isCurrent ? 1 : 0, JSON.stringify(session.messageQueue || []), session.messageQueueAutoExecute === false ? 0 : 1, session.id);
95
+ `).run(session.userId, session.agentId || null, session.title, session.selectModelId || '', JSON.stringify(session.voiceState), session.updatedAt, session.lastMessageSummary, session.lastMessageSummaryAt, session.unreadCount || 0, session.isCurrent ? 1 : 0, JSON.stringify(session.messageQueue || []), session.messageQueueAutoExecute === false ? 0 : 1, session.useSystemMode ? 1 : 0, session.id);
96
96
  }
97
97
  // 支持部分更新的 updateSession
98
98
  updateSessionPartial(id, data) {
@@ -187,6 +187,7 @@ class SessionStore {
187
187
  agentId: row.agent_id || undefined,
188
188
  title: row.title,
189
189
  selectModelId: row.select_model_id || undefined,
190
+ useSystemMode: row.use_system_mode !== 0,
190
191
  voiceState: JSON.parse(row.voice_state),
191
192
  createdAt: row.created_at,
192
193
  updatedAt: row.updated_at,
@@ -0,0 +1 @@
1
+ ALTER TABLE sessions ADD COLUMN use_system_mode INTEGER DEFAULT 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myassis/gateway",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "我的助手 Gateway Service - 本地 AI 网关服务,支持认证、WebSocket 实时通信和任务调度",
5
5
  "main": "dist/index.js",
6
6
  "bin": {