Skip to content

fix: add validation checks to repo init and support dots in GitHub URLs#320

Merged
dlorenc merged 1 commit intodlorenc:mainfrom
aronchick:work/calm-koala
Jan 28, 2026
Merged

fix: add validation checks to repo init and support dots in GitHub URLs#320
dlorenc merged 1 commit intodlorenc:mainfrom
aronchick:work/calm-koala

Conversation

@aronchick
Copy link
Copy Markdown
Contributor

Summary

Fixes two bugs in the multiclaude init command:

  1. Better error messages for re-initialization attempts: The init command now checks if a repository is already initialized or if the tmux session already exists before attempting to create them. Previously, users would get cryptic "exit status 1" errors. Now they get clear error messages with actionable suggestions.

  2. Support dots in GitHub repository names: The GitHub URL parser now correctly handles repository names containing dots (e.g., demos.expanso.io). The regex was too restrictive and excluded dots from repo names, causing fork detection to fail.

Changes

  • internal/cli/cli.go:1083-1110: Add pre-flight validation checks in initRepo()
    • Check if repo already exists in state before cloning
    • Check if repository directory already exists
    • Check if tmux session exists before creating it
  • internal/fork/fork.go:107-115: Update regex in ParseGitHubURL() to allow dots in repository names
    • Changed from [^/.]+ to [^/]+? to allow any characters except slashes
  • internal/fork/api_test.go:308-314: Update test case to reflect dots are now supported

Test Plan

  • All existing tests pass: go test ./...
  • Fork URL parsing test updated and passing
  • Verified error message when attempting to re-init existing repo
  • Verified fork detection now works with demos.expanso.io

Related Issues

Fixes the bug reported where multiclaude init https://github.com/expanso-io/demos.expanso.io demos-expanso-io failed with:

  • Warning: unable to parse GitHub URL: https://github.com/expanso-io/demos.expanso.io
  • Error: tmux create session failed: exit status 1

🤖 Generated with Claude Code

Fixes two bugs in the init command:

1. The init command now checks if a repository is already initialized or if
   the tmux session already exists before attempting to create them. Previously,
   users would get cryptic "exit status 1" errors when trying to re-initialize
   a repo. Now they get clear error messages with actionable suggestions.

2. The GitHub URL parser now supports repository names containing dots (e.g.,
   demos.expanso.io). The regex was too restrictive and excluded dots from
   repo names, causing fork detection to fail for repos with dotted names.

Changes:
- Add pre-flight checks in initRepo to verify repo doesn't exist in state
- Check if repository directory already exists before cloning
- Check if tmux session exists before attempting to create it
- Update regex in ParseGitHubURL to allow dots in repository names
- Update test to reflect that dots in repo names are now supported

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@dlorenc dlorenc added the multiclaude PRs created by multiclaude workers label Jan 28, 2026
@dlorenc dlorenc merged commit 64fe398 into dlorenc:main Jan 28, 2026
6 checks passed
aronchick added a commit to aronchick/multiclaude that referenced this pull request Jan 29, 2026
…Ls (dlorenc#320)

Fixes two bugs in the init command:

1. The init command now checks if a repository is already initialized or if
   the tmux session already exists before attempting to create them. Previously,
   users would get cryptic "exit status 1" errors when trying to re-initialize
   a repo. Now they get clear error messages with actionable suggestions.

2. The GitHub URL parser now supports repository names containing dots (e.g.,
   demos.expanso.io). The regex was too restrictive and excluded dots from
   repo names, causing fork detection to fail for repos with dotted names.

Changes:
- Add pre-flight checks in initRepo to verify repo doesn't exist in state
- Check if repository directory already exists before cloning
- Check if tmux session exists before attempting to create it
- Update regex in ParseGitHubURL to allow dots in repository names
- Update test to reflect that dots in repo names are now supported

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiclaude PRs created by multiclaude workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants