Fix: Null safety in flattenMessagesToBlocks regex match
This commit is contained in:
@@ -1647,7 +1647,8 @@ const flattenMessagesToBlocks = (messages) => {
|
|||||||
blockCount++;
|
blockCount++;
|
||||||
} else if (part.match(/^\[AGENT:/)) {
|
} else if (part.match(/^\[AGENT:/)) {
|
||||||
// AGENT TAG BLOCK (New)
|
// AGENT TAG BLOCK (New)
|
||||||
const agentName = part.match(/\[AGENT:\s*([^\]]+)\]/)[1];
|
const agentMatch = part.match(/\[AGENT:\s*([^\]]+)\]/);
|
||||||
|
const agentName = agentMatch ? agentMatch[1] : 'Unknown';
|
||||||
blocks.push({
|
blocks.push({
|
||||||
role: 'assistant',
|
role: 'assistant',
|
||||||
type: 'agent_tag',
|
type: 'agent_tag',
|
||||||
|
|||||||
Reference in New Issue
Block a user