Skip to content

[Bug]: Directory vectors (L0/L1) retain temp URIs after SyncDiff, causing search to return 0 results #743

@takeshi-zhou710

Description

@takeshi-zhou710

Bug Description

Bug Report

OpenViking Version: v0.2.7
Deployment: Docker (ghcr.io/volcengine/openviking:v0.2.7)
Triggered by: Uploading files via temp_path to a remote server


Summary

When uploading a file via the temp_path API flow (i.e., the client is not localhost),
directory-level vectors (L0/L1, i.e. .abstract.md and .overview.md) are written to the
vector store after SyncDiff completes. As a result, they retain viking://temp/xxx/...
URIs instead of the intended viking://resources/... URIs. All subsequent searches return 0 results.

Steps to Reproduce

1. Start OpenViking server

docker run -p 1933:1933 ghcr.io/volcengine/openviking:v0.2.7

2. Upload temp file (simulates remote client flow)

TEMP_URI=$(curl -s -X POST http://localhost:1933/api/v1/temp/upload
-H "X-API-Key: your-key"
-F "file=@test.pdf" | jq -r '.result.uri')

3. Add resource via temp_path

curl -X POST http://localhost:1933/api/v1/resources
-H "X-API-Key: your-key"
-H "Content-Type: application/json"
-d "{"temp_path": "$TEMP_URI", "to": "viking://resources/test/doc", "wait": true}"

4. Search — always returns 0 results

curl -X POST http://localhost:1933/api/v1/search/find
-H "X-API-Key: your-key"
-H "Content-Type: application/json"
-d '{"query": "test", "target_uri": "viking://resources/test", "limit": 5}'

→ {"result": {"resources": [], "total": 0}}

Expected Behavior

After uploading a file via temp_path, all vectors (L0/L1 directory-level and L2 file-level)
should be stored with the final viking://resources/... URI. Specifically:

  • .abstract.md and .overview.md vectors for every directory node should have URIs like
    viking://resources/xxx/xxx (not viking://temp/xxx/xxx)
  • search/find with target_uri="viking://resources/xxx" should return relevant results
  • The behavior should be identical to uploading via path= on localhost

Actual Behavior

Actual Behavior

After uploading via temp_path, SyncDiff only renames the L2 file vectors. The L0/L1
directory vectors are written after SyncDiff completes and retain stale viking://temp/... URIs:

Minimal Reproducible Example

Error Logs

OpenViking Version

v2.7.0

Python Version

3.12.3

Operating System

Linux

Model Backend

None

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions