Skip to content

Delete the unreachable legacy optimizer decorator path in sessionmanager #6103

Description

@JAORMX

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue needs initial triage by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions