fix: IoT快速通道补充关掉/关上 + 多设备上下文窗口扩展至30字节

- intent_analyzer: isStrongIoTCommand controlWords新增"关掉""关上"
- iot_provider: 操作检测上下文窗口±15→±30字节,新增全文回退逻辑
- 修复多设备命令中远处关键词无法匹配导致操作误判为query

E2E: "关掉"快速通道2.57s 多设备同时开关 8设备查询

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 23:01:45 +08:00
parent a67b95cbc4
commit 498bf0d4fa
3 changed files with 104 additions and 6 deletions
@@ -130,7 +130,7 @@ func (a *IntentAnalyzer) isStrongIoTCommand(userMessage string) bool {
msgLower := strings.TrimSpace(strings.ToLower(userMessage))
// 控制类关键词 + 设备类关键词组合出现,即可判断为 IoT 命令
controlWords := []string{"打开", "关闭", "调到", "设置", "开关", "调节", "调高", "调低", "开一下", "关一下"}
controlWords := []string{"打开", "关闭", "关掉", "关上", "调到", "设置", "开关", "调节", "调高", "调低", "开一下", "关一下"}
deviceWords := []string{"灯", "空调", "窗帘", "电视", "风扇", "加湿器", "插座", "门锁", "传感器"}
hasControl := false