Skip to content

ServerOptions.OCIStore is a dead field #134

Description

@trevor-vaughan

ServerOptions.OCIStore is a dead field

Where: internal/mcp/server.go:36-37

// OCIStore is the directory for OCI artifact caching.
OCIStore string

What's wrong: OCIStore is documented as "the directory for OCI artifact caching",
but nothing in production ever reads it. NewServer drives caching solely from
opts.CacheDir (server.go:79 → source.LoadArtifacts(..., opts.CacheDir)). The only
writers of OCIStore are the unit tests (internal/mcp/server_test.go:45, 81, 112, 236).

Why it matters: the struct has two cache-directory-looking fields, OCIStore and
CacheDir, and only one works. A caller who follows the doc comment and sets OCIStore
gets no caching and no warning — the empty CacheDir makes loadBundleArtifacts fall
back to the in-memory store. The MCP unit tests also set a field the real code path
ignores, so they assert against configuration that has no effect.

Suggestion: delete OCIStore, and update server_test.go to set CacheDir.


Drafted with LLM assistance (Claude Opus 4.6).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions