Skip to content

fix: validate project path exists before creating session#327

Merged
njbrake merged 1 commit intonjbrake:mainfrom
hansonkim:fix/validate-session-path
Feb 26, 2026
Merged

fix: validate project path exists before creating session#327
njbrake merged 1 commit intonjbrake:mainfrom
hansonkim:fix/validate-session-path

Conversation

@hansonkim
Copy link
Copy Markdown
Contributor

@hansonkim hansonkim commented Feb 26, 2026

Description

When a non-existent path (e.g. /Users/hanson/aiworks/abc) was entered in the TUI new session dialog, the session silently started in the home directory instead of showing an error.

Root cause: canonicalize() failure in builder.rs fell back to the raw path string, which tmux accepted but silently resolved to $HOME.

Added path existence and directory validation in build_instance() after worktree resolution, leveraging the existing set_error() UI to display a clear error message.

PR Type

  • New Feature
  • Bug Fix
  • Refactor
  • Documentation
  • Infrastructure / CI

Checklist

  • I understand the code I am submitting
  • New and existing tests pass
  • Documentation was updated where necessary
  • For UI changes: included screenshot or recording

AI Usage

  • No AI was used
  • AI was used for drafting/refactoring
  • This is fully AI-generated

AI Model/Tool used: Claude Code (Opus 4.6)

Any Additional AI Details you'd like to share: Bug investigation and fix implementation assisted by AI.

  • I am an AI Agent filling out this form (check box if true)
스크린샷 2026-02-26 오전 11 43 57

When a non-existent path was entered in the TUI new session dialog,
`canonicalize()` failed silently and the raw path string was passed
to tmux. tmux then fell back to the home directory without any error,
causing the session to start in an unexpected location.

Add path existence and directory validation in `build_instance()`
after worktree resolution, so the TUI displays a clear error message
instead of silently creating a session in the wrong directory.
@njbrake njbrake merged commit 6d72398 into njbrake:main Feb 26, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants