{"record":{"id":"e09f69bc8d0b2d00","repo":"can1357/oh-my-pi","slug":"unknown-stt-model-modelkey","errorCode":null,"errorMessage":"Unknown stt model: ${modelKey}","messagePattern":"Unknown stt model: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/stt/asr-worker.ts","lineNumber":374,"sourceCode":"\t\t\tprovider: \"cpu\",\n\t\t\tdebug: 0,\n\t\t},\n\t\tdecodingMethod: \"greedy_search\",\n\t});\n\tsendLog(transport, \"debug\", \"stt: local model loaded\", {\n\t\tmodelKey,\n\t\trepo: spec.repo,\n\t\tengine: \"sherpa\",\n\t\tprovider: \"cpu\",\n\t\tnumThreads,\n\t\telapsedMs: Math.round(performance.now() - startedAt),\n\t});\n\treturn { engine: \"sherpa\", recognizer };\n}\n\nasync function loadModel(modelKey: SttModelKey, transport: SttTransport, requestId: string): Promise<LoadedModel> {\n\tconst spec = getSttModelSpec(modelKey);\n\tif (!spec) throw new Error(`Unknown stt model: ${modelKey}`);\n\tconst cached = replayCachedReady(models, modelKey, transport, requestId, ASR_TASK, spec.repo);\n\tif (cached) return cached;\n\n\tconst loading =\n\t\tspec.engine === \"sherpa\"\n\t\t\t? loadSherpaModel(spec, modelKey, transport, requestId)\n\t\t\t: loadTransformersModel(spec, modelKey, transport, requestId);\n\tconst loaded = loading.then(\n\t\tmodel => {\n\t\t\ttransport.send({\n\t\t\t\ttype: \"progress\",\n\t\t\t\tid: requestId,\n\t\t\t\tevent: { modelKey, status: \"ready\", task: ASR_TASK, model: spec.repo },\n\t\t\t});\n\t\t\treturn model;\n\t\t},\n\t\terror => {\n\t\t\tmodels.delete(modelKey);","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/stt/asr-worker.ts#L356-L392","documentation":"loadModel looks up the STT model spec by key via getSttModelSpec; only keys present in the STT model registry can be loaded. An unrecognized key throws this error before any download or pipeline creation is attempted.","triggerScenarios":"Requesting a model (batch transcribe or streaming session) with a modelKey that is not in the models registry — e.g. a renamed tier, a typo, or a stale client sending an old key.","commonSituations":"Version skew where an older CLI/client sends model keys removed in a newer registry, configuration pointing at a nonexistent model name, or typos in the model identifier.","solutions":["Use one of the registry-defined SttModelKey values (see packages/coding-agent/src/stt/models.ts).","Update the client/CLI so its model keys match the current registry.","Fix the model name in your configuration."],"exampleFix":"// before\nloadModel(\"whisper-large-v3-turbo-q8\", transport, requestId) // not a registered key\n// after\nloadModel(\"whisper-tiny-en\", transport, requestId) // a registered key","handlingStrategy":"validation","validationCode":"import { getSttModelSpec } from \"./models\";\nif (!getSttModelSpec(modelKey)) throw new Error(`invalid stt model key: ${modelKey}`);","typeGuard":"function isKnownSttModel(key: string): key is SttModelKey { return getSttModelSpec(key as SttModelKey) !== undefined; }","tryCatchPattern":"try { const model = await loadModel(modelKey, transport, requestId); } catch (err) { if (String(err).startsWith(\"Unknown stt model\")) { /* fall back to default model key */ } else throw err; }","preventionTips":["Only pass SttModelKey-typed values, never raw strings.","Keep client and worker versions aligned so model registries match.","Validate configured model names against the registry at startup."],"tags":["validation","stt","unknown-model"],"backgroundTag":"unknown-model-key","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}