feat: add configurable auto-recall timeout with safer default#316
feat: add configurable auto-recall timeout with safer default#316AliceLJY wants to merge 9 commits intoCortexReach:masterfrom
Conversation
…focus-note-handoff feat(refactor): rework reflection handoff note and drop legacy combined rows
…command-hook-lifecycle fix(reflection): restore /new-/reset trigger reliability after startup hook reset
Co-authored-by: furedericca <263020793+furedericca-lab@users.noreply.github.com>
Co-authored-by: furedericca <263020793+furedericca-lab@users.noreply.github.com>
The auto-recall pipeline in before_agent_start had no timeout guard after the orchestrateDynamicRecall refactor, meaning slow embedding API calls could stall agent startup indefinitely. - Add autoRecallTimeoutMs config option (default 8000ms) - Wrap orchestrateDynamicRecall in Promise.race with configurable timeout - On timeout, log warning and skip injection gracefully Closes CortexReach#314 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| "minimum": 1, | ||
| "maximum": 100, | ||
| "default": 10, | ||
| "description": "Per normalized text key, keep only the most recent N entries before Auto-Recall final trimming." |
There was a problem hiding this comment.
index.ts parses autoRecallTimeoutMs, but openclaw.plugin.json still has additionalProperties: false and does not declare this key anywhere in configSchema/uiHints. As a result, normal config validation and settings-driven discovery will reject or hide the new option, so the feature is not actually configurable for users.
| if (isRedundant) { | ||
| api.logger.debug?.( | ||
| `memory-lancedb-pro: skipping redundant memory ${r.entry.id.slice(0, 8)} (last seen at turn ${lastTurn}, current turn ${currentTurn}, min ${minRepeated})`, | ||
| const result = await Promise.race([ |
There was a problem hiding this comment.
This Promise.race() only abandons the awaited result; it does not cancel orchestrateDynamicRecall(). That helper mutates per-session repeated-injection state before/after loadCandidates(), so a timed-out recall can still finish later in the background and mark rows as “already injected” even though nothing was added to the prompt for this turn.
| { | ||
| "name": "memory-lancedb-pro", | ||
| "version": "1.1.0-beta.4", | ||
| "version": "1.1.0-beta.5", |
There was a problem hiding this comment.
This branch is still carrying an old package snapshot. Current master is already at 1.1.0-beta.9, so keeping beta.5 here means the PR is effectively built on a stale base and will roll version metadata backwards unless it is rebased/refreshed first.
Summary
autoRecallTimeoutMsconfig option to control auto-recall startup timeout (default8000ms)orchestrateDynamicRecallinPromise.racewith the configurable timeoutProblem
After the
orchestrateDynamicRecallrefactor, thebefore_agent_starthook had no timeout guard — slow embedding API calls could stall agent startup indefinitely. The previous beta.9 had a hard-coded 3000ms timeout which was too aggressive for remote embedding setups; the current main lost the timeout entirely.Usage
{ "autoRecallTimeoutMs": 12000 }No change needed for existing users — default is
8000ms, up from the old3000ms.Changes
1 file changed, 17 insertions(+), 1 deletion(-)
index.ts: AddautoRecallTimeoutMstoPluginConfig, addDEFAULT_AUTO_RECALL_TIMEOUT_MSconstant, wrap recall pipeline inPromise.racetimeout, parse config value in config resolverRelated
recallModeconfig (complementary: controls recall granularity)retriever.test()startup timeout issues (same latency theme)Closes #314 — thanks @chinaboard for the detailed report.
Test plan
autoRecallTimeoutMsis not set12000) is respected🤖 Generated with Claude Code