fix(ai): 修复 Orchestrator 模式多轮对话的 5 个关联 bug#250
Merged
Conversation
- 问题1: executeWithOrchestrator 添加 block 创建逻辑 - 问题2: 通过 OrchestratorContext 从 context 提取 userID - 问题3: 添加 isRelatedToLastIntent 放宽粘性路由条件 - 问题4: 随问题1修复自动解决 - 问题5: executeWithOrchestrator 构建 history 并注入 context 采用面向未来的架构:通过 context 隐式传递参数,未来扩展无需修改接口签名。 Resolves #249 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 合并重复的 extractIntent 函数到 agent 包 - GetHistory 返回空切片而非 nil - 移除 intentKeywords 重复项 - strings.Index 替换为 strings.Cut Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DRY 违规修复: - 合并 parseInabilityReport 到 agent.ParseInabilityReport 动态关键词加载: - 在 ExpertRegistry 接口添加 GetIntentKeywords 方法 - ChatRouterWithMetadata 支持 IntentKeywordProvider 依赖注入 - 从专家配置动态加载关键词,fallback 到硬编码 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- memo.yaml: 添加 sticky routing 关键词(总结、详细内容、相关等) - schedule.yaml: 添加 sticky routing 关键词(修改、取消、时间等) - chat_router.go: 更新 intentKeywords fallback 与配置文件保持一致 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
修复 Orchestrator 模式多轮对话的 5 个关联 bug:
executeWithOrchestrator添加 block 创建逻辑OrchestratorContext从 context 提取 userIDisRelatedToLastIntent放宽粘性路由条件executeWithOrchestrator构建 history 并注入 context架构亮点
采用面向未来的设计:通过
OrchestratorContext在 Go context 中传递参数,未来扩展无需修改接口签名。新增文件
ai/context/orchestrator.go- OrchestratorContext 定义和 helper 函数Resolves #249
Test plan
🤖 Generated with [://claude.com/claude-code)Claude Code](https