{"record":{"id":"1019d9d2a5bfcb2e","repo":"qishibo/AnotherRedisDesktopManager","slug":"vector-dimension-must-be-this-dim","errorCode":null,"errorMessage":"Vector dimension must be ${this.dim}","messagePattern":"Vector dimension must be (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/contents/KeyContentVector.vue","lineNumber":358,"sourceCode":"        }).catch((e) => {\n          this.$message.error(e.message);\n        });\n      }\n    },\n    editLine() {\n      const before = this.beforeEditItem;\n      const element = (this.editLineItem.element || '').trim();\n      const vector = this.parseVectorText(this.editLineItem.vectorText);\n      const attrs = (this.editLineItem.attrs || '').trim();\n\n      if (!element) {\n        return this.$message.error('Element is required');\n      }\n      if (!vector || !vector.length) {\n        return this.$message.error('Vector is required');\n      }\n      if (this.dim && vector.length !== this.dim) {\n        return this.$message.error(`Vector dimension must be ${this.dim}`);\n      }\n      if (attrs && !this.$util.isJson(attrs)) {\n        return this.$message.error('Attributes must be valid JSON');\n      }\n\n      this.editDialog = false;\n\n      const vaddArgs = [this.redisKey, 'VALUES', vector.length, ...vector, element];\n      // must match existing set quant-type, otherwise: ERR asked quantization mismatch\n      const quantOpt = this.getQuantOption();\n      quantOpt && vaddArgs.push(quantOpt);\n\n      // set attributes\n      attrs && vaddArgs.push('SETATTR', attrs);\n\n      this.client.call('VADD', ...vaddArgs).then(() => {\n        if (this.isEdit) {\n          this.$message.success({ message: this.$t('message.modify_success'), duration: 1000 });","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/contents/KeyContentVector.vue#L340-L376","documentation":"The parsed vector's length differs from the vector-dim reported by VINFO for this set. Redis vector sets require every element's dimension to match the set's; the client blocks the mismatch before sending VADD (the server would otherwise reject it). The expected dim is interpolated into the message.","triggerScenarios":"Pasting a 1536-dim embedding into a 768-dim set; dropping or adding one component when copying; switching embedding models without recreating the set.","commonSituations":"Model upgrades (e.g. text-embedding dims 384 -> 768); manual copy-paste truncation; mixing embeddings from two models in one key.","solutions":["Re-copy the full embedding and count components against the dim hint in the header","Regenerate the embedding with the model whose dimension matches the set","If the model changed permanently, create a new vector set with the new dimension"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const dim = Number(info['vector-dim']);\nif (dim && vector.length !== dim) {\n  return this.$message.error(`Vector has ${vector.length} components; set requires ${dim}`);\n}","typeGuard":"const matchesDim = (vector, dim) => !dim || vector.length === dim;","tryCatchPattern":null,"preventionTips":["Fetch vector-dim via VINFO and compare lengths before VADD","Watch out for dim = 0 — it means info is missing, not 'any dimension allowed'; refetch instead of skipping the check","When changing embedding models, create a new set sized to the new dimension"],"tags":["validation","vector-sets","dimension-mismatch"],"backgroundTag":"vector-dimension-mismatch","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}