Problem
When CI fails due to commit message validation (e.g., title too long, missing topic prefix, missing Signed-off-by trailer), the attempt_ci_fix mechanism in ci_evaluator.py is unable to resolve the failure. It correctly identifies the issue from CI logs but can only modify files and create new commits — it cannot amend or squash existing commit messages.
This results in:
- Agent analyzes CI log → correctly identifies commit message formatting is the problem
- Agent attempts to fix → but there are no file changes to make
git commit fails with: nothing added to commit but untracked files present
- CI fix exhausts its attempts → workflow escalates to
forge:blocked
- Manual intervention required (squash commits, reformat message, force-push)
Reproduction
- Target a repository with a
check-commits CI gate that enforces:
- Title length ≤ 72 characters
- Lowercase topic prefix (e.g.,
ipv6:, openflow:)
Signed-off-by trailer
- Run the bug workflow through implementation → PR creation
- Forge generates commits with messages like:
[OSPRH-33668] Fix EPIPE errors in openstack-network-exporter OpenFlow stats collection (too long, no topic prefix, no Signed-off-by)
- CI
git-commits check fails
attempt_ci_fix analyzes the failure, recognizes it's a commit message issue, but cannot fix it
- Workflow blocks after exhausting attempts
Observed CI errors
./check-commits 9013baa..e438ab0
error [1/2] title is longer than 72 characters, please make it shorter
error [1/2] title lacks a lowercase topic prefix (e.g. 'ipv6:')
error [1/2] 'Signed-off-by: Forge <forge@example.com>' trailer is missing
0/2 valid commits
make: *** [Makefile:47: check-commits] Error 1
Worker log
forge.workflow.nodes.ci_evaluator - ERROR - CI fix failed for OSPRH-32382: Git command failed: git commit -m [OSPRH-32382] fix: address CI failures (attempt 1) --author Forge <forge@example.com>
On branch forge/osprh-32382
nothing added to commit but untracked files present
Expected Behavior
attempt_ci_fix should be able to handle commit message formatting failures by:
- Amending the last commit with a corrected message (if safe to do so)
- Or squashing and rewriting commits with properly formatted messages
- Or at minimum, detecting that the failure is a commit message issue (not a code issue) and providing a clear actionable error message to the user instead of exhausting retry attempts
Suggested Approaches
-
Detect commit-message-only failures early: If CI log analysis determines the failure is purely about commit formatting (no code changes needed), use git commit --amend or git rebase to fix messages directly.
-
Teach the container agent commit conventions: Include the target repo's commit message rules (from CI config or .commitlintrc) in the implementation prompt so Forge generates compliant messages from the start.
-
Graceful degradation: If the fix requires commit amendment and the agent can't do it, immediately escalate with a specific message like "CI failed due to commit message format — please amend the commit message to match repository conventions" rather than exhausting all retry attempts with empty commits.
Context
Encountered while running the bug workflow on OSPRH-32382 against openstack-k8s-operators/openstack-network-exporter (PR #53). The repository's check-commits Makefile target enforces conventional commit format. Manual fix required squashing 2 commits into 1 with a compliant message and force-pushing.
Problem
When CI fails due to commit message validation (e.g., title too long, missing topic prefix, missing
Signed-off-bytrailer), theattempt_ci_fixmechanism inci_evaluator.pyis unable to resolve the failure. It correctly identifies the issue from CI logs but can only modify files and create new commits — it cannot amend or squash existing commit messages.This results in:
git commitfails with:nothing added to commit but untracked files presentforge:blockedReproduction
check-commitsCI gate that enforces:ipv6:,openflow:)Signed-off-bytrailer[OSPRH-33668] Fix EPIPE errors in openstack-network-exporter OpenFlow stats collection(too long, no topic prefix, no Signed-off-by)git-commitscheck failsattempt_ci_fixanalyzes the failure, recognizes it's a commit message issue, but cannot fix itObserved CI errors
Worker log
Expected Behavior
attempt_ci_fixshould be able to handle commit message formatting failures by:Suggested Approaches
Detect commit-message-only failures early: If CI log analysis determines the failure is purely about commit formatting (no code changes needed), use
git commit --amendorgit rebaseto fix messages directly.Teach the container agent commit conventions: Include the target repo's commit message rules (from CI config or
.commitlintrc) in the implementation prompt so Forge generates compliant messages from the start.Graceful degradation: If the fix requires commit amendment and the agent can't do it, immediately escalate with a specific message like "CI failed due to commit message format — please amend the commit message to match repository conventions" rather than exhausting all retry attempts with empty commits.
Context
Encountered while running the bug workflow on OSPRH-32382 against
openstack-k8s-operators/openstack-network-exporter(PR #53). The repository'scheck-commitsMakefile target enforces conventional commit format. Manual fix required squashing 2 commits into 1 with a compliant message and force-pushing.