feat: repo-local .codex/supermemory.json for per-project container tags - #58
Open
ayushsingh82 wants to merge 1 commit into
Open
feat: repo-local .codex/supermemory.json for per-project container tags#58ayushsingh82 wants to merge 1 commit into
ayushsingh82 wants to merge 1 commit into
Conversation
…ntainer tags The project container tag could only be overridden globally, via projectContainerTag in ~/.codex/supermemory.json. Teams running several local agents against the same repo want one stable shared tag per repo, but a global value has to change every time you switch checkouts. getProjectTag now also reads projectContainerTag from a checked-in <git root>/.codex/supermemory.json (same filename and field names as the global config, tag fields only) and gives it top precedence, ahead of the Claude Code repo config and SUPERMEMORY_REPO_TAG. A repo-local userContainerTag joins the legacy personal read set. The previously active tag stays in the read set, so memory written before the override is still found. Closes the per-project tag half of supermemoryai#13.
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.
Closes the per-project container tag half of #13. (The
response_itemtranscript half is #37.)Why
Right now the only way to override a project's container tag is globally, via
projectContainerTagin~/.codex/supermemory.json. That works fine if you live in one repo, but the issue's use case is a team running Codex, Claude Code and Hermes side by side against the same repo and wanting them all to share one memory bucket. You can't do that with a global setting — the value would need to change every time you switch checkouts, so anyone hopping between repos ends up fighting it.What changed
getProjectTag()now also looks for a.codex/supermemory.jsonchecked into the repo root. It's the same file name and the same field names as the global config — it just lives in the repo and only its tag fields are read:projectContainerTag— the project/repo container for this repo, and it takes precedence over everything elseuserContainerTag— a personal container that gets added to this repo's legacy read setFull precedence order for the project tag, highest first:
Whatever tag was active before you add the override stays in the read set (
getProjectReadTags/getPersonalReadTags), so nothing you've already saved goes dark — no migration step. Discovery only happens at the git root, matching how the existing.claude/.supermemory-claude/config.jsonlookup already works.Testing
npm run typecheckandnpm testare green (69 tests). Added one test — repo-local.codex/supermemory.jsonoverrides the tag and outranks the global config — that checks the repo-local tag beats a globalprojectContainerTag, the old global tag is still inprojectReads, and a repo-localuserContainerTagshows up inpersonalReads.