Conversation
Upstream OpenViking removed the uid-less viking://user/<segment> shorthand (NousResearch#4196, merged 2026-08-21): reserved segments like memories and peers no longer expand to the caller's space and the server rejects them with HTTP 400 (NamespaceShapeError). First-party clients were migrated to viking://~ in the same change; the Hermes plugin was not (NousResearch#91995). Migrate every URI the plugin constructs — the profile/preferences/ entities session-start reads, the _build_memory_uri memory-mirroring write path, and the tool-schema example — to viking://~/... README uid-less references updated to match; canonical user-scoped forms (viking://user/default/...) are unchanged. The ~ alias requires OpenViking server >= 0.4.16 (NousResearch#4167).
…tatus Review follow-up to the viking://~ migration: the ~ home alias only expands for USER/ADMIN roles. The DEFAULT dev auth mode (no server.auth_mode, no root_api_key) resolves every request as ROOT, which bypasses current-user expansion — the canonical parser rejects viking://~ with 400 'Home alias URI is not canonical' (verified on a live 0.4.16 server). A deployment upgrading to 0.4.16 with an untouched ov.conf is in dev mode, so the ~ spelling would break exactly the way the old uid-less one will. Mirror the upstream first-party plugin pattern instead: resolve the user space client-side from /api/v1/system/status (result.user, 'default' fallback) and emit explicit-uid viking://user/<user>/memories/... URIs, which are canonical under every auth mode (dev/ROOT, trusted/USER, api-key) and every server version. viking://~/... input typed by the user keeps passing through untouched. (NousResearch#91995)
Contributor
ehz0ah
marked this pull request as ready for review
August 25, 2026 02:25
kshitijk4poor
added a commit
that referenced
this pull request
Aug 25, 2026
- Key _user_space_cache on _conn_snapshot instead of client object identity, so _new_client() results from the same connection share the cached user (previously every on_memory_write triggered an uncached /api/v1/system/status probe with a 30s default timeout) - Thread a short timeout (0.05s) through the write-path identity probe - Harden _tool_remember to snapshot the client before URI construction + POST, matching the pattern already established in on_memory_write - Remove dead instance method _user_scoped_uri (zero callers; all call sites use the module-level function directly) Co-authored-by: ehz0ah <haozhe4547@gmail.com>
Contributor
|
Merged via #94515. Your commits cherry-picked with authorship preserved via rebase-merge. The salvage also includes a follow-up commit that keys the user-space cache on the connection snapshot (so Thanks for the thorough work on the connection-scoped cache and operation consistency! |
4 tasks
and7777
pushed a commit
to and7777/hermes-agent
that referenced
this pull request
Aug 27, 2026
…ot, dead code - Key _user_space_cache on _conn_snapshot instead of client object identity, so _new_client() results from the same connection share the cached user (previously every on_memory_write triggered an uncached /api/v1/system/status probe with a 30s default timeout) - Thread a short timeout (0.05s) through the write-path identity probe - Harden _tool_remember to snapshot the client before URI construction + POST, matching the pattern already established in on_memory_write - Remove dead instance method _user_scoped_uri (zero callers; all call sites use the module-level function directly) Co-authored-by: ehz0ah <haozhe4547@gmail.com>
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…ot, dead code - Key _user_space_cache on _conn_snapshot instead of client object identity, so _new_client() results from the same connection share the cached user (previously every on_memory_write triggered an uncached /api/v1/system/status probe with a 30s default timeout) - Thread a short timeout (0.05s) through the write-path identity probe - Harden _tool_remember to snapshot the client before URI construction + POST, matching the pattern already established in on_memory_write - Remove dead instance method _user_scoped_uri (zero callers; all call sites use the module-level function directly) Co-authored-by: ehz0ah <haozhe4547@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
viking://user/{user}/...URIs./api/v1/system/status.This PR includes both commits from #91998 by @liuhao1024 with authorship preserved. The two follow-up commits add connection-scoped identity handling, operation consistency, and regression tests.
Why
OpenViking main removed
viking://user/<reserved-segment>as a current-user shorthand. Hermes still emits that form for session-start reads and memory writes, which will return HTTP 400 after the next OpenViking release.Using
viking://~alone is not sufficient because it is not expanded for ROOT requests in the default development mode. Explicit-user URIs work in ROOT, ADMIN, USER, trusted, and API-key configurations.Hermes can reload OpenViking profiles and credentials without recreating the provider. The selected user, generated URI, request deadline, and client identity must therefore stay consistent for each recall or write operation.
Test plan
python -m pytest tests/openviking_plugin/test_openviking.py tests/plugins/memory/test_openviking_provider.py tests/plugins/memory/test_openviking_shutdown.py tests/plugins/memory/test_openviking_endpoint_always_blocked.py -qmain(64a6f42c).ruff checkon the changed Python filespython scripts/check-windows-footguns.py --diff upstream/maingit diff --checkv0.4.16(499995f3)main(234a2d9f)For both OpenViking revisions, the real namespace parser accepted the emitted profile, preferences, entities, and peer-memory URIs for ROOT, ADMIN, and USER roles. The real system status route returned the authenticated user ID used in those URIs.
Live OpenViking compatibility
On precursor head
17c05c5eb1, each OpenViking revision was started as an isolated server with valid Doubao model configuration and exercised through Hermes over HTTP:v0.4.16(499995f3)main(234a2d9f)Each of the six cases verified:
/api/v1/system/statusand Hermes authenticated-user resolution/api/v1/content/writeand/api/v1/content/readround tripsThe API-key cases configured an intentionally incorrect user in Hermes and confirmed that Hermes used the user identity asserted by OpenViking instead. The focused follow-up commit
7056a12766does not change the HTTP or URI contracts; its operation-level timeout and connection-consistency paths are covered by the current 115-test suite.Platforms
Tested on macOS. The change is platform-independent HTTP and URI handling.
Fixes #91995.