Symptom
In the mm init default interactive path (and --preset X), typing b at the MCP step (_step_mcp) should conceptually take the user back to the memory-directory step. Instead it lands on _step_provider_dirs_auto, which is a silent step (prints a "No provider memory folders detected." banner, or the "Auto-added N folder(s)" banner, but does not prompt), so it runs its click.echo calls and falls straight through to the next iteration — dropping the user back at _step_mcp with just a re-printed banner in between.
Net effect: "b" at _step_mcp appears to do almost nothing. The user has to hit "b" twice in a row to reach a prompt that can actually accept input, which no wizard documents.
Same shape as #371 but one step further along the flow.
Repro (assuming #418 lands)
$ mm init
Choose setup style: [2]
Directory [~/memories]: /tmp/m
'tmp/m' doesn't exist. Create it? [Y/n] y
No provider memory folders detected (checked: ...)
Run 'mm init --advanced' later to add custom paths.
1. MCP Configuration # (or whatever step_header shows for mcp)
(b: back, q: quit)
Select [2]: b # user hits b expecting to go back to memory-dir
No provider memory folders detected (checked: ...) # banner re-prints
Run 'mm init --advanced' later to add custom paths.
1. MCP Configuration # same prompt reappears, no actual back-nav
(b: back, q: quit)
Select [2]:
Root cause
packages/memtomem/src/memtomem/cli/wizard.py:run_steps:
while i < len(steps):
try:
steps[i](state)
i += 1
except StepBack:
if i > 0:
i -= 1
...
run_steps decrements i and re-runs steps[i], but it doesn't distinguish "user hit b, went back one" from "normal forward step". If steps[i] is silent (no prompt, just echo), it runs its side effect and i += 1 advances right back to where we came from — user never sees a prompt they can act on.
Suggested directions
- Mark silent steps explicitly. Give a step function a marker (attribute, decorator, or separate list) saying "on back-nav pass-through, not present".
run_steps on StepBack keeps decrementing until it hits a non-silent step.
- Teach silent steps to skip their side effects when visited during back-nav. Pass a direction hint from
run_steps (_from_back=True) and steps can short-circuit. More plumbing.
- Fold silent steps into adjacent interactive ones.
_step_provider_dirs_auto's side effect could run inside _step_memory_dir's tail, or inside a wrapper around _step_mcp's head. Removes the silent step entirely.
Direction 1 is the narrowest fix and keeps step composability. Direction 3 would be cleaner but may complicate the advanced-flow case where provider_dirs is also a step.
Acceptance criteria
Related
Symptom
In the
mm initdefault interactive path (and--preset X), typingbat the MCP step (_step_mcp) should conceptually take the user back to the memory-directory step. Instead it lands on_step_provider_dirs_auto, which is a silent step (prints a "No provider memory folders detected." banner, or the "Auto-added N folder(s)" banner, but does not prompt), so it runs itsclick.echocalls and falls straight through to the next iteration — dropping the user back at_step_mcpwith just a re-printed banner in between.Net effect: "b" at
_step_mcpappears to do almost nothing. The user has to hit "b" twice in a row to reach a prompt that can actually accept input, which no wizard documents.Same shape as #371 but one step further along the flow.
Repro (assuming #418 lands)
Root cause
packages/memtomem/src/memtomem/cli/wizard.py:run_steps:run_stepsdecrementsiand re-runssteps[i], but it doesn't distinguish "user hit b, went back one" from "normal forward step". Ifsteps[i]is silent (no prompt, just echo), it runs its side effect andi += 1advances right back to where we came from — user never sees a prompt they can act on.Suggested directions
run_stepsonStepBackkeeps decrementing until it hits a non-silent step.run_steps(_from_back=True) and steps can short-circuit. More plumbing._step_provider_dirs_auto's side effect could run inside_step_memory_dir's tail, or inside a wrapper around_step_mcp's head. Removes the silent step entirely.Direction 1 is the narrowest fix and keeps step composability. Direction 3 would be cleaner but may complicate the advanced-flow case where provider_dirs is also a step.
Acceptance criteria
bat_step_mcplands the user back at the previous prompt (memory-dir), not on a silent step.CliRunner().invoke(init, input="<preset>\n<dir>\ny\nb\n...")and asserts the memory-dir prompt re-appears in the output.Related