Skip to content

fix(openviking): synchronous prefetch with timeout guard - #49947

Closed
wgd753 wants to merge 1 commit into
NousResearch:mainfrom
wgd753:fix/ov-prefetch-timeout-guard
Closed

fix(openviking): synchronous prefetch with timeout guard#49947
wgd753 wants to merge 1 commit into
NousResearch:mainfrom
wgd753:fix/ov-prefetch-timeout-guard

Conversation

@wgd753

@wgd753 wgd753 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Superset of #33260 with additional hardening.

Changes vs #33260

Item #33260 This PR
Timeout ❌ default 30s _PREFETCH_TIMEOUT = 1.5s
Score threshold ❌ hardcoded 0.35 _PREFETCH_MIN_SCORE constant
Query processing ❌ raw query _derive_openviking_user_text() strips skill scaffolding
API field top_k (deprecated?) limit (matches queue_prefetch)
Client self._client self._client (same)

Why this matters

Without a timeout guard, the sync prefetch POST uses the 30s default _TIMEOUT — a slow OV server would block the agent turn loop for 30s before every response.

Related

…h#33260+)

Superset of PR NousResearch#33260 with additional hardening:

- Synchronous POST /api/v1/search/find with current turn's query
  (instead of returning stale background cache from previous turn)
- _PREFETCH_TIMEOUT = 1.5s prevents slow OV from blocking turn loop
- _PREFETCH_MIN_SCORE = 0.35 noise filter (matches Claude Code plugin)
- _derive_openviking_user_text() strips skill scaffolding from query
- Uses limit field (same as queue_prefetch) instead of deprecated top_k
- Reuses self._client (native codebase pattern)
- Drains stale background cache on each call

Ref: volcengine/OpenViking#2253, Hermes NousResearch#33260, NousResearch#5820
@alt-glitch alt-glitch added type/perf Performance improvement or optimization comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers P3 Low — cosmetic, nice to have labels Jun 21, 2026
@wgd753 wgd753 closed this Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants