Skip to content

Add auto-attach functionality for new feature branches - #3

Merged
promptium-ai merged 2 commits into
mainfrom
feature/auto-launch-ai
Aug 26, 2025
Merged

Add auto-attach functionality for new feature branches#3
promptium-ai merged 2 commits into
mainfrom
feature/auto-launch-ai

Conversation

@promptium-ai

Copy link
Copy Markdown
Collaborator

Summary

  • Auto-attach to tmux session immediately after creating new features
  • Works for both 'create new feature' and 'create from existing branch' workflows
  • Provides seamless developer experience with instant access to Claude AI
  • Preserves existing auto-launch Claude functionality in tmux sessions

Test plan

  • Build project successfully
  • Test creating new feature branch and verify auto-attach
  • Test creating from existing branch and verify auto-attach
  • Verify Claude auto-launch still works in sessions

🤖 Generated with Claude Code

promptium-ai and others added 2 commits August 26, 2025 19:58
- Auto-attach to tmux session immediately after creating new features
- Works for both 'create new feature' and 'create from existing branch' workflows
- Provides seamless developer experience with instant access to Claude AI
- Preserves existing auto-launch Claude functionality in tmux sessions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add "Creating..." state to CreateFeatureDialog with progress feedback
- Fix race conditions by refreshing UI before auto-attach
- Add proper timing delays to ensure tmux sessions are ready
- Make creation flows async with proper error handling
- Prevent worktrees from disappearing due to timing issues
- Improve user experience with visual feedback during creation

Fixes the issue where branches would appear briefly then disappear,
and ensures auto-attach works reliably after branch creation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@promptium-ai
promptium-ai merged commit 7151f4f into main Aug 26, 2025
@agent-era
agent-era deleted the feature/auto-launch-ai branch September 9, 2025 16:20
agent-era-ai added a commit that referenced this pull request Apr 27, 2026
* tracker: seed item files for ralph-tmux-codex-fixes

* fix(git): create worktree on local-only repos with no origin remote

Skip `git fetch origin` when the repo has no `origin` remote, and trust
the resolved base branch from `findBaseBranch` instead of synthesising
an `origin/` prefix that can't be checked out on local-only repos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(sessions): launch fresh AI in just-created worktrees, drop unused fallback

Thread a `freshWorktree` flag from `createFeature` / `recreateImplementWorktree`
call sites through `attachSession` and `launchSessionBackground` into the
launch helpers. When set, launch claude / codex / gemini without their
resume flag — there is no prior session in a directory we just created,
and `codex resume --last` would print a noisy "No saved session found"
on first launch. When false, trust that a prior session exists in the
existing worktree and use the resume form directly (no fallback chain).

Closes ralph-tmux-codex-test findings #2 (plain attach broken on fresh
codex worktrees) and #3 (noisy resume error on first prompted launch).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(tracker): propagate worktree suffix through tracker slug + sessions

When GitService creates a worktree and the requested name collides with
an existing branch, it suffixes (foo → foo-2) but the tracker slug,
item directory, and tmux session name silently drift to the original.
Add `TrackerService.renameItem` that moves the slug across all index
buckets, migrates the sessions metadata key, renames the on-disk item
dir, and rewrites the `slug:` frontmatter. App's `ensureItemWorktree`
detects the mismatch from `recreateImplementWorktree` and adopts the
suffixed name as the canonical slug so everything stays in lockstep.

Closes ralph-tmux-codex-test finding #8.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* tracker: discovery + requirements + implementation notes for ralph-tmux-codex-fixes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Address PR review comments

- Thread `freshWorktree` through the AI tool selection path. When a brand-new
  worktree needs tool selection, the subsequent attach now correctly skips
  `claude --continue` / `codex resume --last`, which was the original bug
  that fix(sessions) targets.
- Document that slug interpolation in `rewriteSlugFrontmatter` is regex-safe
  because `isValidSlug` constrains slugs to `[a-z0-9-]`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant