Files
oh-my-opencode/src/features
YeonGyu-Kim 913fac05f5 fix(tmux-subagent): retry stale sweep if first attempt throws
Oracle flagged: staleSweepCompleted was set to true BEFORE
sweepStaleOmoAgentSessions() ran, so any throw from the first
invocation would permanently disable stale cleanup for the rest
of the process lifetime.

Fix:
- Move staleSweepCompleted=true into the try-block success branch.
- Add staleSweepInProgress guard so concurrent onSessionCreated calls
  do not invoke sweep twice in parallel (sweep is idempotent, but the
  guard prevents doubled log noise).
- finally{} clears the inProgress flag regardless of outcome.
- cleanup() resets both flags.

Two new tests cover: retry after a thrown first attempt, and single
invocation when subsequent spawns follow a successful first sweep.
2026-04-18 20:45:21 +09:00
..