Skip to content

[good first issue] fix(embedding): enable retry backoff for embedding API calls#173

Open
zhangxiaoshuai98 wants to merge 1 commit into
TencentCloud:mainfrom
zhangxiaoshuai98:fix/embedding-max-retries
Open

[good first issue] fix(embedding): enable retry backoff for embedding API calls#173
zhangxiaoshuai98 wants to merge 1 commit into
TencentCloud:mainfrom
zhangxiaoshuai98:fix/embedding-max-retries

Conversation

@zhangxiaoshuai98

@zhangxiaoshuai98 zhangxiaoshuai98 commented Jun 10, 2026

Copy link
Copy Markdown

Summary

Fixes #159

MAX_RETRIES was hardcoded to 0 in src/core/store/embedding.ts, making the existing exponential backoff retry logic dead code. Transient errors (network jitter, 429 rate limits, DNS failures) caused immediate embedding failure.

Changes

  • Changed MAX_RETRIES from 0 to 3 in src/core/store/embedding.ts
  • Updated comment to document the retry strategy
  • Updated timeoutMs description in openclaw.plugin.json to reflect retry behavior

Retry behavior (after fix)

Attempt Delay Description
0 0ms Initial request
1 500ms 1st retry
2 1000ms 2nd retry
3 1500ms 3rd retry
  • 4xx (except 429): throw immediately, no retry
  • 5xx / 429 / network errors: trigger retry with exponential backoff

This matches the retry strategy already used by tcvdb-client.ts (MAX_RETRIES = 2).

Verification

  • npm run build — passed
  • npm test — 38 tests passed

🤖 Generated with Claude Code

MAX_RETRIES was hardcoded to 0, making the existing exponential
backoff retry logic dead code. Transient errors (network jitter,
429 rate limits, DNS failures) caused immediate embedding failure,
contributing to JSONL/SQLite drift (issue TencentCloud#156).

Changed MAX_RETRIES from 0 to 3, matching the retry strategy
already used by tcvdb-client.ts.

Closes TencentCloud#159

Signed-off-by: WSL_zhangxiaoshuai <zhangxiaoshuai@wsl.com>
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thanks for fixing the retry logic! Transient errors should definitely trigger retries. This will improve embedding reliability significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants