Skip to content

Reindex returns success with zero vectors when directory only contains .overview.md #1706

@SonicBotMan

Description

@SonicBotMan

Bug: Reindex returns "Indexed" with 0 vectors when target has empty .overview.md

Description

When calling POST /api/v1/maintenance/reindex on a URI where the only file is an empty .overview.md (auto-generated summary file), the API returns a successful "Indexed" response but produces zero vectors.

This gives a false positive — the user believes the reindex succeeded, but no meaningful content was actually indexed.

Steps to Reproduce

  1. Have a resource directory that only contains an auto-generated .overview.md file (e.g., a directory that was created but has no actual content files yet)
  2. Call reindex on that directory:
    curl -X POST http://localhost:1933/api/v1/maintenance/reindex \
      -H "Authorization: Bearer <token>" \
      -H "X-OpenViking-Account: wiki" \
      -H "X-OpenViking-User: wiki-user" \
      -H "Content-Type: application/json" \
      -d '{"uri": "viking://wiki/user/wiki-user/resources/empty-dir/"}'
  3. Response: Success with "Indexed" status
  4. Check vectors: 0 new vectors created

Expected Behavior

Either:

  • Skip .overview.md files during reindex (they are metadata, not content), or
  • Return a more informative response indicating how many files were actually indexed vs skipped

Additional Context

The index_resource() function in embedding_utils.py already skips hidden files starting with . (line ~368: if file_name.startswith("."): continue), so .overview.md IS being skipped. The issue is that when .overview.md is the only file in a directory, the reindex appears to succeed but indexed nothing. The response should reflect this.

Environment

  • OpenViking v0.3.10
  • Docker deployment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions