Skip to content

Conversation

@markijbema
Copy link
Contributor

Summary

This PR reapplies the changes from PR #3104 that were reverted during the Roo v3.32.0 merge (PR #3895).

The Roo PR #9157 moved auto-approval logic from ChatView to Task, and in the process, the command parsing was moved to src/shared/parse-command.ts. However, this new implementation doesn't preserve newlines within quoted strings, which breaks multi-line git commit messages.

Problem

When using auto-approve with a multi-line git commit message like:

git commit -m "feat: title

- point a
- point b"

The command was being split on newlines, treating each line as a separate command, which caused the auto-approval to fail.

Solution

  • Added src/shared/quote-protection.ts with protectNewlinesInQuotes function that temporarily replaces newlines inside quoted strings with placeholders
  • Updated src/shared/parse-command.ts to use quote protection before splitting by newlines, then restore the newlines after parsing
  • Added comprehensive tests for both the quote protection and parse-command functionality

Testing

  • All existing tests pass
  • Added new tests for:
    • Quote protection functionality
    • Multi-line quoted strings in parseCommand
    • Git commit with multi-line message scenario

Related PRs

@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2025

⚠️ No Changeset found

Latest commit: ca5ada9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This reapplies the changes from PR #3104 that were reverted during the
Roo v3.32.0 merge. The fix ensures that newlines within quoted strings
(e.g., multi-line git commit messages) are preserved and not treated
as command separators during auto-approval validation.

Changes:
- Add src/shared/quote-protection.ts with protectNewlinesInQuotes function
- Update src/shared/parse-command.ts to use quote protection before splitting
- Add comprehensive tests for quote protection and parse-command
@markijbema markijbema force-pushed the mark/reapply-multiline-git-commit-auto-approve branch from 073655b to ca5ada9 Compare November 26, 2025 12:34
@markijbema markijbema marked this pull request as ready for review November 26, 2025 12:44
@markijbema markijbema merged commit 2372ccf into roo-v3.32.0 Nov 26, 2025
@markijbema markijbema deleted the mark/reapply-multiline-git-commit-auto-approve branch November 26, 2025 12:44
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.

3 participants