Skip to content

Commit button commits all file changes instead of feature-specific changes #193

@webdevcody

Description

@webdevcody

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

  1. Create or have multiple features in progress (or have unrelated uncommitted changes)
  2. Complete a feature so it moves to waiting_approval status
  3. Ensure there are other uncommitted changes in the worktree (from other features or unrelated work)
  4. Click the "Commit" button on the feature card
  5. 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:

  1. Track which files were modified for each specific feature (possibly stored in feature metadata or agent output)
  2. Only stage and commit those specific files when committing a feature
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions