Feature/model - #43
Merged
Merged
Conversation
- internal/agent: execute.go / runner_adapter.go / types.go 缩进与字段对齐 - internal/rag: eino_adapter.go / hybrid_retriever.go 对齐 - internal/service: chat_interface.go DTO 字段对齐
- chat_service.go 大幅瘦身,只保留会话/消息/上下文初始化核心流程 - 新增 chat_budget.go: 上下文预算计算 - 新增 chat_helpers.go: 共享辅助函数 - 新增 feedback_service.go: 反馈提交与列表查询 - 新增 trace_service.go: Trace/AgentTask 详情查询 - 新增 chat_mode_registry.go: chatMode 接口 + 注册表,替代硬编码 if/else 模式路由,新增模式零改动扩展
- chat_prompt_builder.go: 删除 6 个未使用的构建函数 - chat_service_graph_quick.go: 移除已废弃的异步查询改写残留逻辑(80+ 行),流程统一走 Graph 内 QueryRewrite 节点
根因一(chat_service_mode.go): if 块内 := 变量遮蔽导致根 span ctx 丢失,深度模式子 span 全部变孤儿。改为外层声明 span 用 = 赋值,deepCtx 正确携带 chat.deep span 链路 根因二(recorder.go): eino 流式组件 OnEnd 会提前 End 父 span,OTel IsRecording()=false 导致子 span 找不到 parent。新增 currentSpanKey 让 ctx 直接携带自研 Span 引用,与 End 状态解耦;traceState 注册改用 LoadOrStore 防止孤儿 span 覆盖有效 trace 树 根因三(eino_callback.go): OnEnd 后 ctx 仍指向已 End 的组件 span,兄弟节点错误挂成链状嵌套。EndSpan 后将 ctx 恢复为 parent span 验证: TestDeepModeTraceSpans 完整模拟生产链路,trace 树包含 SolvifyDeepAgent/ChatModel/ToolNode/echo_tool 全部组件 span;go build ./... 与 go test ./... 通过
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.
No description provided.