Problem Summary
When smartExtraction LLM calls fail (timeout, rate limit, network error, etc.), the failure is completely invisible to the user. The agent simply hangs for ~60 seconds with no CMD output, making it impossible to diagnose.
What User Experiences
User sends a message → agent "thinks" for ~60 seconds → then responds normally (failure was swallowed)
No warning, no error, nothing in the CMD window.
Root Cause Analysis
Three-layer silent failure chain:
1. OpenAI SDK retry (src/llm-client.ts:63)
- OpenAI SDK v6.21.0 has
maxRetries: 2 (default)
timeout: 30000 ms per request
- On any LLM failure (timeout, 429, 500, network error): retries 2 more times
- Total wait: 30s × 3 = ~60–90 seconds
2. Error caught and downgraded (src/llm-client.ts:113-118)
} catch (err) {
// Graceful degradation — return null so caller can fall back
log(`memory-lancedb-pro: llm-client [${label}] request failed...`);
return null;
}
The log function here is passed from index.ts and maps to api.logger.debug — which is completely silent in default CMD output.
3. No visible indication to user
- The agent is blocked waiting for the LLM call to finish (with retries)
- CMD shows nothing because all relevant logs are
debug level
- User thinks the agent is "thinking" rather than "retrying a failed LLM call"
Affected Code Locations
| File |
Line |
Issue |
src/llm-client.ts |
116 |
log() for request failures → debug level (silent) |
src/llm-client.ts |
62 |
timeout: 30000 per request, maxRetries: 2 (OpenAI SDK default) |
index.ts |
1663 |
log: (msg) => api.logger.debug(msg) — log function wired to debug |
index.ts |
1679–1681 |
SmartExtractor initialized with log: api.logger.info, debugLog: api.logger.debug |
Proposed Fix
1. High priority: Upgrade LLM failure logs to warn or error
- In
src/llm-client.ts:116, change log(...) → console.error(...) or wire to a warn-level logger
- LLM request failures are user-facing runtime failures, not debug diagnostics
2. Consider exposing maxRetries and timeout in config
- Allow users to configure retry behavior (e.g., disable retries or reduce timeout)
- This would help in air-gapped or rate-limited environments
3. Consider adding a smartExtraction.logLevel config option
- Users who don't want smart extraction verbose logs can silence them
- Users debugging issues can raise the level
Environment
- Plugin: memory-lancedb-pro@1.1.0-beta.9
- OpenAI SDK: ^6.21.0
- LLM config:
smartExtraction.llm.model = models/gemini-3.1-flash-lite-preview
- Symptom observed: 60s hang per message when Gemini rate limited or slow
Reported by: james53882
Date: 2026-03-23
Problem Summary
When
smartExtractionLLM calls fail (timeout, rate limit, network error, etc.), the failure is completely invisible to the user. The agent simply hangs for ~60 seconds with no CMD output, making it impossible to diagnose.What User Experiences
User sends a message → agent "thinks" for ~60 seconds → then responds normally (failure was swallowed)
No warning, no error, nothing in the CMD window.
Root Cause Analysis
Three-layer silent failure chain:
1. OpenAI SDK retry (
src/llm-client.ts:63)maxRetries: 2(default)timeout: 30000ms per request2. Error caught and downgraded (
src/llm-client.ts:113-118)The
logfunction here is passed fromindex.tsand maps toapi.logger.debug— which is completely silent in default CMD output.3. No visible indication to user
debuglevelAffected Code Locations
src/llm-client.tslog()for request failures → debug level (silent)src/llm-client.tstimeout: 30000per request,maxRetries: 2(OpenAI SDK default)index.tslog: (msg) => api.logger.debug(msg)— log function wired to debugindex.tslog: api.logger.info,debugLog: api.logger.debugProposed Fix
1. High priority: Upgrade LLM failure logs to
warnorerrorsrc/llm-client.ts:116, changelog(...)→console.error(...)or wire to awarn-level logger2. Consider exposing
maxRetriesandtimeoutin config3. Consider adding a
smartExtraction.logLevelconfig optionEnvironment
smartExtraction.llm.model = models/gemini-3.1-flash-lite-previewReported by: james53882
Date: 2026-03-23