{"record":{"id":"03bc75b606964557","repo":"windmill-labs/windmill","slug":"no-code-completion-model-selected","errorCode":null,"errorMessage":"No code completion model selected","messagePattern":"No code completion model selected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/autocomplete/request.ts","lineNumber":30,"sourceCode":"\t\t.map((line) => `${commentSymbol} ${line}`)\n\t\t.join('\\n')\n}\n\nexport async function autocompleteRequest(\n\tcontext: {\n\t\tprefix: string\n\t\tsuffix: string\n\t\tscriptLang: ScriptLang | 'bunnative' | 'jsx' | 'tsx' | 'json'\n\t\tmarkers: editor.IMarker[]\n\t\tlibraries: string\n\t\tworkflowAsCode?: boolean\n\t},\n\tabortController: AbortController\n) {\n\tconst providerModel = get(copilotInfo).codeCompletionModel\n\n\tif (!providerModel) {\n\t\tthrow new Error('No code completion model selected')\n\t}\n\n\t// Only add context lines for native FIM providers - other providers use chat completion\n\t// too much context degrades significantly the quality of the completion\n\tif (providerModel.provider === 'mistral' || providerModel.provider === 'deepseek') {\n\t\tlet commentSymbol = getCommentSymbol(context.scriptLang)\n\t\tlet contextLines = comment(\n\t\t\tcommentSymbol,\n\t\t\t'You are a code completion assistant. You are given three important contexts (<LANGUAGE CONTEXT>, <DIAGNOSTICS>, <LIBRARY METHODS>) to help you complete the code.\\n'\n\t\t)\n\t\tcontextLines += comment(commentSymbol, 'LANGUAGE CONTEXT:\\n')\n\t\tcontextLines += comment(\n\t\t\tcommentSymbol,\n\t\t\tgetLangContext(context.scriptLang, { workflowAsCode: context.workflowAsCode }) + '\\n'\n\t\t)\n\t\tcontextLines += comment(commentSymbol, 'DIAGNOSTICS:\\n')\n\t\tcontextLines += comment(commentSymbol, context.markers.map((m) => m.message).join('\\n') + '\\n')\n\t\tcontextLines += comment(commentSymbol, 'LIBRARY METHODS:\\n')","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/autocomplete/request.ts#L12-L48","documentation":"Thrown by autocompleteRequest before any HTTP call when `copilotInfo.codeCompletionModel` is unset — the instance or workspace has no code-completion (FIM) model configured, so there is nothing to send the prefix/suffix context to. Configuration is missing at the deployment level, not in the calling editor.","triggerScenarios":"Thrown at frontend/src/lib/components/copilot/autocomplete/request.ts:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Select a code completion model in the instance or workspace AI settings","Verify the copilot info endpoint returns a non-empty codeCompletionModel","Confirm the editor only invokes autocomplete after copilot info has loaded"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}