Repository navigation
Give same-named repos distinct memory scopes (#179) - #1570
Conversation
project_roots registers each main-repo root; the first root to claim a basename keeps the bare key, later ones get <base>-<sha1(root)[:6]>. Boot migration splits rows that still hold a live path; rows merged before the split stay with the bare key. Settings > Memory lists colliding roots and renames a scope (rows move with it). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06a5f89299
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const taken = | ||
| this.db.prepare(`SELECT 1 FROM project_roots WHERE key = ?`).get(next) || | ||
| this.db.prepare(`SELECT 1 FROM entries WHERE project = ? LIMIT 1`).get(next) || | ||
| this.db.prepare(`SELECT 1 FROM session_messages WHERE project = ? LIMIT 1`).get(next) |
There was a problem hiding this comment.
Reject rename targets already used by a code wiki
When the requested key belongs only to an existing code_wiki row—for example, a legacy slug-scoped wiki with no entries, sessions, or project_roots registration—this check treats the key as available. The subsequent UPDATE OR REPLACE either replaces that project's wiki when the source also has one or leaves the existing wiki attached to the newly renamed scope, causing cross-project wiki loss or leakage. Include code_wiki in the collision check before moving the scope.
Useful? React with 👍 / 👎.
| @@ -724,6 +744,7 @@ export function startServer(memory, config, host = '127.0.0.1', configFile) { | |||
| entryCount: memory.entryCount(), | |||
| janitor: memory.janitorSnapshot?.() ?? readJanitorSnapshot(memory.db), | |||
| vectors: memory.vectorsHealth?.() ?? { enabled: false, count: 0, model: null }, | |||
| projectCollisions: memory.projectCollisions?.() ?? [], | |||
There was a problem hiding this comment.
Keep absolute repository paths off the open health endpoint
When two registered repositories share a basename, this adds their full absolute roots to /health, even though the route is explicitly unauthenticated. Any local client able to probe the memory port can now enumerate those repository paths, including usernames and private directory names. Return collision details from an authenticated API endpoint instead, or omit the roots from the public health payload.
Useful? React with 👍 / 👎.
Fixes #179.
What changed
project_rootstable maps each main repo root to its memory key. The first root to claim a folder name keeps the bare key (app), so existing scopes don't move. Later roots with the same name getapp-<6 hex of sha1(root)>. Every key lookup inmemory.jsgoes through it.POST /api/project-scopeendpoint, aprojectCollisionsfield on/health, and amemory.renameScopeIPC call (added to the websettingsscope).app,owner/app) still resolve to the bare key.Tests
CODER_*vars unset. New tests cover two real git repos namedappstaying isolated, stable keys, rename and its refusals, and the migration.test/settingsModal.test.tsx: 87 pass / 0 fail (render, rename, refusal, empty state).electron/test/budget-spend.test.jspins the collisions passthrough inappStatus.Not included: old session transcripts could be split per thread from the electron side. Left as a follow-up.
🤖 Generated with Claude Code