OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

Batched overview generation only counts file summaries and ignores children abstracts — directories with many subdirectories always go single-prompt and time out

Open pengfus opened this issue 4 months ago • 0 comments

Environment

  • OpenViking v0.4.5, code path unchanged in current main (2026-07-10)

Bug

In openviking/storage/queuefs/semantic_processor.py, the decision to use batched overview generation is:

estimated_size = len(file_summaries_str) + len(children_abstracts_str)
over_budget = estimated_size > semantic.max_overview_prompt_chars
many_files = len(file_summaries) > semantic.overview_batch_size

if over_budget and many_files:
    ... _batched_generate_overview(...)

estimated_size correctly includes the children (subdirectory) abstracts, but the many_files gate counts only file summaries. A directory containing many subdirectories and few/no direct files (a very common shape for knowledge bases: in our case 183 subdirectories) can be far over budget yet never satisfies many_files, so it always takes the single-prompt path. All 183 children abstracts are concatenated into one prompt, which times out against the VLM — and due to the placeholder-on-failure behavior (#3151) the directory then permanently loses its abstract.

Reproduction

  1. Create a directory with ~200 subdirectories (each with content that produces an abstract) and no direct files.
  2. Trigger a semantic refresh of that directory.
  3. Observe a single oversized VLM prompt (no "Splitting into batches" log line) and, with an 8B model, a Request timed out error.

Expected behavior

Either count len(children_abstracts) toward the batching gate, or let over_budget alone trigger batching/truncation. The prompt budget check already acknowledges children abstracts contribute to prompt size; the batching gate should be consistent with it.

pengfus avatar Jul 11 '26 05:07 pengfus