fix(tmux): stable server cwd and pane cwd verify retries#3027
Open
AllBeingsFuture wants to merge 1 commit into
Open
fix(tmux): stable server cwd and pane cwd verify retries#3027AllBeingsFuture wants to merge 1 commit into
AllBeingsFuture wants to merge 1 commit into
Conversation
Run the tmux CLI from os.TempDir so the auto-started server is not pinned to a ShipIt/app-bundle cwd that disappears after updates (AgentWrapper#2775). Retry pane-cwd verification briefly before failing, and surface a clearer error when new-session -c falls back to the server cwd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The daemon's first tmux CLI call auto-starts a persistent tmux server that inherits the process cwd for its lifetime. When the desktop app is started from a Squirrel/ShipIt staging path or app bundle that a later auto-update deletes,
new-session -c <workspace>can fall back to that doomed server cwd and strand panes in a deleted directory (class of #2775 / related #2984). Pane cwd verification also failed immediately, which could race a still-applying launch-commandcd.Solution
cmd.Dir = os.TempDir()so the auto-started server is pinned to a stable path that outlives app updates.Tests
go test ./internal/adapters/runtime/tmux/ -count=1TestCreateDestroysAndReturnsErrorWhenPaneCWDDoesNotMatchfor the retry sequence.Notes
local/zh-ui-sync). Independent of any Chinese UI branch — no i18n or frontend changes.Independence
Can merge independently of the workspace stale-prune and httpd forced-shutdown fixes.