fix(tmux): disable continuum auto-restore to stop tpo cold-start hang - #1893
Conversation
|
|
Warning Review limit reached
More reviews will be available in 26 minutes and 48 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe ChangesTmux continuum restore configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the tmux configuration in home-manager/programs/tmux/default.nix to disable the automatic restore feature of the continuum plugin (@continuum-restore set to 'off'). A detailed comment has been added explaining that auto-restore is disabled to prevent race conditions and client freezing during cold tmux server starts, with restoration now handled manually. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Mesa DescriptionTL;DR
What changed?
Test plan
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Performed full review of 1614fa2...08c2779
Analysis
• Breaking behavioral change: Global auto-restore disable removes session restoration for all non-work sessions after server restart/crash; users relying on this will lose that functionality with no clear migration path.
• Single point of failure in restore flow: Restoration now depends entirely on users invoking the two command; any alternate entry paths to the work session (or gaps in workflow adoption) will silently skip restore, leading to stale state without validation.
• Incomplete visibility of implementation: The manual restore invocation in _two_function is not shown in this PR; assuming it exists and works correctly creates risk if the underlying resurrect restore call is misconfigured or missing failure handling.
• Documentation gap in user-facing commands: The rationale for changed restore behavior is documented in Nix config comments but likely invisible to end users; shell function definitions (where users see two/tpo/etc.) are not part of this PR, leaving no visible trace of the behavioral shift.
Tip
Help
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
0 files reviewed | 1 comments | Edit Agent Settings • Read Docs
| # server start, racing __tmux_bootstrap_default_session and freezing | ||
| # the freshly-attached client (e.g. on `tpo`). Restore is driven | ||
| # manually by `two`/_two_function for the `work` session only. | ||
| set -g @continuum-restore 'off' |
There was a problem hiding this comment.
This change disables auto-restore globally for all sessions, not just for tpo/tdo/tmo. While this fixes the race condition, it creates a single point of failure: restore now only works if users enter the work session via the two command.
Consider:
- Verify that ALL entrypoints to the
worksession route throughtwo/_two_function- if users can attach toworkviatmux attach -t workor other means, restore won't trigger. - Document this behavioral change in user-facing documentation (README, shell function comments) since the Nix config comment won't be visible to users of the shell commands.
- Confirm that the manual restore in
_two_function(mentioned as lines 33-34) is robust and handles failure cases appropriately.
If auto-restore for other sessions was previously relied upon, this is a functional regression. The test plan should verify behavior after server crash/reboot, not just clean shutdown scenarios.
Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#1893
File: home-manager/programs/tmux/default.nix#L32
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.
Feedback:
This change disables auto-restore globally for all sessions, not just for `tpo`/`tdo`/`tmo`. While this fixes the race condition, it creates a single point of failure: restore now only works if users enter the `work` session via the `two` command.
Consider:
1. Verify that ALL entrypoints to the `work` session route through `two`/`_two_function` - if users can attach to `work` via `tmux attach -t work` or other means, restore won't trigger.
2. Document this behavioral change in user-facing documentation (README, shell function comments) since the Nix config comment won't be visible to users of the shell commands.
3. Confirm that the manual restore in `_two_function` (mentioned as lines 33-34) is robust and handles failure cases appropriately.
If auto-restore for other sessions was previously relied upon, this is a functional regression. The test plan should verify behavior after server crash/reboot, not just clean shutdown scenarios.
Problem
tpohangs on startup unless another tmux session already exists in another tab.Root cause
@continuum-restore 'on'races with__tmux_bootstrap_default_sessionon cold server start:tpo→_tpo_function→ with noprimarysession, runstmux new-session -d -s primary -n btop, which cold-starts the tmux server.main()hitsjust_started_tmux_server→ launchescontinuum_restore.sh &, which (after a 1s sleep) restores the saved sessions, re-spawningbtop fish gitand restoring pane contents.tmux attach-session -t primarylands on a session being rewritten under it → frozen screen.When a session already exists in another tab,
tmux new-sessionreuses the running server, sojust_started_tmux_serveris false → restore never fires → no race. This matches the symptom exactly.Fix
Set
@continuum-restore 'off'. Restore is already driven manually bytwo/_two_functionfor theworksession only (_two_function.fish:33-34invokes the resurrect restore script directly), so auto-restore is redundant there and harmful ontpo/tdo/tmo.tpo/tdo/tmocold-start cleanly, no race, no hang.twois unaffected — it restoresworkitself.worksnapshots stay current.Test plan
home-manager switch, thentmux kill-serveronce to drop the running server holding the oldonvalue.tpowith no existing server → attaches cleanly, no hang.two→ still restores theworksession.Summary by cubic
Disable tmux Continuum auto-restore (
@continuum-restore 'off') to stoptpocold-start hangs; saves still run every 3 minutes andtwokeeps restoringworkmanually. Improve npm-globals to reinstall packages missing platform-native binaries (e.g.,@anthropic-ai/claude-code) and enable the Karabiner keyboard device (vendor 1278, product 22).Written for commit 7e1a603. Summary will update on new commits.