{"record":{"id":"c4e39b257db37828","repo":"windmill-labs/windmill","slug":"instructions-are-required","errorCode":null,"errorMessage":"Instructions are required","messagePattern":"Instructions are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts","lineNumber":2780,"sourceCode":"\t\t\t\t\tvalue: result.tokenUsage.total,\n\t\t\t\t\tworkspace: this.operatingWorkspace\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn result\n\t\t} catch (err) {\n\t\t\tconsole.log('chatRequest error', err)\n\t\t\tconsole.error('chatRequest error', err)\n\t\t\tcallbacks.onMessageEnd()\n\t\t\tthis.cancelLoadingTools('Error')\n\t\t\tif (!abortController.signal.aborted) {\n\t\t\t\tthrow err\n\t\t\t}\n\t\t}\n\t}\n\n\tsendInlineRequest = async (instructions: string, selectedCode: string, selection: Selection) => {\n\t\t// Validate inputs\n\t\tif (!instructions.trim()) {\n\t\t\tthrow new Error('Instructions are required')\n\t\t}\n\t\t// Use a separate abort controller for inline requests to avoid interfering with main chat\n\t\tthis.inlineAbortController = new AbortController()\n\t\tconst lang = this.scriptEditorOptions?.lang ?? 'bun'\n\t\tconst selectedContext: ContextElement[] = [...this.contextManager.getSelectedContext()]\n\t\tconst startLine = selection.startLineNumber\n\t\tconst endLine = selection.endLineNumber\n\t\tselectedContext.push({\n\t\t\ttype: 'code_piece',\n\t\t\tlang,\n\t\t\ttitle: `L${startLine}-L${endLine}`,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\tcontent: selectedCode\n\t\t})\n\n\t\tconst systemMessage: ChatCompletionSystemMessageParam = {","sourceCodeStart":2762,"sourceCodeEnd":2798,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts#L2762-L2798","documentation":"Thrown by sendInlineRequest in AIChatManager when the inline-edit instruction is empty or whitespace-only. Inline requests send a prompt plus a code selection to the model; with no instructions there is no request to make, so the input is rejected before creating an abort controller or any request state.","triggerScenarios":"Thrown at frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts:2780 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Type a non-empty instruction in the inline prompt before submitting","Disable the submit action while the input is empty to prevent the call","Trim user input client-side and treat whitespace-only as empty"],"exampleFix":null,"handlingStrategy":"validation","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"}