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
The opencode memory plugin (examples/opencode-memory-plugin/) uses a single hardcoded agentId regardless of which project the agent is operating on. Memories from unrelated projects accumulate under the same identity and get surfaced into each other's prompts, polluting context.
Related Issue
Closes#1942. qin-ctx acknowledged the bug in-thread.
Type of Change
Bug fix
Changes Made
Derive an effective agentId per project: base-{slug}-{sha1(directory)[:8]}. Wired up via a new projectIsolation flag in openviking-config.example.json (default on, opt-out for backward compat). Updated the example README so users see the new behavior and how to disable it.
Testing
examples/opencode-memory-plugin/tests/test-project-isolation.mjs exercises the namespace derivation, opt-out, and verifies two projects no longer collide on memory keys.
Validate the OPENVIKING_AGENT_ID_OVERRIDE value before returning it, falling back to the base agent ID if the override is empty or whitespace-only to avoid invalid agent IDs.
Why: The suggestion correctly validates the OPENVIKING_AGENT_ID_OVERRIDE value to avoid using an empty or whitespace-only agent ID, which improves robustness by preventing invalid configurations.
Medium
Avoid mutating input config object
Create a deep copy of the config object before modifying it to prevent unintended side effects on the original input config (e.g., DEFAULT_CONFIG or parsed file config).
Why: The suggestion correctly identifies that mutating the input config object could lead to unintended side effects, and the improved code creates a copy to prevent this. This is a quality improvement that helps maintain code correctness.
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
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.
Description
The opencode memory plugin (
examples/opencode-memory-plugin/) uses a single hardcodedagentIdregardless of which project the agent is operating on. Memories from unrelated projects accumulate under the same identity and get surfaced into each other's prompts, polluting context.Related Issue
Closes #1942. qin-ctx acknowledged the bug in-thread.
Type of Change
Changes Made
Derive an effective agentId per project:
base-{slug}-{sha1(directory)[:8]}. Wired up via a newprojectIsolationflag inopenviking-config.example.json(default on, opt-out for backward compat). Updated the example README so users see the new behavior and how to disable it.Testing
examples/opencode-memory-plugin/tests/test-project-isolation.mjsexercises the namespace derivation, opt-out, and verifies two projects no longer collide on memory keys.Checklist
AI was used for assistance.