resolveModelIdentity
resolveModelIdentity(
config):ResolvedModelIdentity|undefined
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/utils/systemPromptNotes.ts:176
GS2-34: resolve the active model identity from the effective config, for injection into the system prompt by appendModelContextNote.
Both halves are read the SAME way the rest of gsloth already surfaces the active model:
- MODEL:
config.modelDisplayName(the string the status line renders — set by the loader fromllm.model), falling back to the live model’s ownmodelfield. - PROVIDER: the configured
config.modelProviderType(the rawllm.typethe loader stashed —openrouter/deepseek/xai/anthropic/…) when present, otherwise the live LangChain model’s_llmType()(the source the AG-UI/infoendpoint reports). GS2-53 — preferring the configuredtypefixes the OpenAI-compatible shims (openrouter/deepseek/xai all extend ChatOpenAI, so their_llmType()reportsopenai): atype: openrouterconfig now injectsopenrouter:<model>, notopenai:<model>. Thetypeis absent for module configs (which hand us an already-built LLM), where we fall back to_llmType()unchanged. The MODEL half is always exact.
Returns { identity: 'provider:model', hasProvider: true } when both resolve, { identity: 'model', hasProvider: false } when only the model resolves, and undefined when the model is
unknown (a provider with no model is not a usable identity) — in which case appendModelContextNote injects nothing, leaving the prompt exactly as before. hasProvider is
the authoritative provider-present flag (GS2-53), so a bare model whose NAME contains a colon
(e.g. gemma3:27b) is correctly reported as hasProvider: false. _llmType() is called
defensively (guarded) so a provider whose accessor throws can never break prompt assembly (and is
skipped entirely when a configured type is present).
Parameters
Section titled “Parameters”config
Section titled “config”{ llm?: { _llmType?: () => string; model?: string; }; modelDisplayName?: string; modelProviderType?: string; } | null | undefined
Returns
Section titled “Returns”ResolvedModelIdentity | undefined