feat(prompts): v2 DB 控制面热切换 —— 版本留存 + 不重启即生效
在 v1(注册表+文件覆盖)上加 DB 管理层与热切换,镜像 model-config 控制面: - store: sundynix_prompt 表(key/version/content/active) + ActivePrompts/ListPrompts/ CreateVersion/Activate/Deactivate - 控制面: ServePrompts/RequestActivePrompts(+Retry)/PublishPromptsUpdated/SubscribePromptsUpdated; prompts.ApplyOverrides 整体替换覆盖集(DB 激活集为权威) - gateway API: GET/POST /api/v1/prompts、version/activate/deactivate;激活/撤销即广播 - dispatcher/mcp-go: 启动拉激活集 + 订阅热更新(不重启) - live: 建版本→激活→mcp-go 图谱抽取 2→0→回滚 2(全程不重启);deactivate 回退代码默认;版本可回溯 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -98,6 +98,12 @@ func main() {
|
||||
go b.RequestConfigWithRetry(ctx, contract.ConfigKindEmbedding, applyEmbed)
|
||||
go b.RequestConfigWithRetry(ctx, contract.ConfigKindChat, applyChat)
|
||||
|
||||
// Prompt 控制面:拉取激活集覆盖内置默认 + 订阅热更新(管理端激活某版即生效,不重启)。
|
||||
go b.RequestPromptsWithRetry(ctx, prompts.ApplyOverrides)
|
||||
if _, err := b.SubscribePromptsUpdated(prompts.ApplyOverrides); err != nil {
|
||||
log.Printf("[mcp_go] subscribe prompts: %v", err)
|
||||
}
|
||||
|
||||
gw := mcp.NewGateway(b, engine, mem, hist, ragEngine, pgDSN)
|
||||
|
||||
log.Println("[mcp_go] serving MCP over sundynix.tools.go.* (Ctrl-C to quit)")
|
||||
|
||||
Reference in New Issue
Block a user