Skip to content

fix(openviking): correct API endpoint paths, response parsing, and auth headers#4742

Closed
catbusconductor wants to merge 1 commit into
NousResearch:mainfrom
catbusconductor:fix/openviking-endpoint-urls
Closed

fix(openviking): correct API endpoint paths, response parsing, and auth headers#4742
catbusconductor wants to merge 1 commit into
NousResearch:mainfrom
catbusconductor:fix/openviking-endpoint-urls

Conversation

@catbusconductor

Copy link
Copy Markdown
Contributor

Summary

Fixes #4740

  • Wrong endpoints: viking_browse used POST /api/v1/browse and viking_read used POST /api/v1/read — neither exists on the OpenViking server. Corrected to GET /api/v1/fs/{ls,tree,stat} and GET /api/v1/content/{read,abstract,overview} respectively.
  • Wrong response parsing: The API returns a list from fs endpoints (not a dict with children key), uses camelCase (isDir not is_dir), and content endpoints return strings directly (not {"content": ...}).
  • Missing auth headers: Added X-OpenViking-Account and X-OpenViking-User headers to _VikingClient for trusted auth mode, sourced from OPENVIKING_ACCOUNT and OPENVIKING_USER env vars.
  • Background thread auth: Client instances in background threads (search, sync, write) now receive the account/user params.

Test plan

  • Configure OpenViking with auth_mode: trusted and verify viking_browse viking:// returns directory listing
  • Verify viking_read at all three levels (abstract, overview, full) returns content
  • Verify background search and sync operations authenticate correctly
  • Verify backward compat when OPENVIKING_ACCOUNT/OPENVIKING_USER env vars are not set (defaults to "default")

🤖 Generated with Claude Code

…th headers

Fixes NousResearch#4740

- Change viking_browse from POST /api/v1/browse to GET /api/v1/fs/{ls,tree,stat}
- Change viking_read from POST /api/v1/read to GET /api/v1/content/{read,abstract,overview}
- Fix response parsing: API returns lists (not dicts with children key), uses camelCase (isDir not is_dir), content endpoints return strings directly
- Add X-OpenViking-Account and X-OpenViking-User headers for trusted auth mode
- Propagate account/user params to background thread client instances
zebster-cmd added a commit to zebster-cmd/hermes-agent that referenced this pull request Apr 3, 2026
…OpenAPI spec

Fixes NousResearch#4740

Validated all endpoints against a running OpenViking server's /openapi.json
spec. This supersedes NousResearch#4742 with additional corrections.

Endpoint corrections:
- viking_browse: POST /api/v1/browse -> GET /api/v1/fs/{ls,tree,stat}?uri=
- viking_read: POST /api/v1/read -> GET /api/v1/content/{read,abstract,overview}?uri=
- viking_search: POST /api/v1/search/find (unchanged, was already correct)
- viking_add_resource: POST /api/v1/resources (not /resources/add)
- Search scope uses target_uri param, limit uses limit param

Response parsing fixes:
- fs endpoints return lists, not dicts with 'children' key
- camelCase fields: isDir (not is_dir), rel_path (not name)
- content endpoints return strings directly in result field
- browse includes abstract field for agent output mode

Auth additions:
- X-OpenViking-Account and X-OpenViking-User headers for trusted auth mode
- OPENVIKING_ACCOUNT / OPENVIKING_USER env vars with config schema entries
- _make_client() helper propagates auth to all background thread clients

Co-authored-by: catbusconductor <120737729+catbusconductor@users.noreply.github.com>
@zebster-cmd

Copy link
Copy Markdown

Hey @catbusconductor — nice catch on the endpoint paths. We validated your findings against a running OpenViking server's /openapi.json spec and confirmed the browse/read/auth fixes are correct.

We found one additional issue your PR doesn't cover:

  • viking_add_resource uses POST /api/v1/resources/add but the actual server endpoint is POST /api/v1/resources (per the OpenAPI spec's add_resource_api_v1_resources_post operation)

We also added:

  • _make_client() helper to avoid repeating the 4-param constructor in every background thread
  • Config schema entries for OPENVIKING_ACCOUNT / OPENVIKING_USER so they show up in hermes memory setup

We've opened #4743 which supersedes this with those additional fixes. Co-authored you since this builds directly on your work. Let us know if you'd prefer we update this PR instead.

teknium1 pushed a commit that referenced this pull request Apr 4, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR #4742 by catbusconductor. Auth header changes dropped
(already on main via #4825).
teknium1 pushed a commit that referenced this pull request Apr 4, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR #4742 by catbusconductor. Auth header changes dropped
(already on main via #4825).
naoironman-hue pushed a commit to naoironman-hue/hermes-agent that referenced this pull request Apr 5, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
zebster-cmd added a commit to zebster-cmd/hermes-agent that referenced this pull request Apr 18, 2026
…OpenAPI spec

Validated all endpoints against running OpenViking server /openapi.json.
Incorporates fixes from upstream PR NousResearch#4742 plus additional corrections.

Endpoint corrections:
- POST /api/v1/browse -> GET /api/v1/fs/{ls,tree,stat}?uri=
- POST /api/v1/read -> GET /api/v1/content/{read,abstract,overview}?uri=
- POST /api/v1/search/find (was correct, our earlier fix wrongly changed it)
- POST /api/v1/resources (not /resources/add)
- target_uri param restored (not scope)
- limit param (not top_k)

Response parsing fixes:
- fs endpoints return lists, not dicts with 'children' key
- camelCase fields: isDir not is_dir, rel_path not name
- content endpoints return strings directly in result

Auth additions (PR NousResearch#4742):
- X-OpenViking-Account and X-OpenViking-User headers for trusted auth mode
- OPENVIKING_ACCOUNT / OPENVIKING_USER env vars + config schema
- _make_client() helper propagates auth to background thread clients
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 28, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
- Browse: POST /api/v1/browse → GET /api/v1/fs/{ls,tree,stat}
- Read: POST /api/v1/read[/abstract] → GET /api/v1/content/{read,abstract,overview}
- System prompt: result.get('children') → len(result) (API returns list)
- Content: result.get('content') → result is a plain string
- Browse: result['entries'] → result is the list; is_dir → isDir (camelCase)
- Browse: add rel_path and abstract fields to entry output

Based on PR NousResearch#4742 by catbusconductor. Auth header changes dropped
(already on main via NousResearch#4825).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(openviking): plugin uses non-existent API endpoints, browse/read tools broken

2 participants