You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug]: opencode-plugin ignores peerId from openviking-config.json whenever ovcli.conf or env credentials exist β memories land in shared user space instead of the peerΒ #4487
name: π Bug Report
about: Report a reproducible bug in OpenViking
title: "[Bug]: opencode-plugin ignores peerId from openviking-config.json whenever ovcli.conf or env credentials exist β memories land in shared user space instead of the peer"
labels: ''
assignees: ''
Issue Origin
Observed or reproduced in a real environment
Bug Description
@openviking/opencode-plugin (npm, v0.2.4) silently ignores the peerId set in the project's openviking-config.json whenever shared credentials exist (ovcli.conf or environment variables). The effective peer falls back to empty (with workspacePeer: false), so no peer id is sent at all: sessions and memories are written to the shared user space (viking://user/<user>/...) instead of a peer-scoped tree (viking://user/<user>/peers/<peerId>/...).
This is the same defect class as #3649 (Pi extension), which is still unfixed on main; the proposed fix in #3653 only touches examples/pi-coding-agent-extension/ and would not cover the OpenCode plugin.
Steps to Reproduce
Authenticate the plugin via ~/.openviking/ovcli.conf containing url + api_key (no actor_peer_id set).
Start opencode in the project, have a conversation, let the session commit.
Expected Behavior
Effective peer id is atomic-city (per README: "Configure peerId β¦ to override the workspace-derived peer"), and session messages / memories are stored under the peer scope (peer_id: atomic-city).
Actual Behavior
The file's peerId is dropped. Sessions and memories land in the shared user space; the server-side peers/ directory stays empty. Verified against OpenViking server v0.4.16 (Docker, ghcr.io/volcengine/openviking:v0.4.16) with opencode 1.18.25:
viking://default/user/xdblue/ contains 16 oc-ses_* sessions and all memories at the user root (memories/identity.md, memories/events/2026/08/29/*.md).
peers/ contains only .overview.md / .abstract.md scaffolding β no peer directories.
No peer_id field appears in any messages.jsonl or .meta.json under the user tree.
Auto-recall injections reference viking://user/xdblue/... URIs with no peer segment.
Minimal Reproducible Example
Root cause is in lib/config.mjs (v0.2.4, same logic on main):
loadConfig() sets config.peerId = creds.peerId (line ~288), where creds.peerId comes only from OPENVIKING_PEER_ID or ovcli.conf actor_peer_id/peer_id (lib/shared/credentials.mjs lines ~184-197).
The config file's own peerId is applied only inside applyLegacyConnection() (lines ~108-122), gated by:
With credentialSource === "ovcli" (the normal authenticated setup), the gate is false and the file's peerId is silently discarded.
resolveEffectivePeerId() then skips the workspace fallback because workspacePeer: false, leaving the effective peer empty β so requests carry no peer id at all.
Net effect: the documented file-level peerId only works when there are no credentials anywhere, which is backwards; the common authenticated path (ovcli.conf) is exactly where it never works.
Error Logs
No error is logged β the drop is silent. The only observable symptom is peer-less storage server-side (see Actual Behavior).
Linux (plugin host: Arch; server host: Debian 12, Docker)
Model Backend
None (issue is independent of model backend)
Additional Context
Suggested precedence (matches PR fix(pi): respect peerId from extension configΒ #3653's design for the Pi extension): shared credentials > extension config peerId > workspace-derived peer. In the authenticated case above, shared credentials define no peer id, so the config file's peerId should win over the empty fallback.
Workaround that works today: set OPENVIKING_PEER_ID=atomic-city in the environment (or add actor_peer_id to ovcli.conf, though that is global rather than per-project).
name: π Bug Report
about: Report a reproducible bug in OpenViking
title: "[Bug]: opencode-plugin ignores peerId from openviking-config.json whenever ovcli.conf or env credentials exist β memories land in shared user space instead of the peer"
labels: ''
assignees: ''
Issue Origin
Observed or reproduced in a real environment
Bug Description
@openviking/opencode-plugin(npm, v0.2.4) silently ignores thepeerIdset in the project'sopenviking-config.jsonwhenever shared credentials exist (ovcli.conf or environment variables). The effective peer falls back to empty (withworkspacePeer: false), so no peer id is sent at all: sessions and memories are written to the shared user space (viking://user/<user>/...) instead of a peer-scoped tree (viking://user/<user>/peers/<peerId>/...).This is the same defect class as #3649 (Pi extension), which is still unfixed on
main; the proposed fix in #3653 only touchesexamples/pi-coding-agent-extension/and would not cover the OpenCode plugin.Steps to Reproduce
~/.openviking/ovcli.confcontainingurl+api_key(noactor_peer_idset).openviking-config.json:{ "enabled": true, "peerId": "atomic-city", "recallPeerScope": "actor", "workspacePeer": false, "mcp": { "enabled": true }, "timeoutMs": 30000, "repoContext": { "enabled": true, "cacheTtlMs": 60000 }, "autoRecall": { "enabled": true, "limit": 6, "scoreThreshold": 0.35, "maxContentChars": 500, "preferAbstract": true, "tokenBudget": 2000, "minQueryLength": 3 }, "commitTokenThreshold": 20000, "commitKeepRecentCount": 10, "profileTokenBudget": 10000, "resumeContextBudget": 32000 }Expected Behavior
Effective peer id is
atomic-city(per README: "ConfigurepeerId⦠to override the workspace-derived peer"), and session messages / memories are stored under the peer scope (peer_id: atomic-city).Actual Behavior
The file's
peerIdis dropped. Sessions and memories land in the shared user space; the server-sidepeers/directory stays empty. Verified against OpenViking server v0.4.16 (Docker, ghcr.io/volcengine/openviking:v0.4.16) with opencode 1.18.25:viking://default/user/xdblue/contains 16oc-ses_*sessions and all memories at the user root (memories/identity.md,memories/events/2026/08/29/*.md).peers/contains only.overview.md/.abstract.mdscaffolding β no peer directories.peer_idfield appears in anymessages.jsonlor.meta.jsonunder the user tree.viking://user/xdblue/...URIs with no peer segment.Minimal Reproducible Example
Root cause is in
lib/config.mjs(v0.2.4, same logic onmain):loadConfig()setsconfig.peerId = creds.peerId(line ~288), wherecreds.peerIdcomes only fromOPENVIKING_PEER_IDor ovcli.confactor_peer_id/peer_id(lib/shared/credentials.mjslines ~184-197).peerIdis applied only insideapplyLegacyConnection()(lines ~108-122), gated by:credentialSource === "ovcli"(the normal authenticated setup), the gate is false and the file'speerIdis silently discarded.resolveEffectivePeerId()then skips the workspace fallback becauseworkspacePeer: false, leaving the effective peer empty β so requests carry no peer id at all.Net effect: the documented file-level
peerIdonly works when there are no credentials anywhere, which is backwards; the common authenticated path (ovcli.conf) is exactly where it never works.Error Logs
No error is logged β the drop is silent. The only observable symptom is peer-less storage server-side (see Actual Behavior).
OpenViking Version
0.4.16 (server, Docker image ghcr.io/volcengine/openviking:v0.4.16); plugin @openviking/opencode-plugin 0.2.4 (latest on npm)
Python Version
3.11 (server container)
Operating System
Linux (plugin host: Arch; server host: Debian 12, Docker)
Model Backend
None (issue is independent of model backend)
Additional Context
peerId> workspace-derived peer. In the authenticated case above, shared credentials define no peer id, so the config file'speerIdshould win over the empty fallback.OPENVIKING_PEER_ID=atomic-cityin the environment (or addactor_peer_idto ovcli.conf, though that is global rather than per-project).