Skip to content

fix: 修复 display_name 未定义导致 LLM 默认角色仅生效一次#297

Open
Anionex wants to merge 1 commit intoHaujetZhao:masterfrom
Anionex:fix/display-name-undefined
Open

fix: 修复 display_name 未定义导致 LLM 默认角色仅生效一次#297
Anionex wants to merge 1 commit intoHaujetZhao:masterfrom
Anionex:fix/display-name-undefined

Conversation

@Anionex
Copy link

@Anionex Anionex commented Feb 14, 2026

Summary

  • LLMHandler.process_and_output 返回 LLMResult 时引用了未定义的 display_name 变量,导致 NameError
  • 默认角色首次调用后异常冒泡终止 WebSocket 消息循环,后续识别结果不再被处理
  • display_name 替换为 role_config.name or RoleConfig.DEFAULT_ROLE_NAME,与同文件 process() 方法保持一致

Test

  • 配置 LLM/default.pyprocess = True,连续多次语音识别,确认每次都经过 LLM 润色

LLMHandler.process_and_output 返回 LLMResult 时引用了未定义的
display_name,导致默认角色首次调用后抛出 NameError,WebSocket
消息循环终止,后续识别结果不再被处理。

将 display_name 替换为 role_config.name or RoleConfig.DEFAULT_ROLE_NAME,
与同类方法 process() 保持一致。
@Anionex Anionex changed the title fix: 修复 display_name 未定义导致 LLM 默认角色仅生效一次 fix: 修复 LLM 默认角色仅首次生效的两个 bug Feb 14, 2026
@Anionex Anionex force-pushed the fix/display-name-undefined branch from 78baab1 to 3493fd0 Compare February 16, 2026 16:54
@Anionex Anionex changed the title fix: 修复 LLM 默认角色仅首次生效的两个 bug fix: 修复 display_name 未定义导致 LLM 默认角色仅生效一次 Feb 16, 2026
@Anionex Anionex force-pushed the fix/display-name-undefined branch 3 times, most recently from 5c3a56b to 3493fd0 Compare February 16, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant