4 Commits

Author SHA1 Message Date
kuaifan
773eead827 feat(ai): AI 任务建议支持多语言输出
- 新增 getUserLanguageInfo 方法获取用户语言偏好
- 新增 getLocalizedTitles 方法,支持 9 种语言的标题和提示文案
- 调整 AI Prompt,根据用户语言输出对应语言的建议内容
- 相似任务检测阈值从 0.7 调整为 0.5
- 完善方法注释文档

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 05:32:20 +00:00
kuaifan
29be29b9cf feat(ai): 优化 AI 提示词并完善建议交互功能
- 优化后端提示词:描述生成、子任务拆分、负责人推荐,新增栏目信息,去掉无效的 similar_count
- 优化前端提示词:去掉硬性字数限制,即时消息改为简短输出
- 新增 :::ai-action{...}::: 语法处理,支持单独采纳/忽略 assignee 和 similar
- 采纳/忽略后更新消息状态显示
- 负责人改为追加模式,保留现有负责人
- 新增任务关联功能,similar 采纳时自动创建双向关联
- 相似度阈值从 0.7 调整为 0.5,搜索结果增加到 200

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-21 15:30:07 +00:00
kuaifan
75073d4320 fix(ai): address security and robustness issues from code review
Security fixes:
- Add escapeUserInput() to prevent Prompt injection via user input
- Validate msgId belongs to dialogId in updateMessageStatus()
- Add type parameter whitelist validation in ai-apply/ai-dismiss
- Add event record validation in task__ai_dismiss

Robustness fixes:
- Use atomic update for markProcessing to prevent concurrent processing
- Add subtask count limit check before creation (max 50)
- Disable similar task feature until vector search is implemented
- Fix Promise anti-pattern in frontend actions

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-21 15:30:06 +00:00
kuaifan
eef4c6fbe5 feat(ai): add AiTaskAnalyzeTask async task 2026-01-21 15:30:06 +00:00