Skip to content

Delete the unreachable legacy optimizer decorator path in sessionmanager #6103

Open

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.

Activity

  1. added
    needs-triage
    on Jul 28, 2026
  2. removed
    needs-triage
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions