Problem
When Forge addresses PR review feedback via the implement_review node, it creates a new commit (e.g., [TICKET] review: address PR feedback) rather than amending the existing commit or squashing before push.
This breaks repositories that validate every commit in a PR individually (e.g., requiring topic prefixes, character limits, Signed-off-by on each commit). The review-fix commit:
- Uses
[TICKET] review: address PR feedback format — violates topic prefix requirements
- Lacks
Signed-off-by trailer
- Has no relation to the project's commit message conventions
Observed Behavior
- Forge creates PR with properly formatted commit (e.g.,
openflow: fix multi-part reply and drain pending msgs)
- Reviewer requests minor changes (e.g., "remove unnecessary empty line")
- Forge's
implement_review correctly fixes the code but pushes as a second commit: [OSPRH-32382] review: address PR feedback
- CI
git-commits check fails because the new commit violates formatting rules
- Manual intervention required to squash and force-push
Root Cause
The implement-review-fix.md prompt explicitly instructs the container agent to create a new commit:
git commit -m "[{ticket_key}] review: address PR feedback"
There is no mechanism to amend the existing commit or squash before push.
Expected Behavior
Forge should either:
- Amend the existing commit (
git commit --amend) to incorporate review fixes, preserving the original commit message format
- Or squash all commits into one before pushing, using the original commit's message
- Or at minimum, follow the target repo's commit message conventions for the new commit (read from
CONTRIBUTING.md, check-commits script, etc.)
Related
Files Involved
src/forge/prompts/v1/implement-review-fix.md (line 15: hardcoded commit format)
src/forge/workflow/nodes/implement_review.py (orchestrates the review fix flow)
Problem
When Forge addresses PR review feedback via the
implement_reviewnode, it creates a new commit (e.g.,[TICKET] review: address PR feedback) rather than amending the existing commit or squashing before push.This breaks repositories that validate every commit in a PR individually (e.g., requiring topic prefixes, character limits,
Signed-off-byon each commit). The review-fix commit:[TICKET] review: address PR feedbackformat — violates topic prefix requirementsSigned-off-bytrailerObserved Behavior
openflow: fix multi-part reply and drain pending msgs)implement_reviewcorrectly fixes the code but pushes as a second commit:[OSPRH-32382] review: address PR feedbackgit-commitscheck fails because the new commit violates formatting rulesRoot Cause
The
implement-review-fix.mdprompt explicitly instructs the container agent to create a new commit:There is no mechanism to amend the existing commit or squash before push.
Expected Behavior
Forge should either:
git commit --amend) to incorporate review fixes, preserving the original commit message formatCONTRIBUTING.md,check-commitsscript, etc.)Related
Files Involved
src/forge/prompts/v1/implement-review-fix.md(line 15: hardcoded commit format)src/forge/workflow/nodes/implement_review.py(orchestrates the review fix flow)