[Bugfix #242] Fix: Tower auto-reconnects to all builder types on startup#243
Merged
waleedkadous merged 2 commits intomainfrom Feb 13, 2026
Merged
Conversation
parseTmuxSessionName() only matched SPIR builders (4+ digit IDs). Bugfix (bugfix-N), task (task-X), and worktree (worktree-X) builders were invisible to the reconciliation loop, preventing auto-reconnect. - Add regex patterns for bugfix, task, and worktree builder IDs - Relax digit requirement from 4+ to 1+ for SPIR spec IDs - Include unrecognized codev-prefixed sessions for SQLite fallback lookup - Extract parseTmuxSessionName to shared session utility for testability - Add 16 regression tests covering all builder ID formats
generateShortId() produces URL-safe base64 (a-zA-Z0-9_-), but the regex only accepted [a-zA-Z0-9]. Widen to [a-zA-Z0-9_-] and add tests.
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.
Summary
Fixes #242
Root Cause
parseTmuxSessionName()in tower-server.ts used the regex^builder-(.+)-(\d{4,})$which only matched SPIR builders with 4+ digit spec IDs (e.g.,0001). Bugfix builders (bugfix-242), task builders (task-AbCd), and worktree builders (worktree-QwEr) were silently filtered out bylistCodevTmuxSessions(), making them invisible to the startup reconciliation loop — even when SQLite had their metadata.Fix
bugfix-\d+), task (task-[a-zA-Z0-9]+), and worktree (worktree-[a-zA-Z0-9]+) builder ID formats\d{4,}to\d+(handles 1-3 digit IDs)listCodevTmuxSessions()for sessions with recognized codev prefixes (architect-,builder-,shell-) but unparseable ID formats — these get included for SQLite metadata lookupreconcileTerminalSessions()to handle nullable parsed data gracefullyparseTmuxSessionName()andParsedTmuxSessiontoutils/session.tsfor testability and co-location withgetBuilderSessionName()Test Plan
parseTmuxSessionName()covering all builder ID formats