Bug Description
The viking_read tool in the openviking memory plugin returns HTTP 500 when reading file URIs at abstract or overview detail levels.
Root cause confirmed by API testing:
/api/v1/content/abstract — only accepts directory URIs → file URIs return {"error": {"code": "INTERNAL"}}
/api/v1/content/overview — only accepts directory URIs → file URIs return {"error": {"code": "INTERNAL"}}
/api/v1/content/download — only accepts file URIs → directory URIs return a non-JSON response
The plugin routes ALL URIs through abstract and overview regardless of type, but these endpoints are directory-only. File content must go through /api/v1/content/download.
Steps to Reproduce
{
"uri": "viking://user/default/memories/events/mem_cf3e006a-5cdf-4680-b8ec-aa9cf3676426.md",
"level": "abstract"
}
Expected: ~100 token abstract of the file
Actual: 500 Internal Server Error
Verified API Behavior
| Endpoint |
Directory URI |
File URI |
GET /content/abstract |
✅ 200 OK |
❌ 500 INTERNAL |
GET /content/overview |
✅ 200 OK |
❌ 500 INTERNAL |
GET /content/download |
❌ non-JSON |
✅ 200 (raw content) |
Code Location
plugins/memory/openviking/__init__.py, _tool_read() lines 573–599:
if level == "abstract":
resp = self._client.get("/api/v1/content/abstract", params={"uri": uri}) # ← directory-only
elif level == "full":
resp = self._client.get("/api/v1/content/read", params={"uri": uri})
else: # overview
resp = self._client.get("/api/v1/content/overview", params={"uri": uri}) # ← directory-only
Fix
Before calling an endpoint, determine URI type via fs/stat (isDir field), then route:
- file →
/api/v1/content/download
- directory + abstract →
/api/v1/content/abstract
- directory + overview →
/api/v1/content/overview
Or migrate to the official SDK which handles this dispatch internally.
Environment
- openviking server: 0.3.9
- hermes-agent plugin: openviking 2.0.0
Bug Description
The
viking_readtool in the openviking memory plugin returns HTTP 500 when reading file URIs atabstractoroverviewdetail levels.Root cause confirmed by API testing:
/api/v1/content/abstract— only accepts directory URIs → file URIs return{"error": {"code": "INTERNAL"}}/api/v1/content/overview— only accepts directory URIs → file URIs return{"error": {"code": "INTERNAL"}}/api/v1/content/download— only accepts file URIs → directory URIs return a non-JSON responseThe plugin routes ALL URIs through
abstractandoverviewregardless of type, but these endpoints are directory-only. File content must go through/api/v1/content/download.Steps to Reproduce
{ "uri": "viking://user/default/memories/events/mem_cf3e006a-5cdf-4680-b8ec-aa9cf3676426.md", "level": "abstract" }Expected: ~100 token abstract of the file
Actual:
500 Internal Server ErrorVerified API Behavior
GET /content/abstractGET /content/overviewGET /content/downloadCode Location
plugins/memory/openviking/__init__.py,_tool_read()lines 573–599:Fix
Before calling an endpoint, determine URI type via
fs/stat(isDirfield), then route:/api/v1/content/download/api/v1/content/abstract/api/v1/content/overviewOr migrate to the official SDK which handles this dispatch internally.
Environment