Skip to content

Commit 8f2d438

Browse files
Merge: Addendum 4 — decouple shared memory tree id from legacy RALPH_PROJECT_ID
* claude/naughty-ptolemy-c0b392: fix(memory): decouple shared tree id from legacy RALPH_PROJECT_ID (Addendum 4)
2 parents 5aaad74 + e3f1054 commit 8f2d438

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

scripts/memory/recall_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def main() -> int:
469469
parser.add_argument("--project-root", default=".")
470470
parser.add_argument("--query", default="")
471471
parser.add_argument("--json", action="store_true")
472-
parser.add_argument("--project-id", default=os.environ.get("RALPH_PROJECT_ID", ""))
472+
parser.add_argument("--project-id", default=os.environ.get("RALPH_MEMORY_PROJECT_ID", ""))
473473
parser.add_argument(
474474
"--ralph-home", default=os.environ.get("RALPH_HOME", "~/.ralph")
475475
)

scripts/memory/tree_store.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,15 @@ def compute_project_id(repo_root: Path) -> str:
184184
memory tree (Addendum 2). Distinct repos still get distinct ids via the
185185
remote-hash and/or directory name.
186186
187-
``RALPH_PROJECT_ID`` override (Wave 5, Addendum 3, 2026-06-17): if the env
188-
var is set, it wins. This gives codex/claude an explicit escape hatch and
189-
keeps compatibility with codex's existing ``RALPH_PROJECT_ID`` convention.
190-
When unset, the git-remote-hash derivation below is used so the SAME target
191-
repo yields the SAME id from either agent.
187+
Tree-id override (Wave 5, Addendum 4, 2026-06-17): the DEDICATED env var
188+
``RALPH_MEMORY_PROJECT_ID`` wins when set. We deliberately do NOT honor the
189+
legacy session var ``RALPH_PROJECT_ID`` here, because codex hooks set it to a
190+
per-session ``p-<hash>`` id that would split the shared tree. The shared
191+
memory tree is keyed by git-remote-hash so the SAME target repo yields the
192+
SAME id from either agent; ``RALPH_PROJECT_ID`` stays free for codex's own
193+
ledger/handoff subsystem.
192194
"""
193-
override = os.environ.get("RALPH_PROJECT_ID", "").strip()
195+
override = os.environ.get("RALPH_MEMORY_PROJECT_ID", "").strip()
194196
if override:
195197
return safe_segment(override, "project_id")
196198
main_repo = resolve_main_repo_root(repo_root)

0 commit comments

Comments
 (0)