Skip to content

[good first issue]🎯 fix(embedding): MAX_RETRIES=0 makes retry backoff logic dead code #159

@MuBeiGe

Description

@MuBeiGe

Summary

The embedding service has a well-implemented exponential backoff retry strategy (L13500-L13530 in dist/index.mjs) that never executes because MAX_RETRIES is hardcoded to 0.

Root Cause

L13405 in dist/index.mjs:

const MAX_RETRIES = 0;

The retry loop at L13500:

for (let attempt = 0; attempt <= MAX_RETRIES; attempt++)

With MAX_RETRIES=0, the loop runs exactly once (attempt=0), meaning the retry body is dead code. Transient errors (network jitter, 429 rate limits, temporary DNS failures) cause immediate embedding failure.

Impact

Failed embeddings contribute directly to the JSONL/SQLite drift described in #156. When embedding fails, the record is written to JSONL but may not get a proper vector in SQLite, making it unsearchable.

Suggested Fix

const MAX_RETRIES = 3;

1-line change. The backoff logic (L13526-L13530) is already correctly implemented with jitter and exponential delay.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions