fix: 系统提示词卡片包含 SOUL.md 内容
state.set('_lastSystemPrompt') 改为从 messages 中拼接所有 system 消息,
确保 SOUL.md 也出现在 AI 回复顶部的折叠卡片中。
This commit is contained in:
@@ -493,8 +493,12 @@ export async function runAgentLoop(
|
||||
|
||||
messages.push({ role: 'system', content: fullSystemPrompt });
|
||||
|
||||
// 将完整系统提示词存入 state,供 input-area 在助理消息上展示
|
||||
state.set('_lastSystemPrompt', fullSystemPrompt);
|
||||
// 将完整系统提示词存入 state(包含 SOUL.md + fullSystemPrompt)
|
||||
const allSystemContent = messages
|
||||
.filter(m => m.role === 'system')
|
||||
.map(m => m.content)
|
||||
.join('\n\n');
|
||||
state.set('_lastSystemPrompt', allSystemContent || fullSystemPrompt);
|
||||
|
||||
// 添加历史消息
|
||||
for (const msg of historyMessages) {
|
||||
|
||||
Reference in New Issue
Block a user