Conversation
a837835 to
b07af36
Compare
memtomem
added a commit
that referenced
this pull request
May 3, 2026
…FsGuards HOME isn't honored by Path.home() on Windows (it resolves USERPROFILE instead), so the three new TestStepSettingsFsGuards tests in #745 hit the "~/.claude/ missing — Skipping" short-circuit before the guarded write_text was reached, masking the assertions. Patch Path.home directly via classmethod so the test runs the same on every platform. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ail_step (closes #664) Both wizard steps performed filesystem side effects (`mkdir`, `write_text`) without try/except. A read-only project root, full disk, or denied permission would crash `mm init` mid-step with an uncaught Python stack trace and force the user to restart from the top. Mirror the Ollama-branch fail_step adoption from #661 so failures here surface the standard retry/back/quit recovery path. The nested try is required because `fail_step` raises `StepRetry` from inside the `except OSError` handler — a sibling `except StepRetry` on the same statement would not catch it. Adds three tests per step pinning (a) `q` raises `WizardCancel`, (b) `r` retries the failing op without re-prompting earlier inputs, and (c) the wizard does NOT silently advance to the next step on failure — the same invariant shape as the existing `_step_embedding` guards in `TestStepEmbeddingOllamaGuards`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…FsGuards HOME isn't honored by Path.home() on Windows (it resolves USERPROFILE instead), so the three new TestStepSettingsFsGuards tests in #745 hit the "~/.claude/ missing — Skipping" short-circuit before the guarded write_text was reached, masking the assertions. Patch Path.home directly via classmethod so the test runs the same on every platform. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
b07af36 to
553504b
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
_step_memory_dirand_step_settingsperformed filesystem side effects (mkdir,write_text) without try/except. A read-only project root, full disk, orPermissionErrorwould crashmm initwith an uncaught stack trace and force the user to restart from the top.fail_stepretry/back/quit pattern adopted by the Ollama branch in feat(wizard): explicit guardrails for failed init steps (closes #626) #661 — symmetric counterpart to that fix.TestStepEmbeddingOllamaGuards:qcancels viaWizardCancel,rretries the inner op without re-prompting earlier inputs, and a failed op does NOT silently advance to the next step.The nested try is required because
fail_stepraisesStepRetryfrom inside theexcept OSErrorhandler — a siblingexcept StepRetryon the same statement would not catch it. Comment in code explains this.Closes #664. Out-of-scope per the issue body: the warn-and-save patterns in
_step_embedding(ONNX/Ollama/OpenAI client missing) and_step_language(kiwipiepy missing) are documented UX, not bugs.Test plan
uv run pytest packages/memtomem/tests/test_init_cmd.py -k "TestStepMemoryDirFsGuards or TestStepSettingsFsGuards"— 6 passeduv run pytest -m "not ollama"— 3997 passed, 7 skippeduv run ruff check packages/memtomem/src && uv run ruff format --check packages/memtomem/src— cleanuv run mypy packages/memtomem/src/memtomem/cli/init_cmd.py— no issues🤖 Generated with Claude Code