Skip to content

v0.5.20

Latest

Choose a tag to compare

@oxdingzg oxdingzg released this 28 Nov 16:54
9caee72

miao v0.5.20

简体中文

v0.5.20 changes where a Session writes: new Sessions stay in the project directory you launched them in, worktree isolation is an explicit move on a real branch, and a question waits for the operator instead of expiring after a minute.

Sessions start where you launched them

Since 0.5.0 the first Session owned the checkout and every other Session worked in .miao-worktrees/<id>: a detached tree with no branch and no way back. Generated documents therefore lived in a directory the operator never opens. In the reported embrix case the spec existed only in one worktree and on main, while the checkout was on another branch.

Claude Code's local sessions stay in the working directory, and its worktrees are opt-in. miao now does the same:

  • A new Session starts in the checkout it was launched in; several Sessions may share it. The TUI warns when another Session already uses that checkout.
  • Existing Sessions recorded in worktrees keep their roots. miao worktree list shows those paths; merge miao/<name> back, or start a new local Session.

Isolation is explicit and branch-backed

worktree_enter moves a Session into .miao-worktrees/<name> on the real branch miao/<name>. Commits are reachable, reviewable, and mergeable instead of detached.

  • Removing a worktree deletes the branch the tree actually held; miao worktree remove plans against that branch too.
  • A lost worktree is re-homed on its branch after git worktree prune; detached is only a fallback.
  • The TUI names the real root when an isolated Session opens.

Questions wait

question no longer expires after 60 seconds. It waits until the operator answers or rejects it, matching Claude Code's callback, which can stay pending indefinitely. An explicit timeout_ms remains for headless callers, capped at seven days. A routine "engine restarted" notice also no longer erases the "stored the key" notice that caused the restart.

Verification

  • miao-engine 654 lib tests, worktree isolation 5, question 7, worktree module 7, CLI worktree 3, miao-tui 868 lib tests, accuracy 4; clippy clean.
  • No schema bump: existing ledgers need no migration, and other open windows do not block the upgrade.