When the repo is in a broken state (wrong branch, detached HEAD, deleted worktree), gt handoff would fail with "cannot detect town root" error. This is exactly when handoff is most needed - to recover and hand off to a fresh session. Changes: - detectTownRootFromCwd() now falls back to GT_TOWN_ROOT and GT_ROOT environment variables when cwd-based detection fails - buildRestartCommand() now propagates GT_ROOT to ensure subsequent handoffs can also use the fallback - Added tests for the fallback behavior Fixes gt-x2q81. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.7 KiB
3.7 KiB