You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ui): refresh worktrees from OpenCode ready events (NeuralNomadsAI#583)
## Problem
Worktrees created through OpenCode can leave CodeNomad's cached worktree
inventory and workspace mapping stale. The previous approach in NeuralNomadsAI#516
polled on `session.idle` and attempted to infer which session created a
newly observed worktree, which introduced race conditions and unsafe
attribution.
## Fix
- route OpenCode's `worktree.ready` event through the existing UI SSE
manager;
- reload the live Git worktree inventory when that event arrives;
- synchronize OpenCode workspace mappings only after the refreshed
inventory is available;
- avoid idle polling and avoid auto-switching a session because the
event identifies the new worktree directory but does not identify an
originating session.
The server bridge already forwards arbitrary OpenCode events and
preserves the global event `directory`, so no server change is required.
Supersedes NeuralNomadsAI#516 and implements the SSE approach suggested by @shanturNeuralNomadsAI#516 (comment).
## Validation
- `bun test --conditions browser packages/ui/src` (`126` passing)
- `npm run typecheck --workspace @codenomad/ui`
- `git diff --check`
0 commit comments