Commit button commits all file changes instead of feature-specific changes
Description
When clicking the "Commit" button on a feature card in the waiting_approval status, the system commits all file changes in the worktree instead of only committing the files that were modified for that specific feature.
Expected Behavior
Clicking the "Commit" button on a feature card should only commit the files that were changed/modified as part of that specific feature's implementation.
Actual Behavior
Clicking the "Commit" button commits all unstaged changes in the worktree, including:
- Changes from other features that are in progress
- Unrelated file modifications
- Any other uncommitted changes in the worktree
Steps to Reproduce
- Create or have multiple features in progress (or have unrelated uncommitted changes)
- Complete a feature so it moves to
waiting_approval status
- Ensure there are other uncommitted changes in the worktree (from other features or unrelated work)
- Click the "Commit" button on the feature card
- Observe that all changes are committed, not just the feature-specific changes
Technical Details
The issue is located in apps/server/src/services/auto-mode-service.ts in the commitFeature method (line 1054):
// Stage and commit
await execAsync("git add -A", { cwd: workDir });
The git add -A command stages all changes in the worktree, regardless of which feature they belong to.
Impact
- High: This can lead to committing unrelated changes, mixing feature implementations, and potential data loss or incorrect commits
- Users may accidentally commit work from other features or unrelated changes
- Makes it difficult to maintain clean, feature-specific commits
Proposed Solution
The commit operation should:
- Track which files were modified for each specific feature (possibly stored in feature metadata or agent output)
- Only stage and commit those specific files when committing a feature
- Alternatively, use
git add with specific file paths instead of git add -A
Related Files
apps/server/src/services/auto-mode-service.ts (line 1000-1075) - commitFeature method
apps/ui/src/components/views/board-view/hooks/use-board-actions.ts (line 606-661) - handleCommitFeature function
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx (line 270-285) - Commit button UI
Additional Context
- The feature system uses worktrees for isolation when
useWorktrees is enabled
- Features have a
branchName property that associates them with a specific branch/worktree
- The
summary field in features may contain information about what was modified, but this isn't currently used for selective staging
Commit button commits all file changes instead of feature-specific changes
Description
When clicking the "Commit" button on a feature card in the
waiting_approvalstatus, the system commits all file changes in the worktree instead of only committing the files that were modified for that specific feature.Expected Behavior
Clicking the "Commit" button on a feature card should only commit the files that were changed/modified as part of that specific feature's implementation.
Actual Behavior
Clicking the "Commit" button commits all unstaged changes in the worktree, including:
Steps to Reproduce
waiting_approvalstatusTechnical Details
The issue is located in
apps/server/src/services/auto-mode-service.tsin thecommitFeaturemethod (line 1054):The
git add -Acommand stages all changes in the worktree, regardless of which feature they belong to.Impact
Proposed Solution
The commit operation should:
git addwith specific file paths instead ofgit add -ARelated Files
apps/server/src/services/auto-mode-service.ts(line 1000-1075) -commitFeaturemethodapps/ui/src/components/views/board-view/hooks/use-board-actions.ts(line 606-661) -handleCommitFeaturefunctionapps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx(line 270-285) - Commit button UIAdditional Context
useWorktreesis enabledbranchNameproperty that associates them with a specific branch/worktreesummaryfield in features may contain information about what was modified, but this isn't currently used for selective staging