resumeAllPendingClaude captured autoResumeGeneration before calling
clearAutoResumeQueue(), which increments the generation counter. This
caused the generation mismatch check to always evaluate true, aborting
the function before resuming any terminals. Move the capture to after
the clear call so the function only aborts on genuinely new external
cancellations.
Also documents the implicit mutex invariant between the active-terminal
effect, processAutoResumeQueue, and resumeAllPendingClaude.
Co-Authored-By: Claude Opus 4.6 <[email protected]>