@yeaft/webchat-agent 0.1.333 → 0.1.334

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.
@@ -124,6 +124,13 @@ export async function processRoleOutput(session, roleName, roleQuery, roleState)
124
124
 
125
125
  // 解析路由
126
126
  const routes = parseRoutes(roleState.accumulatedText);
127
+ // Fallback: 如果 route summary 仍为空占位符,用 accumulatedText 末尾 500 字符
128
+ for (const route of routes) {
129
+ if (route.summary === '[该角色未提供消息摘要]' && roleState.accumulatedText) {
130
+ const tail = roleState.accumulatedText.slice(-500).trim();
131
+ if (tail) route.summary = `[auto-extracted]\n${tail}`;
132
+ }
133
+ }
127
134
 
128
135
  // 决策者 turn 完成:检测 TASKS block 中新完成的任务
129
136
  const roleConfig = session.roles.get(roleName);
@@ -244,7 +244,7 @@ ${m.routingIntro}
244
244
  \`\`\`
245
245
  ---ROUTE---
246
246
  to: <roleName>
247
- summary: <brief description>
247
+ summary: <必须填写具体内容:你完成了什么、需要对方做什么。禁止留空!>
248
248
  ---END_ROUTE---
249
249
  \`\`\`
250
250
 
package/crew/routing.js CHANGED
@@ -39,9 +39,14 @@ export function parseRoutes(text) {
39
39
  const taskMatch = block.match(/^task:\s*(.+)/im);
40
40
  const taskTitleMatch = block.match(/^taskTitle:\s*(.+)/im);
41
41
 
42
+ let summary = summaryMatch ? summaryMatch[1].trim() : '';
43
+ if (!summary) {
44
+ summary = '[该角色未提供消息摘要]';
45
+ }
46
+
42
47
  routes.push({
43
48
  to: toClean,
44
- summary: summaryMatch ? summaryMatch[1].trim() : '',
49
+ summary,
45
50
  taskId: taskMatch ? taskMatch[1].trim() : null,
46
51
  taskTitle: taskTitleMatch ? taskTitleMatch[1].trim() : null
47
52
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.333",
3
+ "version": "0.1.334",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",