refactor(mcp-go): 拆除 search.Hybrid 残骸(T4.F)

- search.Hybrid 空转(NewHybrid 返空、Query 返 nil TODO)、构造后存进 Gateway
  却从不被调用(真实 RAG 走 rag.Engine)→ 纯误导性死重量
- 删 internal/search 包 + gateway.go 字段/构造参数 + main.go 接线
- build/vet 干净;wiki_search 不受影响(本就用 g.rag)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-02 13:39:14 +08:00
parent 7c211719d2
commit 6095bc71d2
4 changed files with 5 additions and 39 deletions
+2 -4
View File
@@ -21,13 +21,11 @@ import (
"github.com/sundynix/sundynix-mcp-go/internal/memory"
"github.com/sundynix/sundynix-mcp-go/internal/office"
"github.com/sundynix/sundynix-mcp-go/internal/rag"
"github.com/sundynix/sundynix-mcp-go/internal/search"
)
// Gateway 暴露 MCP 协议端点,经共享 bus 订阅 sundynix.tools.go.* 响应调用。
type Gateway struct {
bus *sharedbus.Bus
search *search.Hybrid
memory *memory.Store
history *history.Store
rag *rag.Engine
@@ -60,8 +58,8 @@ type toolDef struct {
handler func(context.Context, *contract.ToolCall) *contract.ToolResult
}
func NewGateway(b *sharedbus.Bus, s *search.Hybrid, m *memory.Store, h *history.Store, r *rag.Engine, pgDSN string) *Gateway {
g := &Gateway{bus: b, search: s, memory: m, history: h, rag: r, pgDSN: pgDSN}
func NewGateway(b *sharedbus.Bus, m *memory.Store, h *history.Store, r *rag.Engine, pgDSN string) *Gateway {
g := &Gateway{bus: b, memory: m, history: h, rag: r, pgDSN: pgDSN}
g.tools = g.buildRegistry()
return g
}