Skip to content

Sync expert registries on worktree return#69

Merged
Cassin01 merged 1 commit into
mainfrom
fix/worktree-reset-on-return
Apr 19, 2026
Merged

Sync expert registries on worktree return#69
Cassin01 merged 1 commit into
mainfrom
fix/worktree-reset-on-return

Conversation

@Cassin01
Copy link
Copy Markdown
Owner

Summary

  • return_expert_from_worktree cleared ExpertContext but left ExpertRegistry (main + router) holding the stale worktree_path. MessageRouter's worktree affinity check then rejected cross-expert messages for experts that had both returned to the project root, silently retrying until MAX_DELIVERY_ATTEMPTS.
  • Extract clear_expert_worktree_state to reset context, both registries, and the on-disk manifest in one place, and call it from the return path so it mirrors the launch path (poll_worktree_launch).

Test plan

  • make ci
  • Launch two experts into worktrees, return both, send a cross-expert message — should deliver on the first attempt (no MAX_DELIVERY_ATTEMPTS retries)

return_expert_from_worktree previously cleared the persisted
ExpertContext but left ExpertRegistry (main and router) holding the
stale worktree_path. MessageRouter's worktree affinity check then
rejected cross-expert messages for experts that had both returned to
the project root, silently retrying until MAX_DELIVERY_ATTEMPTS.

Extract clear_expert_worktree_state to reset context, both registries,
and the on-disk manifest in one place, and call it from the return
path so it mirrors the launch path (poll_worktree_launch).
@Cassin01 Cassin01 merged commit f30085d into main Apr 19, 2026
1 check passed
@Cassin01 Cassin01 deleted the fix/worktree-reset-on-return branch April 19, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant