fix(identity): 重构 agent 命名检测正则 — 覆盖"名称改为小芳"等表达
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
detectAgentNameSuggestion 从固定正则改为 trigger+extract 两步法, 10 个 trigger 模式覆盖中文/英文常见命名表达,stopWords 过滤误匹配。 同时修复 streamStore content 类型处理和 RightPanel 重复事件监听。
This commit is contained in:
@@ -386,8 +386,9 @@ function createCompleteHandler(
|
||||
log.warn('Failed to persist detected userName:', e);
|
||||
}
|
||||
}
|
||||
// Detect agent name change (e.g. "叫你小马", "以后叫你小马")
|
||||
const detectedAgentName = lastUserMsg ? detectAgentNameSuggestion(lastUserMsg.content) : undefined;
|
||||
// Detect agent name change (e.g. "叫你小马", "以后叫你小马", "你就叫小马吧")
|
||||
const lastContent = typeof lastUserMsg?.content === 'string' ? lastUserMsg.content : '';
|
||||
const detectedAgentName = lastContent ? detectAgentNameSuggestion(lastContent) : undefined;
|
||||
if (detectedAgentName && agentId) {
|
||||
try {
|
||||
const { useAgentStore } = await import('../agentStore');
|
||||
|
||||
Reference in New Issue
Block a user