mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-23 18:17:44 +02:00
Eve's review on #1147 correctly pointed out that prepareCodexHome is already idempotent — skipping it on reuse removed the self-heal path for broken auth.json / sessions symlinks and missing config.toml without fixing any real bug (perceived 're-init' was superficial, state was never being churned). Revert the skip-on-exists branch so reuse continues to repair a partially corrupt codex-home. Document the actual semantics in code and in CLI_AND_DAEMON.md: content is preserved (user edits, rollouts, per-session cache), links and missing scaffolding are repaired. Replace the misleading preservation test with two tighter ones: - TestReuseIsIdempotentForCodexHome locks in that user edits and accumulated rollouts survive reuse. - TestReuseHealsCorruptedCodexHome covers the regression Eve called out: reuse must still heal a codex-home that lost its sessions symlink, auth.json link, and config.toml.