{"record":{"id":"f4e8e46f023d3187","repo":"windmill-labs/windmill","slug":"the-latest-editor-changes-for-type-path-co","errorCode":null,"errorMessage":"The latest editor changes for ${type} \"${path}\" could not be saved and are not readable; retry once the editor saves.","messagePattern":"The latest editor changes for (.+?) \"(.+?)\" could not be saved and are not readable; retry once the editor saves\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/global/core.ts","lineNumber":6590,"sourceCode":"\t\t\tif (deployedSide !== undefined) {\n\t\t\t\tbeforeSide = { ...(deployedSide as Record<string, unknown>), path: deployedPath }\n\t\t\t}\n\t\t}\n\t\tif (itemKind === 'variable') {\n\t\t\t;({\n\t\t\t\tbefore: beforeSide,\n\t\t\t\tafter: afterSide,\n\t\t\t\tvalueUncomparable\n\t\t\t} = maskVariableDiffSides(beforeSide, afterSide))\n\t\t\tflushCaveat += valueUncomparable ? SECRET_UNCOMPARABLE_NOTE : VARIABLE_MASKED_NOTE\n\t\t}\n\t\tconst parts = computeDiffParts(beforeSide, afterSide, 'deployed', 'draft')\n\t\tpatch = parts.patch\n\t\tfiles = parts.files\n\t\tflushCaveat +=\n\t\t\t'Note: this diff includes unsaved editor changes that are NOT saved to the server draft yet (auto-save is off or the last save failed).\\n\\n'\n\t} else if (flushSkipped) {\n\t\tthrow new Error(\n\t\t\t`The latest editor changes for ${type} \"${path}\" could not be saved and are not readable; retry once the editor saves.`\n\t\t)\n\t} else {\n\t\tconst entry = await readWorkspaceDiffEntry(workspace, itemKind, storagePath)\n\t\tif (entry) {\n\t\t\tif (entry.status === 'error') {\n\t\t\t\tthrow new Error(`Could not diff ${type} \"${path}\": ${entry.errorMessage}`)\n\t\t\t}\n\t\t\tpatch = entry.patch ?? ''\n\t\t\tnoDeployed = entry.noDeployed === true\n\t\t\tfiles = entry.files\n\t\t\tvalueUncomparable = entry.valueUncomparable === true\n\t\t\tif (entry.valueMasked) {\n\t\t\t\tflushCaveat += valueUncomparable ? SECRET_UNCOMPARABLE_NOTE : VARIABLE_MASKED_NOTE\n\t\t\t}\n\t\t} else {\n\t\t\t// Not in the draft listing — either no draft at all (deployed is current),\n\t\t\t// nothing at the path, or a listing/overlay disagreement; ask the overlay.","sourceCodeStart":6572,"sourceCodeEnd":6608,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/global/core.ts#L6572-L6608","documentation":"Thrown while building the diff_workspace_item output when the editor's unsaved changes for the item cannot be flushed to the draft store and are therefore not readable. The 'draft' side of the diff would silently be stale, so the tool fails loudly instead of showing the model a diff against outdated code.","triggerScenarios":"Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6590 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the editor's save to complete, then re-run the diff tool","Check for draft-store or network errors that blocked the flush","Fall back to the saved draft only after confirming the editor has nothing unsaved"],"exampleFix":null,"handlingStrategy":"retry","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"}