There are two parallel provider systems and the runtime only uses one.
Live path (used at runtime): buildApiHandler() (src/api/index.ts:49) → static *Handler classes (e.g. AnthropicHandler) → hardcoded model maps (anthropicModels, …). This is what TheaTask constructs (src/core/TheaTask.ts:214).
Orphaned path (built but unreachable):
ProviderFactory — 0 runtime callers (referenced only by tests).
- 9
Dynamic*Handler classes (*-dynamic.ts) — imported only by provider-factory.ts.
ModelRegistry (src/api/providers/model-registry.ts) — consumed only by the unregistered webviewMessageHandler and by the dynamic handlers.
model-providers/*-model-provider.ts + *-model-provider.ts — feed ModelRegistry.
buildApiHandler never instantiates any Dynamic*Handler, so the dynamic model-fetching feature documented in docs/dynamic-models-*.md is not wired into the product — users only ever get the static hardcoded model lists. ~20 files form a self-referential island that the coverage inventory counts as "tested" only because the tests exercise each other.
Decision needed
Either:
- Wire it in — route
buildApiHandler (or a new async path) through ProviderFactory/ModelRegistry so live model lists are actually used; or
- Delete it — remove
ProviderFactory, *-dynamic.ts, model-providers/*, and the registry if dynamic fetching is out of scope.
Acceptance
- A single, documented provider-construction path; no parallel infra that the runtime never calls.
Related: dead webview layer (separate issue), tracking issue.
There are two parallel provider systems and the runtime only uses one.
Live path (used at runtime):
buildApiHandler()(src/api/index.ts:49) → static*Handlerclasses (e.g.AnthropicHandler) → hardcoded model maps (anthropicModels, …). This is whatTheaTaskconstructs (src/core/TheaTask.ts:214).Orphaned path (built but unreachable):
ProviderFactory— 0 runtime callers (referenced only by tests).Dynamic*Handlerclasses (*-dynamic.ts) — imported only byprovider-factory.ts.ModelRegistry(src/api/providers/model-registry.ts) — consumed only by the unregisteredwebviewMessageHandlerand by the dynamic handlers.model-providers/*-model-provider.ts+*-model-provider.ts— feedModelRegistry.buildApiHandlernever instantiates anyDynamic*Handler, so the dynamic model-fetching feature documented indocs/dynamic-models-*.mdis not wired into the product — users only ever get the static hardcoded model lists. ~20 files form a self-referential island that the coverage inventory counts as "tested" only because the tests exercise each other.Decision needed
Either:
buildApiHandler(or a new async path) throughProviderFactory/ModelRegistryso live model lists are actually used; orProviderFactory,*-dynamic.ts,model-providers/*, and the registry if dynamic fetching is out of scope.Acceptance
Related: dead webview layer (separate issue), tracking issue.