Context
#6033 (review follow-through) adds a constructor guard in sessionmanager.New: configuring an optimizer (FactoryConfig.OptimizerFactory or OptimizerConfig) without AdvertiseFromCore is now rejected at startup. Previously that configuration installed the optimizer decorator (factory.go, the optimizerFactory != nil && !cfg.AdvertiseFromCore branch) but the Serve layer discarded its advertised tools (serve_optimizer.go returns raw core tools when s.optimizerFactory == nil) — the decorator indexed the FTS5 store (including an embedding round-trip per tool when configured) and served no one, and the Modern capability gate failed open.
What to do
With the guard in place, the !cfg.AdvertiseFromCore optimizer branch in pkg/vmcp/server/sessionmanager/factory.go is unreachable. Delete:
optimizerDecoratorFn (factory.go:160-178)
- the
&& !cfg.AdvertiseFromCore condition and the branch it guards (factory.go:151)
adaptToolsForFactory and the optimizerdec import, if nothing else uses them
and simplify any comments that still describe the "legacy decorator" composition path. Kept out of #6033 to avoid growing an already-XL diff with a cascading deletion.
Blocked on #6033 landing. Refs #6089.
Context
#6033 (review follow-through) adds a constructor guard in
sessionmanager.New: configuring an optimizer (FactoryConfig.OptimizerFactoryorOptimizerConfig) withoutAdvertiseFromCoreis now rejected at startup. Previously that configuration installed the optimizer decorator (factory.go, theoptimizerFactory != nil && !cfg.AdvertiseFromCorebranch) but the Serve layer discarded its advertised tools (serve_optimizer.goreturns raw core tools whens.optimizerFactory == nil) — the decorator indexed the FTS5 store (including an embedding round-trip per tool when configured) and served no one, and the Modern capability gate failed open.What to do
With the guard in place, the
!cfg.AdvertiseFromCoreoptimizer branch inpkg/vmcp/server/sessionmanager/factory.gois unreachable. Delete:optimizerDecoratorFn(factory.go:160-178)&& !cfg.AdvertiseFromCorecondition and the branch it guards (factory.go:151)adaptToolsForFactoryand theoptimizerdecimport, if nothing else uses themand simplify any comments that still describe the "legacy decorator" composition path. Kept out of #6033 to avoid growing an already-XL diff with a cascading deletion.
Blocked on #6033 landing. Refs #6089.