qishibo/AnotherRedisDesktopManager · warning
Something wrong with your vector
Error message
Something wrong with your vector
What it means
Client-side validation in the similarity dialog's 'vector' mode. parseVectorText (KeyContentVector.vue:315) splits this.simVectorText on commas, trims each token, and maps it through Number(); it returns null when the text is blank or when any token is not a finite number (NaN, Infinity, empty token from a trailing/double comma). runSimilarity() aborts with this toast before any Redis call when the parse yields null.
Source
Thrown at src/components/contents/KeyContentVector.vue:484
},
runSimilarity() {
const { client, redisKey } = this;
const count = this.simCount;
let args;
// search by element name
if (this.simMode === 'ele') {
const element = (this.simElement || '').trim();
if (!element) {
return this.$message.error('Element is required');
}
args = ['VSIM', redisKey, 'ELE', element, 'WITHSCORES', 'WITHATTRIBS', 'COUNT', count];
}
// search by vector
else {
const vector = this.parseVectorText(this.simVectorText);
if (!vector) {
return this.$message.error('Something wrong with your vector');
}
if (this.dim && vector.length !== this.dim) {
return this.$message.error(`Vector dimension must be ${this.dim}`);
}
args = ['VSIM', redisKey, 'VALUES', vector.length, ...vector, 'WITHSCORES', 'WITHATTRIBS', 'COUNT', count];
}
this.simLoading = true;
client.call(...args).then((reply) => {
this.simResults = this.parseSimReply(reply);
this.simLoading = false;
}).catch((e) => {
this.simLoading = false;
this.$message.error(e.message);
});
},
parseSimReply(reply) {View on GitHub (pinned to c149855106)
Solutions
- Reformat the vector as comma-separated bare numbers, e.g. 0.1,0.2,0.3 — no brackets, no quotes
- If pasting from Python/NumPy, strip brackets and convert: ','.join(map(str, vec)) or str(vec.tolist())
- Check for trailing commas, double commas, semicolons, or localized decimal separators (0,1 instead of 0.1) — all produce NaN tokens
- Verify no stray characters (quotes, 'tensor(...)', dtype suffix) remain after pasting
Example fix
// before: only comma-separated input parses
parseVectorText(text) {
if (!text.trim()) return null;
const vector = text.split(',').map(v => Number(v.trim()));
if (!vector.length || vector.some(n => !Number.isFinite(n))) return null;
return vector;
}
// after: also accept whitespace/bracket-separated pastes
parseVectorText(text) {
if (!text) return null;
const cleaned = text.replace(/[\[\]()]/g, '');
const vector = cleaned.split(/[\s,;]+/).filter(t => t.length).map(Number);
if (!vector.length || vector.some(n => !Number.isFinite(n))) return null;
return vector;
} Defensive patterns
Strategy: validation
Validate before calling
// validate before issuing VSIM VALUES
const vector = this.parseVectorText(this.simVectorText);
if (!vector) {
// tell the user WHY: empty vs non-numeric tokens
const tokens = this.simVectorText.split(',').map(s => s.trim()).filter(Boolean);
const bad = tokens.filter(t => !Number.isFinite(Number(t)));
this.vectorError = bad.length ? `Non-numeric component: ${bad[0]}` : 'Vector is empty';
return;
} Type guard
/** True when text parses to a finite-number vector of the expected length. */
function isParsableVector(text, dim) {
if (!text || !text.trim()) return false;
const parts = text.split(',').map(s => Number(s.trim()));
return parts.length > 0 && parts.every(n => Number.isFinite(n)) && (!dim || parts.length === dim);
} Try / catch
null
Prevention
- Normalize pasted embeddings before entering the dialog: strip brackets/quotes and join with commas
- Show a live parse preview (component count + first invalid token) under the textarea instead of failing on submit
- Accept whitespace-separated input in parseVectorText, since most tools print vectors space-separated
When it happens
Trigger: Calling VSIM in VALUES mode with simVectorText that is (a) empty/whitespace-only, (b) space-separated instead of comma-separated numbers like '0.1 0.2 0.3', (c) contains a non-numeric token such as 'abc' or 'null', or (d) has a trailing/doubled comma producing an empty token ('0.1,0.2,').
Common situations: Copying an embedding from Python (repr uses spaces: [0.1, 0.2] sometimes survives but NumPy array str '[-0.01130762 0.04266454 ...]' fails because tokens are space-separated); pasting JSON array text with brackets '[' ']'; pasting scientific notation is fine but '1e' or '--1' is not; empty clipboard paste.
Related errors
- this.$t('message.json_format_failed')
- this.$t('message.modify_failed')
- e.message
- e.message
- ${this.$t('message.modify_failed')}, ${this.$t('message.valu
AI-assisted analysis of qishibo/AnotherRedisDesktopManager@c149855106 (2026-08-22).
Data as JSON: /api/errors/77df0d4b274ca4b1.
Report an issue: GitHub.