foliko 2.0.24 → 2.0.26
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 +1 -1
- package/plugins/core/ai/index.js +1 -1
- package/plugins/messaging/feishu/index.js +1 -1
- package/plugins/messaging/qq/index.js +5 -5
- package/plugins/messaging/telegram/index.js +2 -2
- package/plugins/messaging/weixin/index.js +1 -1
- package/src/agent/chat.js +3 -3
- package/src/agent/sub.js +1 -1
- package/src/agent/tool-loop.js +1 -1
- package/src/common/constants.js +1 -1
package/package.json
CHANGED
package/plugins/core/ai/index.js
CHANGED
|
@@ -22,7 +22,7 @@ class AIPlugin extends Plugin {
|
|
|
22
22
|
model: config.model || 'deepseek-chat',
|
|
23
23
|
apiKey: config.apiKey,
|
|
24
24
|
baseURL: config.baseURL,
|
|
25
|
-
maxSteps: config.maxSteps ||
|
|
25
|
+
maxSteps: config.maxSteps || 1000,
|
|
26
26
|
maxOutputTokens: config.maxOutputTokens || parseInt(process.env.MAX_OUTPUT_TOKENS) || 8192,
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -430,7 +430,7 @@ class FeishuPlugin extends Plugin {
|
|
|
430
430
|
}
|
|
431
431
|
} catch (err) {
|
|
432
432
|
log.error(' Chat error:', err)
|
|
433
|
-
await this._sendMessage(openId, `发生错误:${err.message}`, originalMsg)
|
|
433
|
+
//await this._sendMessage(openId, `发生错误:${err.message}`, originalMsg)
|
|
434
434
|
} finally {
|
|
435
435
|
this._pendingResponses.delete(openId)
|
|
436
436
|
}
|
|
@@ -654,11 +654,11 @@ class QQPlugin extends Plugin {
|
|
|
654
654
|
await agent.sendMessage(messageWithContext, { sessionId, priority: 1 })
|
|
655
655
|
} catch (err) {
|
|
656
656
|
log.error('Chat error:', err.message)
|
|
657
|
-
if (msgType === 'group') {
|
|
658
|
-
|
|
659
|
-
} else {
|
|
660
|
-
|
|
661
|
-
}
|
|
657
|
+
// if (msgType === 'group') {
|
|
658
|
+
// await this._sendGroupMessage(identifier, `发生错误:${err.message}`)
|
|
659
|
+
// } else {
|
|
660
|
+
// await this._sendMessage(identifier, `发生错误:${err.message}`)
|
|
661
|
+
// }
|
|
662
662
|
} finally {
|
|
663
663
|
}
|
|
664
664
|
}
|
|
@@ -415,8 +415,8 @@ class TelegramPlugin extends Plugin {
|
|
|
415
415
|
parse_mode: 'MarkdownV2'
|
|
416
416
|
})
|
|
417
417
|
} catch (err) {
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
log.error(' Chat error:', err)
|
|
419
|
+
//await this._bot.editMessageText(escapeMarkdown(`❌ 发生错误:${err.message}`), {
|
|
420
420
|
chat_id: chatId,
|
|
421
421
|
message_id: thinkingMsg.message_id
|
|
422
422
|
})
|
|
@@ -631,7 +631,7 @@ class WeixinPlugin extends Plugin {
|
|
|
631
631
|
await agent.sendMessage(text, { sessionId, priority: 1 })
|
|
632
632
|
} catch (err) {
|
|
633
633
|
log.error(' Chat error:', err.message)
|
|
634
|
-
await this._sendMessageBatch(originalMsg, userId, `发生错误:${err.message}`, true)
|
|
634
|
+
//await this._sendMessageBatch(originalMsg, userId, `发生错误:${err.message}`, true)
|
|
635
635
|
} finally {
|
|
636
636
|
this.stopTypingInterval()
|
|
637
637
|
}
|
package/src/agent/chat.js
CHANGED
|
@@ -74,7 +74,7 @@ class AgentChatHandler extends EventEmitter {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
this._systemPrompt = config.systemPrompt || 'You are a helpful assistant.';
|
|
77
|
-
this._maxSteps = config.maxSteps ||
|
|
77
|
+
this._maxSteps = config.maxSteps || 1000;
|
|
78
78
|
|
|
79
79
|
// 委托给新模块
|
|
80
80
|
// ChatSession: 会话、消息、队列
|
|
@@ -737,7 +737,7 @@ class AgentChatHandler extends EventEmitter {
|
|
|
737
737
|
const tools = this._getToolMap();
|
|
738
738
|
const toolLoop = new ToolLoop({
|
|
739
739
|
tools,
|
|
740
|
-
maxSteps: this._maxSteps ||
|
|
740
|
+
maxSteps: this._maxSteps || 1000,
|
|
741
741
|
prepareStep: this._createPrepareStep(),
|
|
742
742
|
repairToolCall: this._repairToolCall.bind(this),
|
|
743
743
|
abortSignal: framework.getAbortSignal?.(),
|
|
@@ -912,7 +912,7 @@ class AgentChatHandler extends EventEmitter {
|
|
|
912
912
|
|
|
913
913
|
const toolLoop = new ToolLoop({
|
|
914
914
|
tools,
|
|
915
|
-
maxSteps: this._maxSteps ||
|
|
915
|
+
maxSteps: this._maxSteps || 1000,
|
|
916
916
|
prepareStep: this._createPrepareStep(),
|
|
917
917
|
repairToolCall: this._repairToolCall.bind(this),
|
|
918
918
|
abortSignal: framework.getAbortSignal?.(),
|
package/src/agent/sub.js
CHANGED
|
@@ -131,7 +131,7 @@ class SubAgent extends BaseAgent {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
async chat(taskOrMessages, options = {}) {
|
|
134
|
-
const maxSteps = options?.maxSteps ||
|
|
134
|
+
const maxSteps = options?.maxSteps || 1000;
|
|
135
135
|
const maxRetries = options?.maxRetries ?? this.maxRetries;
|
|
136
136
|
const retryDelay = options?.retryDelay ?? this.retryDelay;
|
|
137
137
|
const client = this._getOpenAIClient();
|
package/src/agent/tool-loop.js
CHANGED
|
@@ -19,7 +19,7 @@ class ToolLoop extends EventEmitter {
|
|
|
19
19
|
constructor(config = {}) {
|
|
20
20
|
super();
|
|
21
21
|
this.tools = config.tools || {}; // { name => { execute, description } }
|
|
22
|
-
this.maxSteps = config.maxSteps ||
|
|
22
|
+
this.maxSteps = config.maxSteps || 1000;
|
|
23
23
|
this.prepareStep = config.prepareStep || (async () => {});
|
|
24
24
|
this.abortSignal = config.abortSignal || null;
|
|
25
25
|
this._repairFn = config.repairToolCall || null;
|
package/src/common/constants.js
CHANGED